-
Notifications
You must be signed in to change notification settings - Fork 32
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
Test suite segfault with python 3.11 RC1 #85
Comments
Thank you very much for your report. Could you help me reproducing it? I tried in the branch https://github.com/thierry-martinez/pyml/tree/github-actions-python311 without success: there are two github actions, one using Fedora Rawhide, the other using ubuntu by compiling python 3.11 rc1 from scratch, and both succeed running test suites (as this can be seen here: https://github.com/thierry-martinez/pyml/actions/runs/3025355753). The If you may provide a |
Sorry for the long delay. I got caught up in a mad rush to get other things finalized before Fedora 37 final freeze. I don't have a Dockerfile, sorry. I'm using mock, which is what Fedora uses to build packages as well. I did a little debugging to see if I could gather more information, and I think I see the problem. Here's what happens.
The bottom line is that I think that the object in |
Thank you for your debugging! I am still not able to reproduce the bug, but it is indeed bad to keep references to some python objects while the library has been unloaded. It should be fixed in #86: could you check if it is indeed the case? |
Yes, that fixes the issue. Thank you for the quick response! |
…on_finalize Fix #85: segmentation fault by forgetting objects on library unloading
Thank you, @jamesjer ! Sorry for the late merging. I will try to make a release soon. |
I attempted to build pyml 20220905 for Fedora Rawhide, which currently has python 3.11 RC1. The test suite failed with a segfault:
GDB says:
A null pointer is being passed to
unicode_fromformat_write_cstr
. Working up the stack to see where that comes from leads to frame 6, where we see that object v has a bogus type:The null
tp_name
field is what ultimately causes the segfault. (The other object, w, is an instance of TypeError.) The comparison with the bogus object happens on line 799 of py.ml (frame 12):This seems to mean that ptype is the instance of TypeError, and
ocaml_exception_class
contains a Python object with a badob_type
field.Address randomization seems to be involved. Fedora builds PIE objects by default.
set disable-randomization off
is executed prior to starting execution. Otherwise, GDB sees the tests complete successfully.setarch -R ./pyml_tests.exe
consistently succeeds, and omitting the setarch call consistently segfaults.I'm willing to experiment if anybody has an idea.
The text was updated successfully, but these errors were encountered: