-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
Wrong usage of normaliz/pynormaliz makes sage crash hard #28872
Comments
comment:1
For the record: The underlying normaliz error is
|
Branch: public/28872 |
New commits:
|
Commit: |
Author: Jonathan Kliem |
comment:4
I marked it as blocker because it's an easy fix (for now) and it is potentially really annoying. So I would like to see this being taken care of for the next master. |
This comment has been minimized.
This comment has been minimized.
comment:5
I guess the real question is how we can prevent sage to crash, if normaliz throws an error. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
I can confirm that this does work in the sense that doctests pass. Could someone more familiar with polytope theory verify the mathematical correctness? |
Reviewer: Travis Scrimshaw |
comment:9
I don't know if that helps you: If I remember correctly, the problem is just that C++ allows multiple inputs but only one output. So for
This is also spelled out in the manual https://github.com/Normaliz/Normaliz/blob/master/doc/Normaliz.pdf in section D.9
|
comment:10
Ah, I think I understand. It is merely an input distinction (not a mathematical one), and the error comes from the fact that things need to be done by reference except for |
comment:11
At present, calling
for a cone of renf_elem_class results in an
and then in a hard crash. This is the standard solution in Normaliz for coding mistakes. I did not think about the possibility that this might happen outside Normaliz. As a first measurte, I will replace the assert(false) by throwing a NonComputableExcetion. It is caught by PyNormaliz. (The disadvantage of exceptions is that they cannot be traced back.) I will then thry to find a better solution. Perhaps we can overcome the problem by making the return value a template. But this will change the systematics of the interface between libnormaliz and PyNormaliz. |
comment:12
The assert(false) has been replaced by an exception. There should be no assert(false) in public methods of the class Cone anymore. Pushed to GitHub branch master. |
comment:13
On a later ticket, we can either port the fix as a patch or just wait for the upgrade. Since this has been positively reviewed for 2+ days, I don't think we should make more changes here (unless Volker rejects it for some reason). |
Changed branch from public/28872 to |
The following innocent code leads sage to crash hard.
The problem is that we use the wrong method. We use
P._nmz_result(cone, 'Volume')
but we should useP._nmz_result(cone, 'RenfVolume')
.CC: @tscrim @dimpase @novoselt @w-bruns @nthiery @videlec @mo271 @jplab @mmasdeu @braunmath @kliem
Component: geometry
Keywords: polyhedron, normaliz, volume
Author: Jonathan Kliem
Branch/Commit:
516a622
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/28872
The text was updated successfully, but these errors were encountered: