Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault in test shutdown with specific module #866

Closed
mrbean-bremen opened this issue Aug 15, 2023 · 1 comment
Closed

Segfault in test shutdown with specific module #866

mrbean-bremen opened this issue Aug 15, 2023 · 1 comment
Labels

Comments

@mrbean-bremen
Copy link
Member

mrbean-bremen commented Aug 15, 2023

I accidentally stumbled over an issue related to pyfakefs if running it with opentimelineio code.

With the following code (copied from the issue):

import opentimelineio as otio

# Does not segfault if you comment out this "test"
def test_empty_fs(fs):
    pass


def test_create_clip():
    # can be child classes of SerializableObjectWithMetadata (Clip, Gap, etc),
    # however other otio C++ classes appear to be ok (RationalTime, TimeRange,
    # TimeTransform)
    otio.core.SerializableObjectWithMetadata(
        # also does not segfault if you comment this out
        metadata={}
    )

If running this, a segmentation fault occurs on test shutdown, and with Python versions >=3.10 an additional error is shown:

Fatal Python error: PyThreadState_Get: the function must be called with the GIL held, but the GIL is released (the current Python thread state is NULL)
Python runtime state: finalizing (tstate=0x00000208960683d0)

I can reproduce this on all systems (Windows, Linux, MacOS) in the CI, with different Python and Pytest versions (except for Python 3.7 with Pytest versions from 4.6 to 5.3, for some reason).

I currently have no idea what causes this, but is seems to have something to do with the cache.

mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Aug 17, 2023
- avoids problems with cached modules during session shutdown
- see pytest-dev#866
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Aug 18, 2023
- avoids problems with cached modules during session shutdown
- see pytest-dev#866
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Aug 18, 2023
- avoids problems with cached modules during session shutdown
- see pytest-dev#866
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Aug 18, 2023
- avoids problems with cached modules during session shutdown
- see pytest-dev#866
mrbean-bremen added a commit that referenced this issue Aug 18, 2023
- avoids problems with cached modules during session shutdown
- see #866
@mrbean-bremen
Copy link
Member Author

Closing as handled - shall be reopened if a similar issue comes up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant