#12266: 3^3^3^3 segfaults
-------------------------+--------------------------------------------------
   Reporter:  vbraun     |          Owner:  jason, jkantor
       Type:  defect     |         Status:  new           
   Priority:  major      |      Milestone:  sage-5.0      
  Component:  numerical  |       Keywords:                
Work_issues:             |       Upstream:  N/A           
   Reviewer:             |         Author:                
     Merged:             |   Dependencies:                
-------------------------+--------------------------------------------------
 As reported on http://ask.sagemath.org/question/1031/segmentation-fault-
 when-evaluating-3333:
 {{{
 sage: 3^3^3^3
 ---------------------------------------------------------------------------
 RuntimeError                              Traceback (most recent call
 last)

 /home/vbraun/<ipython console> in <module>()

 /home/vbraun/opt/sage-4.8.alpha6/local/lib/python2.6/site-
 packages/sage/rings/integer.so in sage.rings.integer.Integer.__pow__
 (sage/rings/integer.c:12867)()

 RuntimeError: Segmentation fault
 }}}

 Debugger shows that we call `gmp_n_pow_ui` on a non-int:
 {{{
 (gdb) bt
 #0  0x00007fffed883c14 in __gmp_tmp_reentrant_alloc ()
    from /home/vbraun/opt/sage-4.8.alpha6/local/lib/libgmp.so.8
 #1  0x00007fffed897754 in __gmpz_n_pow_ui ()
    from /home/vbraun/opt/sage-4.8.alpha6/local/lib/libgmp.so.8
 #2  0x00007fffe75fbce7 in
 __pyx_pf_4sage_5rings_7integer_7Integer_36__pow__ (__pyx_v_self=0x3e8fe70,
     __pyx_v_n=0x3e8fbd0, __pyx_v_modulus=<optimized out>) at
 sage/rings/integer.c:12881
 #3  0x00007ffff7c85fe2 in ternary_op (v=0x3e8fe70, w=0x3e8fbd0,
 z=0x7ffff7fc92a0, op_slot=48, op_name=Unhandled dwarf expression opcode
 0xfa
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12266>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to