#11942: segfault on Graph().connected_component_containing_vertex('')
------------------------------------------+---------------------------------
   Reporter:  kini                        |          Owner:  jason, ncohen, rlm 
       
       Type:  defect                      |         Status:  needs_review       
       
   Priority:  major                       |      Milestone:  sage-4.8           
       
  Component:  graph theory                |       Keywords:  segfault cython    
       
Work_issues:                              |       Upstream:  N/A                
       
   Reviewer:  Keshav Kini, David Coudert  |         Author:  Nathann Cohen, 
Keshav Kini
     Merged:                              |   Dependencies:                     
       
------------------------------------------+---------------------------------
Changes (by newvalueoldvalue):

  * keywords:  => segfault cython
  * status:  needs_work => needs_review
  * author:  Nathann Cohen => Nathann Cohen, Keshav Kini


Old description:

> As title.
>
> {{{
> fs@zhenghe /tmp $ sage -c
> "Graph().connected_component_containing_vertex('')"
> /opt/sage/local/lib/libcsage.so(print_backtrace+0x31)[0x7f14e1a96df2]
> /opt/sage/local/lib/libcsage.so(sigdie+0x14)[0x7f14e1a96e24]
> /opt/sage/local/lib/libcsage.so(sage_signal_handler+0x20c)[0x7f14e1a96a72]
> /lib/x86_64-linux-gnu/libpthread.so.0(+0xf020)[0x7f14e31fa020]
> /opt/sage/local/lib/python2.6/site-
> packages/sage/graphs/base/c_graph.so(+0x11aa1)[0x7f14be4d8aa1]
> /opt/sage/local/lib/libpython2.6.so.1.0(+0x75876)[0x7f14e347c876]
> /opt/sage/local/lib/libpython2.6.so.1.0(+0x75b92)[0x7f14e347cb92]
> /opt/sage/local/lib/libpython2.6.so.1.0(+0xa0f08)[0x7f14e34a7f08]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7f14e3451cd3]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x395d)[0x7f14e34e835d]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x602d)[0x7f14e34eaa2d]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x879)[0x7f14e34eb549]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalCode+0x32)[0x7f14e34eb642]
> /opt/sage/local/lib/libpython2.6.so.1.0(+0xdb07e)[0x7f14e34e207e]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x4f8d)[0x7f14e34e998d]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x879)[0x7f14e34eb549]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalCode+0x32)[0x7f14e34eb642]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyRun_FileExFlags+0xb0)[0x7f14e350d9b0]
> /opt/sage/local/lib/libpython2.6.so.1.0(PyRun_SimpleFileExFlags+0xdf)[0x7f14e350e3ef]
> /opt/sage/local/lib/libpython2.6.so.1.0(Py_Main+0xb23)[0x7f14e351b693]
> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f14e27fcead]
> python[0x4006a1]
>
> ------------------------------------------------------------------------
> Unhandled SIGSEGV: A segmentation fault occurred in Sage.
> This probably occurred because a *compiled* component of Sage has a bug
> in it and 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.
> ------------------------------------------------------------------------
> /opt/sage/local/bin/sage-sage: line 772: 19065 Segmentation fault
> sage-eval "$@"
> fs@zhenghe /tmp $
> }}}
>
> Apply:
>     * [attachment:trac_11942.patch]

New description:

 As title.

 {{{
 fs@zhenghe /tmp $ sage -c
 "Graph().connected_component_containing_vertex('')"
 /opt/sage/local/lib/libcsage.so(print_backtrace+0x31)[0x7f14e1a96df2]
 /opt/sage/local/lib/libcsage.so(sigdie+0x14)[0x7f14e1a96e24]
 /opt/sage/local/lib/libcsage.so(sage_signal_handler+0x20c)[0x7f14e1a96a72]
 /lib/x86_64-linux-gnu/libpthread.so.0(+0xf020)[0x7f14e31fa020]
 /opt/sage/local/lib/python2.6/site-
 packages/sage/graphs/base/c_graph.so(+0x11aa1)[0x7f14be4d8aa1]
 /opt/sage/local/lib/libpython2.6.so.1.0(+0x75876)[0x7f14e347c876]
 /opt/sage/local/lib/libpython2.6.so.1.0(+0x75b92)[0x7f14e347cb92]
 /opt/sage/local/lib/libpython2.6.so.1.0(+0xa0f08)[0x7f14e34a7f08]
 /opt/sage/local/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7f14e3451cd3]
 
/opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x395d)[0x7f14e34e835d]
 
/opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x602d)[0x7f14e34eaa2d]
 
/opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x879)[0x7f14e34eb549]
 /opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalCode+0x32)[0x7f14e34eb642]
 /opt/sage/local/lib/libpython2.6.so.1.0(+0xdb07e)[0x7f14e34e207e]
 
/opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x4f8d)[0x7f14e34e998d]
 
/opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x879)[0x7f14e34eb549]
 /opt/sage/local/lib/libpython2.6.so.1.0(PyEval_EvalCode+0x32)[0x7f14e34eb642]
 /opt/sage/local/lib/libpython2.6.so.1.0(PyRun_FileExFlags+0xb0)[0x7f14e350d9b0]
 
/opt/sage/local/lib/libpython2.6.so.1.0(PyRun_SimpleFileExFlags+0xdf)[0x7f14e350e3ef]
 /opt/sage/local/lib/libpython2.6.so.1.0(Py_Main+0xb23)[0x7f14e351b693]
 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f14e27fcead]
 python[0x4006a1]

 ------------------------------------------------------------------------
 Unhandled SIGSEGV: A segmentation fault occurred in Sage.
 This probably occurred because a *compiled* component of Sage has a bug
 in it and 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.
 ------------------------------------------------------------------------
 /opt/sage/local/bin/sage-sage: line 772: 19065 Segmentation fault
 sage-eval "$@"
 fs@zhenghe /tmp $
 }}}

 Apply:
     1. [attachment:trac_11942.patch]
     1. [attachment:trac_11942-exceptions.patch]

--

Comment:

 Well, I'm still not sure about the multiple code paths. But here is a
 patch to use better exceptions throughout the file in question, though
 that's sort of tangential to the original purpose of the ticket. This
 ticket has been sitting around too long for me to delay it any further
 just because of my ignorance of the Cython graphs code, especially since
 it fixes a segfault, so I will give a positive review to Nathann's part.
 Maybe someone can review my exceptions patch? It passes `make ptestlong`
 on my machine fwiw.

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