Skip to content

segmentation fault (Trac #197) #795

Closed

Description

@numpy-gitbot

Original ticket http://projects.scipy.org/numpy/ticket/197 on 2006-07-21 by @nilswagner01, assigned to @teoliphant.

numpy.test(1,10) results in a segfault.
Here is a backtrace

test_boolean (numpy.core.tests.test_numeric.test_index) ... ok
test_divideerr (numpy.core.tests.test_numeric.test_seterr)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 17793)]
0x00002aaaaadf4cf0 in __pthread_lock () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00002aaaaadf4cf0 in __pthread_lock () from /lib64/libpthread.so.0
#1  0x00002aaaaadf4725 in sem_post@@GLIBC_2.2.5 () from /lib64/libpthread.so.0
#2  0x00002aaaaac76059 in PyThread_release_lock (lock=<value optimized out>) at thread_pthread.h:338
#3  0x00002aaaabff40da in _error_handler (method=2, errobj=0x2aaaadf98cb0, errtype=0x2aaaabfff08f "divide by zero",
    retstatus=1) at ufuncobject.c:519
#4  0x00002aaaabff42ea in PyUFunc_handlefperr (errmask=2, errobj=0x2aaaadf98cb0, retstatus=1) at ufuncobject.c:547
#5  0x00002aaaabffb46d in PyUFunc_GenericFunction (self=0x559710, args=<value optimized out>, mps=0x7fffffc0d2b0)
    at ufuncobject.c:1450
#6  0x00002aaaabffb540 in ufunc_generic_call (self=0x559710, args=0x2aaaadf98710) at ufuncobject.c:2694
#7  0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#8  0x00002aaaaabfa883 in PyObject_CallFunction (callable=0x559710, format=<value optimized out>) at abstract.c:1793
#9  0x00002aaaaabf8508 in binary_op1 (v=0x888970, w=0x888b40, op_slot=24) at abstract.c:371
#10 0x00002aaaaabf8771 in binary_op (v=0x888970, w=0x888b40, op_slot=<value optimized out>,
    op_name=0x2aaaaac8b2c8 "/") at abstract.c:422
#11 0x00002aaaaac521f1 in PyEval_EvalFrame (f=0x7a9480) at ceval.c:1060
#12 0x00002aaaaac53b97 in PyEval_EvalFrame (f=0x5d5cd0) at ceval.c:3629
#13 0x00002aaaaac55404 in PyEval_EvalCodeEx (co=0x2aaaabbeece0, globals=<value optimized out>,
    locals=<value optimized out>, args=0x2aaaae2bdd10, argcount=2, kws=0x82c7d0, kwcount=0, defs=0x2aaaabbf7b28,
    defcount=1, closure=0x0) at ceval.c:2730
#14 0x00002aaaaac0e9af in function_call (func=0x2aaaabc05758, arg=0x2aaaae2bdcf8, kw=<value optimized out>)
    at funcobject.c:548
#15 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#16 0x00002aaaaac532e2 in PyEval_EvalFrame (f=0x5e81c0) at ceval.c:3824
#17 0x00002aaaaac55404 in PyEval_EvalCodeEx (co=0x2aaaabbeed50, globals=<value optimized out>,
    locals=<value optimized out>, args=0x2aaaae1338d8, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0,
    closure=0x0) at ceval.c:2730
#18 0x00002aaaaac0e9af in function_call (func=0x2aaaabc057d0, arg=0x2aaaae1338c0, kw=<value optimized out>)
    at funcobject.c:548
#19 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#20 0x00002aaaaac02131 in instancemethod_call (func=<value optimized out>, arg=0x2aaaae1338c0, kw=0x0)
---Type <return> to continue, or q <return> to quit---
    at classobject.c:2431
#21 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#22 0x00002aaaaac5380d in PyEval_EvalFrame (f=0x6f7290) at ceval.c:3755
#23 0x00002aaaaac55404 in PyEval_EvalCodeEx (co=0x2aaaabbde7a0, globals=<value optimized out>,
    locals=<value optimized out>, args=0x2aaaae2bcd10, argcount=2, kws=0x0, kwcount=0, defs=0x2aaaabc09628,
    defcount=1, closure=0x0) at ceval.c:2730
#24 0x00002aaaaac0e9af in function_call (func=0x2aaaabc07d70, arg=0x2aaaae2bccf8, kw=<value optimized out>)
    at funcobject.c:548
#25 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#26 0x00002aaaaac02131 in instancemethod_call (func=<value optimized out>, arg=0x2aaaae2bccf8, kw=0x0)
    at classobject.c:2431
#27 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#28 0x00002aaaaac33b0a in slot_tp_call (self=<value optimized out>, args=0x2aaaadf0ca90, kwds=0x0)
    at typeobject.c:4526
#29 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#30 0x00002aaaaac5380d in PyEval_EvalFrame (f=0x5d5850) at ceval.c:3755
#31 0x00002aaaaac55404 in PyEval_EvalCodeEx (co=0x2aaaabbf27a0, globals=<value optimized out>,
    locals=<value optimized out>, args=0x2aaaae2bd530, argcount=2, kws=0x71e290, kwcount=0, defs=0x0, defcount=0,
    closure=0x0) at ceval.c:2730
#32 0x00002aaaaac0e9af in function_call (func=0x2aaaabc06050, arg=0x2aaaae2bd518, kw=<value optimized out>)
    at funcobject.c:548
#33 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#34 0x00002aaaaac532e2 in PyEval_EvalFrame (f=0x5d2c70) at ceval.c:3824
#35 0x00002aaaaac55404 in PyEval_EvalCodeEx (co=0x2aaaabbf2810, globals=<value optimized out>,
    locals=<value optimized out>, args=0x2aaaad88b6e0, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0,
    closure=0x0) at ceval.c:2730
#36 0x00002aaaaac0e9af in function_call (func=0x2aaaabc060c8, arg=0x2aaaad88b6c8, kw=<value optimized out>)
    at funcobject.c:548
---Type <return> to continue, or q <return> to quit---
#37 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#38 0x00002aaaaac02131 in instancemethod_call (func=<value optimized out>, arg=0x2aaaad88b6c8, kw=0x0)
    at classobject.c:2431
#39 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#40 0x00002aaaaac33b0a in slot_tp_call (self=<value optimized out>, args=0x2aaaae136f10, kwds=0x0)
    at typeobject.c:4526
#41 0x00002aaaaabfa760 in PyObject_Call (func=<value optimized out>, arg=<value optimized out>,
    kw=<value optimized out>) at abstract.c:1751
#42 0x00002aaaaac5380d in PyEval_EvalFrame (f=0x633460) at ceval.c:3755
#43 0x00002aaaaac53b97 in PyEval_EvalFrame (f=0x67a970) at ceval.c:3629
#44 0x00002aaaaac55404 in PyEval_EvalCodeEx (co=0x2aaaabbe4b20, globals=<value optimized out>,
    locals=<value optimized out>, args=0x62baf8, argcount=3, kws=0x62bb10, kwcount=0, defs=0x2aaaabc0f2a8,
    defcount=2, closure=0x0) at ceval.c:2730
#45 0x00002aaaaac53aba in PyEval_EvalFrame (f=0x62b960) at ceval.c:3640
#46 0x00002aaaaac55404 in PyEval_EvalCodeEx (co=0x2aaaaab24b90, globals=<value optimized out>,
    locals=<value optimized out>, args=0x541af0, argcount=2, kws=0x541b00, kwcount=0, defs=0x2aaaacc9a890,
    defcount=2, closure=0x0) at ceval.c:2730
#47 0x00002aaaaac53aba in PyEval_EvalFrame (f=0x541960) at ceval.c:3640
#48 0x00002aaaaac55404 in PyEval_EvalCodeEx (co=0x2aaaacca33b0, globals=<value optimized out>,
    locals=<value optimized out>, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
    at ceval.c:2730
#49 0x00002aaaaac556d2 in PyEval_EvalCode (co=<value optimized out>, globals=<value optimized out>,
    locals=<value optimized out>) at ceval.c:484
#50 0x00002aaaaac70719 in run_node (n=<value optimized out>, filename=<value optimized out>, globals=0x503b50,
    locals=0x503b50, flags=<value optimized out>) at pythonrun.c:1265
#51 0x00002aaaaac71bc7 in PyRun_InteractiveOneFlags (fp=<value optimized out>, filename=0x2aaaaac95e73 "<stdin>",
    flags=0x7fffffc0faf0) at pythonrun.c:762
#52 0x00002aaaaac71cbe in PyRun_InteractiveLoopFlags (fp=0x2aaaab809e00, filename=0x2aaaaac95e73 "<stdin>",
    flags=0x7fffffc0faf0) at pythonrun.c:695
#53 0x00002aaaaac7221c in PyRun_AnyFileExFlags (fp=0x2aaaab809e00, filename=0x2aaaaac95e73 "<stdin>", closeit=0,
    flags=0x7fffffc0faf0) at pythonrun.c:658
---Type <return> to continue, or q <return> to quit---
#54 0x00002aaaaac77b25 in Py_Main (argc=<value optimized out>, argv=0x7fffffc127bc) at main.c:484
#55 0x00002aaaab603ced in __libc_start_main () from /lib64/libc.so.6
#56 0x00000000004006ea in _start () at start.S:113
#57 0x00007fffffc0fb88 in ?? ()
#58 0x00002aaaaabc19c0 in rtld_errno () from /lib64/ld-linux-x86-64.so.2

Activity

  1. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @teoliphant wrote on 2006-07-21

    Please tell us the version of NumPy and Python you are running when reporting a segfault. Also use

    to enclose text.
    
  2. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @nilswagner01 wrote on 2006-07-21

    Numpy version 1.1.2878

    Scipy version 0.5.0.2115

    test_divideerr (numpy.core.tests.test_numeric.test_seterr)Segmentation fault

    Python 2.4.1 (#1, Sep 12 2005, 23:33:18)

    [GCC 4.0.2 20050901 (prerelease) (SUSE Linux)] on linux2

  3. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @alberts wrote on 2006-07-21

    Tests of !NumPy 1.1.2880 pass on Windows and Linux without problems. I'm using Python 2.4.3 in both cases. I also ran the tests through Valgrind 3.1.0 on Linux, and everything seems to be fine.

    Maybe you have a stale build? Maybe Python 2.4.1 also has thread issues?

  4. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @nilswagner01 wrote on 2006-07-21

    I am always doing rm -rf build.
    I am using Python 2.4, 2.4.1 on Linux (32 and 64 bit systems). The segfault is present on all
    3 machines.

    BTW is

    test_divideerr (numpy.core.tests.test_numeric.test_seterr)Segmentation fault

    a new test ?

    I didn't get any segfault one week ago.

  5. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @alberts wrote on 2006-07-21

    No, that test has been there for a while.

    That test is pretty simple, so see if you can get it to segfault in a seperate script, and start commenting out lines from the test so that we can see specifically which line is causing it to die.

  6. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @nilswagner01 wrote on 2006-07-21

    from numpy.core import *

    from numpy.random import rand, randint

    from numpy.testing import *

    from numpy.core.multiarray import dot as dot_

    class test_seterr(NumpyTestCase):

    def test_divideerr(self):
    

    seterr(divide='raise')

        try:
    
            array([1.]) / array([0.])
    
        except FloatingPointError:
    
            pass
    
        else:
    
            self.fail()
    
        seterr(divide='ignore')
    
        array([1.]) / array([0.])
    

    if name == 'main':

    NumpyTest().run()
    

    The problem is seterr(divide='raise')
    If that line is active I get a segfault.

  7. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @rkern wrote on 2006-07-21

    I also get a bus error trying to execute that test on PPC OS X with Python 2.4.1 and r2863. I do not get the error on AMD64 Ubuntu, Python 2.4.3. I'll try with the latest SVN in a bit.

    And Nils, please read WikiFormatting to properly format code and other such text. Your bug reports are difficult to read.

  8. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    Milestone changed to 1.0 Release by @rkern on 2006-07-21

  9. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @alberts wrote on 2006-07-21

    A common element between all the crashers seems to be Python < 2.4.3.

  10. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @teoliphant wrote on 2006-07-24

    This crash also happens with Python 2.3. Actually Python 2.4.2 works for me.

    It is definitely a threading issue. If you remove the threads
    #define NPY_ALLOW_THREADS 0

    This is done for Python 2.3 but perhaps the check needs to be extended to anything less than Python 2.4.2

  11. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    trac user AndrewJ wrote on 2006-07-24

    I can confirm that the problem goes away on upgrading to 2.4.3 on OSX.

    Andrew

  12. numpy-gitbot commented on Oct 19, 2012

    @numpy-gitbot
    Author

    @teoliphant wrote on 2006-07-26

    I've added a check so that threading is disabled on anything but 2.4.2 and above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions