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 raised by AlignmentFilePileup_test.py with python3.11 #1151
Comments
@AndreasHeger @jmarshall any idea? :-) |
Apparently there may be an attempt to ship Debian 12 with python3.11 (transition will be tracked in Debian bug#1024425), so chance are this issue needs to be adequately addressed sooner than later. Two days ago, I had a look back at this issue, trying to fix or work around it, but didn't manage to get very far. Upon closer inspection, I noticed that the way the test is run during the packaging raises the segmentation fault earlier in the test:
The Debian build log says:
where line 220 corresponds to: self.assertRaises(ValueError, max_col.get_query_sequences) But, when I run my reproducer:
get_query_sequences does raise the ValueError as expected, and then my segmentation fault occurs on the next test, about get_num_aligned, and it is reflected by symbols shown in gdb output. I'm not sure whether that helps, but the way tests are started seems to be a data point. |
This is a fairly ridiculous test case. “Please verify that my invalid code results in a pleasing exception rather than a segfault.” Doctor, it hurts when I do this — so don’t do that, then! 😄 So if this cannot be fixed, an appropriate approach would be to disable this particular test or remove it altogether. I have reproduced this with Python 3.11, which has presumably changed the way unreferenced objects call Cython deallocators or something. I will compare what happens with earlier Pythons and see if it can be improved with 3.11. But as the code tested is essentially invalid C usage, I don’t think it is guaranteed to be particularly fixable. |
Hi John,
John Marshall, on 2022-12-26:
So if this cannot be fixed, an appropriate approach would be to disable this particular test or remove it altogether.
Sounds good, will proceed this way for now then.
Thanks for your time!
Have nice solstice festivities, :)
--
Étienne Mollier ***@***.***>
Fingerprint: 8f91 b227 c7d6 f2b1 948c 8236 793c f67e 8f0d 11da
Sent from /dev/pts/1, please excuse my verbosity.
|
Test on 3.11 since it has been released for a while. The macOS py-3.11 build fails due to a mysterious missing liblzma, so (for now) activate only py-3.10 on the macOS "direct" job, not 3.11. Disable testIteratorOutOfScope test on Python 3.11. This test exercises invalid code and checks that it results in an exception rather than a segfault. It seems that Python 3.11 has changed the way unreferenced objects call Cython deallocators, or something similar, and the code leads to a crash on 3.11. Work around pysam-developers#1151 by disabling the test for the time being.
For the time being, I have suppressed the test case (for Python 3.11) on the master branch. Let's leave this issue open in the hope that someone will be able to analyse what has changed in 3.11 and hence fix it properly. |
Greetings,
With the introduction of python3.11 in Debian sid, Graham Inggs
noticed in Debian Bug#1024425 that in pysam 0.19.1, the
tests/AlignmentFilePileup_test.py::TestPileupObjects::testIteratorOutOfScope
raises a segmentation fault when running on top of the
python3.11 interpreter. I could reproduce a similar behavior
while trying to upgrade the pysam package to version 0.20.0.
I attempted to pinpoint the issue by running the faulty test in
pysam 0.20.0 in gdb. Here is what I could get out of the
debugger:
All I managed to see is that the address stored in the pileup
object seems dubious. With python3.10 it lands in the range
of addressable virtual memory, but with python3.11 it is not
NULL but unlikely valid:
It is also quite possible that I am not looking at the right
thing, and that for the moment the python3.11 interpreter in
Debian sid is buggy. But to be honest, I do not know whether
this is the case or not, and thought you might want to be aware
of the issue in any case.
If that can be reassurring, the problem is not particularly
urgent: we intend to ship Debian 12 with python3.10, bonus
points if python3.11 makes it too. In the meantime, I can
disable python3.11 support for pysam in Debian.
Have a nice day, :)
Étienne.
The text was updated successfully, but these errors were encountered: