#15363: MPIR large numbers give a segmentation fault
------------------------------------+-------------------------
       Reporter:  jdemeyer          |        Owner:
           Type:  defect            |       Status:  new
       Priority:  major             |    Milestone:  sage-5.13
      Component:  basic arithmetic  |   Resolution:
       Keywords:                    |    Merged in:
        Authors:                    |    Reviewers:
Report Upstream:  N/A               |  Work issues:
         Branch:                    |       Commit:
   Dependencies:                    |     Stopgaps:
------------------------------------+-------------------------
Description changed by jdemeyer:

Old description:

> {{{
> 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
> }}}

New description:

 {{{
 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.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/15363#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to