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 testing src/sage/libs/gap/element.pyx on python 3.12 #37026
Comments
my eyes bleed from this line: rnd = [ randint(-10,10) for i in range(randint(0,7)) ] How about rnd = random.choices(range(-10,10), k=randint(0,7)) ? See https://docs.python.org/3/library/random.html#random.choices |
maybe it segfaults on |
This also pops up on Fedora 39 with system Python 3.12, see e.g. https://groups.google.com/g/sage-release/c/oTnTrEnB3YU/m/tZiLm66ZAwAJ |
But I can't reproduce this with Python 3.12.2 |
Is it possible that both @jaapspies and me are missing some python3 system package? |
At some point this segfault occured only in tests, now it happens also in the command line |
Tried that but it does not have an effect
|
There's a more detailed trace in #36407 (comment) |
Caused by GCC commit https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=049ec9b981d1f4f97736061d5cf7d0ae990b57d7 Upstream report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114872 Can be reproduced by calling any libgap function in exactly 3 parameters, eg. |
@sheerluck has kindly disassembled broken Fixing gcc is above my payrate, though :-) |
This appears to fix sagemath#37026
more discussion on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114872 seems to indicate that gcc is actually not broken, it's our code that is (missing volatile declarations). If I am not mistaken, we have
and the Looks like a lot of |
See https://trofi.github.io/posts/312-the-sagemath-saga.html for a detailed analysis. Not sure whether the detail that GAP uses setjmp/longjmp to return from |
By the way, the Python 3.12 is only needed to produce a crash. Otherwise, we get a memory leak, as these temporary GAP objects are not cleared.
|
This appears to fix sagemath#37026
This appears to fix sagemath#37026 (segfaults in src/sage/libs/gap/element.pyx with Python 3.12 and gcc 13.2.1) See also sagemath#36407 (comment) The corresponding gcc 13.2.1's bug (or feature) is being dealt with here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114872 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#37951 Reported by: Dima Pasechnik Reviewer(s): Dima Pasechnik, Gonzalo Tornaría
This appears to fix sagemath#37026 (segfaults in src/sage/libs/gap/element.pyx with Python 3.12 and gcc 13.2.1) See also sagemath#36407 (comment) The corresponding gcc 13.2.1's bug (or feature) is being dealt with here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114872 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#37951 Reported by: Dima Pasechnik Reviewer(s): Dima Pasechnik, Gonzalo Tornaría
This appears to fix sagemath#37026 (segfaults in src/sage/libs/gap/element.pyx with Python 3.12 and gcc 13.2.1) See also sagemath#36407 (comment) The corresponding gcc 13.2.1's bug (or feature) is being dealt with here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114872 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#37951 Reported by: Dima Pasechnik Reviewer(s): Dima Pasechnik, Gonzalo Tornaría
This appears to fix sagemath#37026 (segfaults in src/sage/libs/gap/element.pyx with Python 3.12 and gcc 13.2.1) See also sagemath#36407 (comment) The corresponding gcc 13.2.1's bug (or feature) is being dealt with here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114872 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#37951 Reported by: Dima Pasechnik Reviewer(s): Dima Pasechnik, Gonzalo Tornaría
Concerning the error in
src/sage/libs/gap/element.pyx
, it happens in line 2489:getting
Killed due to segmentation fault
. Running this code in the terminal works, the error appears only in tests and with python 3.12.Originally posted by @enriqueartal in #37011 (comment)
The text was updated successfully, but these errors were encountered: