#12157: Segfault in __Pyx_check_binary_version
------------------------------+---------------------------------------------
   Reporter:  vbraun          |          Owner:  jason, was     
       Type:  defect          |         Status:  needs_review   
   Priority:  blocker         |      Milestone:  sage-4.8       
  Component:  linear algebra  |       Keywords:                 
Work_issues:                  |       Upstream:  N/A            
   Reviewer:  Volker Braun    |         Author:  François Bissey
     Merged:                  |   Dependencies:                 
------------------------------+---------------------------------------------
Changes (by newvalueoldvalue):

  * reviewer:  Jeroen Demeyer => Volker Braun
  * author:  Volker Braun => François Bissey


Comment:

 {{{
 (gdb) bt 5
 #0  0x00019df6 in ?? ()
 #1  0xb37d6484 in __Pyx_check_binary_version () at
 sage/matrix/matrix_modn_dense_float.cpp:17227
 #2  0xb37d105f in initmatrix_modn_dense_float () at
 sage/matrix/matrix_modn_dense_float.cpp:15808
 #3  0xb7f2e50c in _PyImport_LoadDynamicModule (name=0xbffca9f8
 "sage.matrix.matrix_modn_dense_float",
     pathname=0xbffc996b
 "/home/vbraun/tesla/sage-4.8.alpha4/local/lib/python2.6/site-
 packages/sage/matrix/matrix_modn_dense_float.so", fp=0x8cc69d8) at
 ./Python/importdl.c:53
 #4  0xb7f2bf50 in load_module (name=0xbffca9f8
 "sage.matrix.matrix_modn_dense_float",
     fp=<optimized out>,
     buf=0xbffc996b "/home/vbraun/tesla/sage-4.8.alpha4/local/lib/python2.6
 /site-packages/sage/matrix/matrix_modn_dense_float.so", type=3,
 loader=0x0) at Python/import.c:1828
 (More stack frames follow...)
 (gdb) frame 0
 #0  0x00019df6 in ?? ()
 (gdb) print *0x00019df6
 Cannot access memory at address 0x19df6
 (gdb) up
 #1  0xb37d6484 in __Pyx_check_binary_version () at
 sage/matrix/matrix_modn_dense_float.cpp:17227
 17227       PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION,
 PY_MINOR_VERSION);
 (gdb) disassemble
 Dump of assembler code for function __Pyx_check_binary_version():
    0xb37d6437 <+0>:     push   %ebp
    0xb37d6438 <+1>:     mov    %esp,%ebp
    0xb37d643a <+3>:     push   %ebx
    0xb37d643b <+4>:     sub    $0x104,%esp
    0xb37d6441 <+10>:    call   0xb37b4087 <__i686.get_pc_thunk.bx>
    0xb37d6446 <+15>:    add    $0x32bae,%ebx
    0xb37d644c <+21>:    mov    %gs:0x14,%eax
    0xb37d6452 <+27>:    mov    %eax,-0xc(%ebp)
    0xb37d6455 <+30>:    xor    %eax,%eax
    0xb37d6457 <+32>:    movl   $0x6,0x10(%esp)
    0xb37d645f <+40>:    movl   $0x2,0xc(%esp)
    0xb37d6467 <+48>:    lea    -0x97a9(%ebx),%eax
    0xb37d646d <+54>:    mov    %eax,0x8(%esp)
    0xb37d6471 <+58>:    movl   $0x4,0x4(%esp)
    0xb37d6479 <+66>:    lea    -0x14(%ebp),%eax
    0xb37d647c <+69>:    mov    %eax,(%esp)
    0xb37d647f <+72>:    call   0xb37b2df0 <PyOS_snprintf@plt>
 => 0xb37d6484 <+77>:    call   0xb37b2850 <Py_GetVersion@plt>
    0xb37d6489 <+82>:    mov    %eax,0xc(%esp)
    0xb37d648d <+86>:    lea    -0x97a3(%ebx),%eax
 }}}
 It dies when calling PyOS_snprintf, it seems like something went very
 wrong when trying to resolve the givaro symbols. I don't understand why
 that should make Python and/or glibc symbols undefined but apparently it
 does. Of course it works fine in the debugger:
 {{{
 (gdb) print PyOS_snprintf(ctversion, 4, "%d.%d", 2, 6)
 $15 = 3
 (gdb) print ctversion
 $16 = "2.6"
 }}}

 In any case, I'm giving positive review to Francois' patch: We clearly
 should link with all necessary libraries. Though I still don't understand
 why it segfaults the way it does.

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