You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cothread generates segmentation faults when run with Coverage #73
In Python3.11+, it seems that Cothread is incompatible with Coverage. Attempting to run it will cause a segmentation fault during Pytest's cleanup stage, presumably at the stage when Coverage is doing its processing.
To recreate, create a Python3.11 virtual environment and add this program to the tests/ directory, named test_crash.py or simiar.
A small amount of extra information can be gleaned from running the test under Valgrind: valgrind pytest -s --cov=cothread --cov-report term --cov-report xml:cov.xml tests/test_crash.py. See attached file.
At this time it is unknown if this is the only incompatibility with Cothread; it is possible other programs that do similar interactions with the various PyThread_* API calls will also suffer from issues or not.
Activity
Remove coverage from tests
Merge pull request #72 from DiamondLightSource/ci_fixes
pjnaughton commentedon Sep 10, 2026
Interestingly, this example does not segfault when debugged using
pdb.And continued, or when the test forced to wait at the end of the test .
This implies the Segmentation fault is a result of a race condition between Cothread and pytest-cov.
All example were used done on Python 3.14 and tested with the same command as above.
Remove Coverage from tests
Remove Coverage from tests