Opened 3 months ago
Last modified 4 weeks ago
#28538 new defect
Segfault for boolean evaluation of expression with assumptions
Reported by: | tmonteil | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | sage-9.0 |
Component: | symbolics | Keywords: | |
Cc: | rws, kcrisman | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | Fixed upstream, in a later stable release. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
As reported on this ask question:
sage: x, y = var('x, y') sage: assume(x>0) sage: assume(y>0) sage: bool(y*(x-y)==0)
leads to (on my computer 8.9.rc1) a sequence of:
;;; ;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'. ;;; Jumping to the outermost toplevel prompt ;;;
followed by a Segmentation fault
crash of Sage.
Or (as reported, on 8.8):
RuntimeError: ECL says: C-STACK overflow at size 1048576. Stack can probably be resized. Proceed with caution.
Exchanging x
and y
works correctly:
sage: x, y = var('x, y') sage: assume(x>0) sage: assume(y>0) sage: bool(x*(y-x)==0) False
Upstream ticket: https://sourceforge.net/p/maxima/bugs/3583/
Change History (7)
comment:1 Changed 3 months ago by
comment:2 Changed 3 months ago by
- Description modified (diff)
comment:3 Changed 3 months ago by
- Cc rws kcrisman added
comment:4 Changed 3 months ago by
I'm so sorry I just don't have time any more to track down as many of these (though once in a while I somehow make the time). But I think the best thing to do is to do whatever bool does in Maxima-in-sage sage -maxima
and then load exactly the packages preloaded by Sage - the complex domain is usually the most suspicious one on these fronts, though I have to say this is really puzzling. I imagine bool
calls a comparison with zero at some point in Maxima, though I don't recall any more because I wasn't involved with the comparison-with-zero code much.
comment:5 Changed 3 months ago by
In maxima:
domain: complex; assume(x>0,y>0); is(equal(y*(x-y),0));
replicates the crash. That's sufficient to report upstream. Perhaps they can fix it.
comment:6 Changed 3 months ago by
- Description modified (diff)
- Report Upstream changed from N/A to Reported upstream. No feedback yet.
Thanks for tracking, this is now tracked upstream as https://sourceforge.net/p/maxima/bugs/3583/
comment:7 Changed 4 weeks ago by
- Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, in a later stable release.
On 8.9.rc1+#28534 (Python 3-based), I get a lot of
and a Sage crash:
Nice one...