-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Breaking Integer's invariant can lead to a segfault in Sage 4.3.2.alpha1, Mac OS X 10.6.2 #8177
Comments
comment:1
Here is a complete self-contained session that illustrates the problem:
|
comment:2
Oh, and here is the traceback:
|
comment:3
As mentioned in one of the sage-devel threads linked above, the issue here is that I'm waiting for Nicolas to weigh in on what he thinks should happen with the |
Attachment: trac_8177-element_wrapper_segfault-fh.patch.gz |
Author: Florent Hivert |
comment:4
Hi there ! I uploaded a patch where a replaced Cheers, Florent |
comment:5
Replying to @williamstein:
Just for the record, could someone post the result of this more self contained example?
|
This comment has been minimized.
This comment has been minimized.
comment:7
For me, this patch fixed the segfault but still failed:
This is on sage-4.3.2.rc0 and mac 10.6.2. |
comment:9
Replying to @nthiery:
I'm running sage -testall on #8200 now (the above single doctest passes though). Does this new ticket mean you want Minh to make this as wontfix/invalid/duplicate and close it? |
comment:10
Replying to @wdjoyner:
No, it means that, with #8200, I have done my part at fixing my improper usage of ZZ. But the issue that such an improper usage can cause a segfault is still there, and I leave to the experts the decision of whether to fix it now, leave it to later, or resolve it as wontfix. I personally vote -1 for making it a wontfix. |
comment:11
I strongly second Nicolas -1. Moreover, if the segfault is not removed the invariant
must be clearly stated with a big warning in the doc. My opinion is that the segfault must be left only if there is a very large performance penalty fixing it. Cheers, Florent By the way, I've removed myself as author since I won't be hacking in integers (my work in integrated in #8200). |
Changed author from Florent Hivert to none |
comment:13
I think we can mark this as invalid as of 5.10:
|
comment:14
I looked at the code of Integer._rich_cmp, and indeed it now tests that the right hand side is indeed in the Integer class which fixes the issue. In an ideal world, we would have added a regression test, but oh well, let's move on. |
Integer assumes the following invariant:
Breaking this invariant (which is easy to do using plain Python) can lead to a segfault.
See the following discussion for how it was detected:
From sage-devel and also reported here:
See #8200 which improves the doctests of ElementWrapper to not trigger this bug anymore. #8200 does not resolve the issue though!
CC: @nthiery @sagetrac-mvngu @hivert
Component: documentation
Issue created by migration from https://trac.sagemath.org/ticket/8177
The text was updated successfully, but these errors were encountered: