Segfault due to threads created by external modules

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bernhard.voigt@gmail.com

    Segfault due to threads created by external modules

    Dear list,

    I'm using two external modules (matplotlib and pyroot). Both are using
    different GUI threads (internally) Unfortunately, pretty soon after
    I've loaded both modules and made some function calls (without
    invoking GUI commands), python dies with a segfault. A libthread_db
    captures the stack trace. My python version is 2.5 and I'm on a
    Scientific Linux 5 system.

    *** Break *** segmentation violation
    Using host libthread_db library "/lib/libthread_db.so .1".
    Attaching to program: /proc/20957/exe, process 20957
    [Thread debugging using libthread_db enabled]
    [New Thread -1208964416 (LWP 20957)]
    [New Thread 133323664 (LWP 20964)]
    [New Thread 48200592 (LWP 20958)]
    0x009e2402 in __kernel_vsysca ll ()
    Thread 3 (Thread 48200592 (LWP 20958)):
    #0 0x009e2402 in __kernel_vsysca ll ()
    #1 0x4e94bf91 in ___newselect_no cancel () from /lib/libc.so.6
    #2 0x0494fcac in Tcl_InitNotifie r () from /usr/lib/libtcl8.4.so
    #3 0x4e9f92db in start_thread () from /lib/libpthread.so.0
    #4 0x4e95312e in clone () from /lib/libc.so.6

    Thread 2 (Thread 133323664 (LWP 20964)):
    #0 0x009e2402 in __kernel_vsysca ll ()
    #1 0x4e9ff14e in sem_wait@GLIBC_ 2.0 () from /lib/libpthread.so.0
    #2 0x00f2166e in PyThread_acquir e_lock (lock=0x89b1ea8 , waitflag=1)
    at Python/thread_pthread. h:349
    #3 0x00eeff27 in PyEval_RestoreT hread (tstate=0xa2558 20) at Python/
    ceval.c:312
    #4 0x002bec23 in time_sleep (self=0x0, args=0x9afcfec) at /tmp/bvoigt/
    Python-2.5.1/Modules/timemodule.c:92 1
    #5 0x00ea900d in PyCFunction_Cal l (func=0xb7e544a c, arg=0x9afcfec,
    kw=0x0) at Objects/methodobject.c: 108
    #6 0x00ef65df in PyEval_EvalFram eEx (f=0xa30028c, throwflag=0) at
    Python/ceval.c:3564
    #7 0x00ef7734 in PyEval_EvalCode Ex (co=0xb7cd7698,
    globals=0xb7cb8 13c, locals=0x0, args=0x9afcfd8, argcount=1,
    kws=0xa05cf40, kwcount=0, defs=0x0,
    defcount=0, closure=0x0) at Python/ceval.c:2831
    #8 0x00e953c0 in function_call (func=0xb7cdad1 4, arg=0x9afcfcc,
    kw=0x9af99bc) at Objects/funcobject.c:51 7
    #9 0x00e734f7 in PyObject_Call (func=0x0, arg=0x9afcfcc,
    kw=0x9af99bc) at Objects/abstract.c:1860
    #10 0x00ef441b in PyEval_EvalFram eEx (f=0xa30012c, throwflag=0) at
    Python/ceval.c:3844
    #11 0x00ef6260 in PyEval_EvalFram eEx (f=0xa2fff9c, throwflag=0) at
    Python/ceval.c:3650
    #12 0x00ef7734 in PyEval_EvalCode Ex (co=0xb7d93a88,
    globals=0xb7d90 24c, locals=0x0, args=0x9afcfb8, argcount=1, kws=0x0,
    kwcount=0, defs=0x0,
    defcount=0, closure=0x0) at Python/ceval.c:2831
    #13 0x00e952ea in function_call (func=0xb7d9d09 c, arg=0x9afcfac,
    kw=0x0) at Objects/funcobject.c:51 7
    #14 0x00e734f7 in PyObject_Call (func=0x0, arg=0x9afcfac, kw=0x0) at
    Objects/abstract.c:1860
    #15 0x00e7ad15 in instancemethod_ call (func=0x9af6054 , arg=0x9afcfac,
    kw=0x0) at Objects/classobject.c:2 497
    #16 0x00e734f7 in PyObject_Call (func=0x0, arg=0xb7eca02c, kw=0x0) at
    Objects/abstract.c:1860
    #17 0x00eef43c in PyEval_CallObje ctWithKeywords (func=0x9af6054 ,
    arg=0xb7eca02c, kw=0x0) at Python/ceval.c:3433
    #18 0x00f25d14 in t_bootstrap (boot_raw=0xa24 eec8) at ./Modules/
    threadmodule.c: 424
    #19 0x4e9f92db in start_thread () from /lib/libpthread.so.0
    #20 0x4e95312e in clone () from /lib/libc.so.6

    Thread 1 (Thread -1208964416 (LWP 20957)):
    #0 0x009e2402 in __kernel_vsysca ll ()
    #1 0x4e9136ab in __waitpid_nocan cel () from /lib/libc.so.6
    #2 0x4e8bba0f in do_system () from /lib/libc.so.6
    #3 0x4e8bbdc2 in system () from /lib/libc.so.6
    #4 0x4ea010bd in system () from /lib/libpthread.so.0

    I have no idea how to solve this. Somebody else has an idea?

    Thanks! Bernhard

Working...