Opened 6 years ago
Closed 6 years ago
#15363 closed defect (fixed)
MPIR large numbers give a segmentation fault
Reported by: | jdemeyer | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-5.13 |
Component: | c_lib | Keywords: | |
Cc: | zimmerma | Merged in: | sage-5.13.beta3 |
Authors: | Jeroen Demeyer | Reviewers: | Paul Zimmermann |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | #14029, #13311, #9640 | Stopgaps: |
Description (last modified by )
sage: 2^9223372036854775806 --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-9-da1ea00f776d> in <module>() ----> 1 Integer(2)**Integer(9223372036854775806) /scratch/release/merger/sage-5.12/local/lib/python2.7/site-packages/sage/rings/integer.so in sage.rings.integer.Integer.__pow__ (sage/rings/integer.c:14022)() RuntimeError: Segmentation fault
This is essentially due to MPIR not checking for errors in malloc()
(nor does it have a mechanism for returning errors to the user).
This could be "solved" within Sage by adding checking in sage_mpir_malloc()
and friends.
Attachments (1)
Change History (11)
comment:1 Changed 6 years ago by
- Description modified (diff)
- Summary changed from Segfault in exact_rational for RR to MPIR large numbers give a segmentation fault
comment:2 Changed 6 years ago by
- Description modified (diff)
comment:3 Changed 6 years ago by
- Component changed from basic arithmetic to c_lib
- Dependencies set to #9640
Changed 6 years ago by
comment:4 Changed 6 years ago by
- Status changed from new to needs_review
comment:5 Changed 6 years ago by
- Status changed from needs_review to needs_work
comment:6 Changed 6 years ago by
Did you apply the dependency #9640?
comment:7 Changed 6 years ago by
- Dependencies changed from #9640 to #14029, #13311, #9640
- Status changed from needs_work to needs_review
comment:8 Changed 6 years ago by
comment:9 Changed 6 years ago by
- Reviewers set to Paul Zimmermann
- Status changed from needs_review to positive_review
the example in the description no longer gives a Seg. fault, all doctests still pass, I'm not an expert of the Python-C interface but nevertheless the patch looks fine to me, thus I give a positive review.
Paul
comment:10 Changed 6 years ago by
- Merged in set to sage-5.13.beta3
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
after importing the patch in Sage 5.12, I get with
sage -br
:Paul