-
-
Notifications
You must be signed in to change notification settings - Fork 601
Crash due to missing Cython exception handling for relational_to_bool() #14211
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
Comments
This comment has been minimized.
This comment has been minimized.
Upstream: Reported upstream. Developers acknowledge bug. |
comment:7
Reported as pynac/pynac#34 |
comment:8
Minimal case given. In Sage One part of the fix is preventing Sage from crashing. Surrounding the call to Pynac in
leads to:
which is the same you get with |
This comment has been minimized.
This comment has been minimized.
Changed upstream from Reported upstream. Developers acknowledge bug. to Reported upstream. Developers deny it's a bug. |
comment:11
Replying to @rwst:
Because the default for matrix creation is to create a mutable matrix. That's because a mutable matrix can be turned into an immutable one, but not the other way around (that requires copying the matrix to a new, mutable, one). That default is probably inconvenient for symbolics. Are you sure this is the sole problem, though? If we try this:
then we get
but |
comment:12
Replying to @nbruin:
I have reopened the Pynac issue. The crash is in exactly the same call tree. It happens while trying to multiply the rhs with
Also no, I don't think it's the sole problem. Either Sage or Pynac will have to check somewhere before evaluating that all mutable Python objects of the expression are switched to immutable (or make immutable copies). EDIT: But that would be a different ticket: #18360 |
comment:13
Please read http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html#exceptions |
Commit: |
comment:17
Replying to @nbruin:
My best guess at the moment is that somewhere in between a copy is made which, as you suggested, is then mutable again. This can only be fixed by a dedicated ticket such as #18360. As to this code, the reviewer should check doubly if what I did here was right. There was not a single example in Sage with a special function catching exceptions from which I could have learned. New commits:
|
comment:18
Obviously, a doctest is needed. Besides that, it makes no sense to add an additional layer |
Changed branch from u/rws/crash_due_to_missing_cython_exception_handling_for_relational_to_bool__ to u/rws/14211 |
comment:20
Interesting. The C++ layer outputs an error message, and the Python layer deals with the error too, because presumably the error from calling New commits:
|
comment:21
Replying to @rwst:
Well, behaviour shouldn't depend on what "presumably" happens (does the traceback look sensible? If not, you're certainly doing it wrong). I admit I don't know the proper way to deal with this (a C++ exception and Besides that, I would never print the C++ exception. |
comment:23
I can have a look at how to properly deal with this, but not now. |
Changed commit from |
Changed author from Ralf Stephan to none |
Changed branch from u/rws/14211 to none |
comment:24
Now that the actual bug is fixed in future Pynac (#18360) the given doctest will not work in the future, so I removed the commit. |
comment:25
Branch reset because other exceptions can be thrown. New commits:
|
Commit: |
Branch: u/rws/14211 |
Changed commit from |
Changed branch from u/rws/14211 to none |
comment:26
No longer necessary (doctest added in #18360) |
Component: symbolics
Issue created by migration from https://trac.sagemath.org/ticket/14211
The text was updated successfully, but these errors were encountered: