#10250: segfault when multiplying QQ constant and SR vector (with user basis)
------------------------------+---------------------------------------------
   Reporter:  jason           |       Owner:  jason, was
       Type:  defect          |      Status:  new       
   Priority:  major           |   Milestone:            
  Component:  linear algebra  |    Keywords:            
     Author:                  |    Upstream:  N/A       
   Reviewer:                  |      Merged:            
Work_issues:                  |  
------------------------------+---------------------------------------------
 This code worked in Sage 4.5.2.  I just realized that it now gives a
 segfault in 4.6.  Does anyone know what is going on?

 {{{
 sage: A=matrix(QQ, [[2,1],[0,3]])
 sage: eval, evecs,mult=A.eigenvectors_right()[0]
 sage: evec=evecs[0]
 sage: unitevec=evec/evec.norm()
 sage: unitevec
 (1/2*sqrt(2), 1/2*sqrt(2))
 sage: parent(eval)
 Rational Field
 sage: eval
 3
 }}}
 and then:
 {{{
 sage: w=(SR2)(unitevec)
 sage: parent(w) # works fine
 Vector space of dimension 2 over Symbolic Ring
 sage: eval*w
 (3/2*sqrt(2), 3/2*sqrt(2))
 }}}
 but here's the problem:
 {{{
 sage: parent(unitevec) # gives problem
 Vector space of degree 2 and dimension 1 over Symbolic Ring
 User basis matrix:
 [1 1]
 sage: eval*unitevec


 ------------------------------------------------------------
 Unhandled SIGSEGV: A segmentation fault occurred in Sage.
 This probably occurred because a *compiled* component
 of Sage has a bug in it (typically accessing invalid memory)
 or is not properly wrapped with _sig_on, _sig_off.
 You might want to run Sage under gdb with 'sage -gdb' to debug this.
 Sage will now terminate (sorry).
 ------------------------------------------------------------
 }}}

 Here is a backtrace using sage -gdb, which indicates a problem in ginac or
 pynac.
 {{{
 sage: eval*unitevec

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: 13 at address: 0x0000000000000000
 0x00007fff8294a7a2 in __dynamic_cast ()
 (gdb) bt
 #0  0x00007fff8294a7a2 in __dynamic_cast ()
 #1  0x000000010798ffcc in is_a<GiNaC::relational> [inlined] () at
 /Users/grout/sage-trees/sage-4.6/local/include/pynac/basic.h:939
 #2  0x000000010798ffcc in is_a<GiNaC::relational> [inlined] () at
 /Users/grout/sage-trees/sage-4.6/local/include/pynac/ex.h:939
 #3  0x000000010798ffcc in
 __pyx_f_4sage_8symbolic_10expression_10Expression__mul_
 (__pyx_v_left=0x10c825a70, __pyx_v_right=0x10c8281d0,
 __pyx_skip_dispatch=<value temporarily unavailable, due to optimizations>)
 at ex.h:11284
 #4  0x0000000104be0632 in
 
__pyx_f_4sage_7modules_19free_module_element_31FreeModuleElement_generic_dense__rmul_
 (__pyx_v_self=0x10c81e628, __pyx_v_left=0x10c825a70,
 __pyx_skip_dispatch=<value temporarily unavailable, due to optimizations>)
 at sage/modules/free_module_element.c:15600
 #5  0x00000001022b5b7f in
 __pyx_f_4sage_9structure_14coerce_actions_16LeftModuleAction__call_
 (__pyx_v_self=0x1006be758, __pyx_v_g=0x10c825a70, __pyx_v_a=0x10c81e628,
 __pyx_skip_dispatch=<value temporarily unavailable, due to optimizations>)
 at sage/structure/coerce_actions.c:5437
 #6  0x000000010223fe62 in __pyx_pf_4sage_10categories_6action_6Action_act
 (__pyx_v_self=0x1006be758, __pyx_args=0x10bd2e638, __pyx_kwds=0x0) at
 sage/categories/action.c:2563
 #7  0x000000010000bcd2 in PyObject_Call ()
 #8  0x00000001022b68eb in
 __pyx_pf_4sage_9structure_14coerce_actions_12ModuleAction___init__
 (__pyx_v_self=0x1006be758, __pyx_args=<value temporarily unavailable, due
 to optimizations>, __pyx_kwds=<value temporarily unavailable, due to
 optimizations>) at sage/structure/coerce_actions.c:5133
 #9  0x000000010006d8c5 in type_call ()
 #10 0x000000010000bcd2 in PyObject_Call ()
 #11 0x00000001022b8673 in
 __pyx_pf_4sage_9structure_14coerce_actions_detect_element_action
 (__pyx_self=<value temporarily unavailable, due to optimizations>,
 __pyx_args=<value temporarily unavailable, due to optimizations>,
 __pyx_kwds=<value temporarily unavailable, due to optimizations>) at
 sage/structure/coerce_actions.c:4184
 #12 0x000000010000bcd2 in PyObject_Call ()
 #13 0x0000000101f9988c in
 __pyx_f_4sage_9structure_6parent_6Parent_discover_action
 (__pyx_v_self=0x10bed9b40, __pyx_v_S=0x1021654d0, __pyx_v_op=0x1006418c0,
 __pyx_v_self_on_left=0) at sage/structure/parent.c:14710
 #14 0x0000000101f5b825 in
 __pyx_f_4sage_9structure_10parent_old_6Parent_get_action_c_impl
 (__pyx_v_self=0x10bed9b40, __pyx_v_S=0x1021654d0, __pyx_v_op=0x1006418c0,
 __pyx_v_self_on_left=0) at sage/structure/parent_old.c:3254
 #15 0x0000000101f5ba6f in
 __pyx_pf_4sage_9structure_10parent_old_6Parent_get_action_impl
 (__pyx_v_self=0x10bed9b40, __pyx_args=<value temporarily unavailable, due
 to optimizations>, __pyx_kwds=<value temporarily unavailable, due to
 optimizations>) at sage/structure/parent_old.c:3204
 #16 0x000000010000bcd2 in PyObject_Call ()
 #17 0x0000000101f5c424 in
 __pyx_f_4sage_9structure_10parent_old_6Parent_get_action_c
 (__pyx_v_self=0x10bed9b40, __pyx_v_S=0x1021654d0, __pyx_v_op=0x1006418c0,
 __pyx_v_self_on_left=0, __pyx_skip_dispatch=<value temporarily
 unavailable, due to optimizations>) at sage/structure/parent_old.c:2892
 #18 0x0000000101f4f359 in
 __pyx_f_4sage_9structure_10parent_old_6Parent__get_action_
 (__pyx_v_self=0x10bed9b40, __pyx_v_other=0x1021654d0,
 __pyx_v_op=0x1006418c0, __pyx_v_self_on_left=0, __pyx_skip_dispatch=<value
 temporarily unavailable, due to optimizations>) at
 sage/structure/parent_old.c:6069
 #19 0x0000000101f9b9a4 in
 __pyx_f_4sage_9structure_6parent_6Parent_get_action
 (__pyx_v_self=0x10bed9b40, __pyx_v_S=0x1021654d0,
 __pyx_skip_dispatch=<value temporarily unavailable, due to optimizations>,
 __pyx_optional_args=<value temporarily unavailable, due to optimizations>)
 at sage/structure/parent.c:13731
 #20 0x00000001020aaa87 in
 __pyx_f_4sage_9structure_6coerce_24CoercionModel_cache_maps_discover_action
 (__pyx_v_self=0x101f38710, __pyx_v_R=0x1021654d0, __pyx_v_S=0x10bed9b40,
 __pyx_v_op=0x1006418c0, __pyx_skip_dispatch=<value temporarily
 unavailable, due to optimizations>) at sage/structure/coerce.c:11909
 #21 0x00000001020afcf1 in
 __pyx_f_4sage_9structure_6coerce_24CoercionModel_cache_maps_get_action
 (__pyx_v_self=0x101f38710, __pyx_v_R=0x1021654d0, __pyx_v_S=0x10bed9b40,
 __pyx_v_op=0x1006418c0, __pyx_skip_dispatch=<value temporarily
 unavailable, due to optimizations>) at sage/structure/coerce.c:10837
 #22 0x00000001020bbe36 in
 __pyx_f_4sage_9structure_6coerce_24CoercionModel_cache_maps_bin_op
 (__pyx_v_self=0x101f38710, __pyx_v_x=0x1006b56b0, __pyx_v_y=0x10c8292b8,
 __pyx_v_op=0x1006418c0, __pyx_skip_dispatch=<value temporarily
 unavailable, due to optimizations>) at sage/structure/coerce.c:6080
 #23 0x000000010203165d in
 __pyx_pf_4sage_9structure_7element_11RingElement___mul__
 (__pyx_v_left=0x1006b56b0, __pyx_v_right=0x10c8292b8) at
 sage/structure/element.c:11399
 #24 0x000000010000bfbc in binary_op1 ()
 #25 0x000000010000e5a8 in PyNumber_Multiply ()
 #26 0x00000001000b35df in PyEval_EvalFrameEx ()
 #27 0x00000001000b9010 in PyEval_EvalCodeEx ()
 #28 0x00000001000b7799 in PyEval_EvalFrameEx ()
 #29 0x00000001000b9010 in PyEval_EvalCodeEx ()
 #30 0x00000001000b6ffd in PyEval_EvalFrameEx ()
 #31 0x00000001000b9010 in PyEval_EvalCodeEx ()
 #32 0x00000001000b6ffd in PyEval_EvalFrameEx ()
 #33 0x00000001000b745a in PyEval_EvalFrameEx ()
 #34 0x00000001000b9010 in PyEval_EvalCodeEx ()
 #35 0x00000001000b6ffd in PyEval_EvalFrameEx ()
 #36 0x00000001000b9010 in PyEval_EvalCodeEx ()
 #37 0x00000001000b6ffd in PyEval_EvalFrameEx ()
 #38 0x00000001000b9010 in PyEval_EvalCodeEx ()
 #39 0x00000001000b6ffd in PyEval_EvalFrameEx ()
 #40 0x00000001000b9010 in PyEval_EvalCodeEx ()
 #41 0x00000001000b90f6 in PyEval_EvalCode ()
 #42 0x00000001000dde0e in PyRun_FileExFlags ()
 #43 0x00000001000de0c9 in PyRun_SimpleFileExFlags ()
 #44 0x00000001000eb5eb in Py_Main ()
 #45 0x0000000100000f14 in start ()
 (gdb)
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10250>
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