Menu

#23 do_curl_perform() Crash: uninitialized stack- Multi-threaded

open
nobody
None
5
2010-12-31
2010-12-31
No

Upon making my python script multi-threaded I started seeing the following error. This is a ubuntu 10.10 running python2.6 and using the python-curl library in apt. I tried building the latest from CVS, and I am getting the same crash.

*** longjmp causes uninitialized stack frame ***: python terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x7f496d5c2537]
/lib/libc.so.6(+0xff4c9)[0x7f496d5c24c9]
/lib/libc.so.6(__longjmp_chk+0x33)[0x7f496d5c2433]
/usr/lib/libcurl-gnutls.so.4(+0xcca5)[0x7f496c587ca5]
/lib/libpthread.so.0(+0xfb40)[0x7f496e6d5b40]
/lib/libc.so.6(__poll+0x53)[0x7f496d59d203]
/usr/lib/libcurl-gnutls.so.4(Curl_socket_ready+0x116)[0x7f496c5b2286]
/usr/lib/libcurl-gnutls.so.4(+0x2a37c)[0x7f496c5a537c]
/usr/lib/pymodules/python2.6/pycurl.so(+0x8ddb)[0x7f496c7d6ddb]
python(PyEval_EvalFrameEx+0x52a8)[0x4a52e8]
python(PyEval_EvalCodeEx+0x911)[0x4a6bd1]
python(PyEval_EvalFrameEx+0x4d19)[0x4a4d59]
python(PyEval_EvalFrameEx+0x5a70)[0x4a5ab0]

The crash is happening here:
/usr/lib/pymodules/python2.6/pycurl.so(+0x8ddb)[0x7f496c7d6ddb]
Which is somewhere inside do_curl_perform()

Discussion

  • Philippe  GASSMANN

    I have the same issue in a multi threaded script.

    I'm running an ubuntu 10.10 (x86_64)

    *** longjmp causes uninitialized stack frame ***: python terminated
    ======= Backtrace: =========
    /lib/libc.so.6(__fortify_fail+0x37)[0x7f5943473537]
    /lib/libc.so.6(+0xff4c9)[0x7f59434734c9]
    /lib/libc.so.6(__longjmp_chk+0x33)[0x7f5943473433]
    /usr/lib/libcurl-gnutls.so.4(+0xcca5)[0x7f5942a24ca5]
    /lib/libpthread.so.0(+0xfb40)[0x7f5944586b40]
    /lib/libc.so.6(__select+0x33)[0x7f59434532c3]
    python[0x4f4ac3]
    python(PyEval_EvalFrameEx+0x516e)[0x4a51ae]
    python(PyEval_EvalCodeEx+0x911)[0x4a6bd1]
    python(PyEval_EvalFrameEx+0x4d19)[0x4a4d59]
    python(PyEval_EvalCodeEx+0x911)[0x4a6bd1]
    python(PyEval_EvalCode+0x32)[0x4a6ca2]
    python(PyRun_FileExFlags+0x13e)[0x4c702e]
    python(PyRun_SimpleFileExFlags+0xd4)[0x4c7244]
    python(Py_Main+0xa01)[0x4180c1]
    /lib/libc.so.6(__libc_start_main+0xfe)[0x7f5943392d8e]
    python[0x4172c9]

     
  • Philippe  GASSMANN

    There is a simple workaround : use curl.setopt(pycurl.NOSIGNAL, 1)

    This will tell libcurl not to use any signal related code that causes in a multithreaded python script this kind of error.

     
  • Nobody/Anonymous

    *** longjmp causes uninitialized stack frame ***: python terminated
    ======= Backtrace: =========
    /lib/libc.so.6(__fortify_fail+0x37)[0x7f4260a1d537]
    /lib/libc.so.6(+0xff4c9)[0x7f4260a1d4c9]
    /lib/libc.so.6(__longjmp_chk+0x33)[0x7f4260a1d433]
    /usr/lib/libcurl-gnutls.so.4(+0xcca5)[0x7f425fe1aca5]
    /lib/libpthread.so.0(+0xfb40)[0x7f4261b30b40]
    /lib/libc.so.6(__select+0x33)[0x7f42609fd2c3]
    python[0x4f4ac3]
    python(PyEval_EvalFrameEx+0x516e)[0x4a51ae]
    python(PyEval_EvalCodeEx+0x911)[0x4a6bd1]
    python[0x535c4d]
    python(PyObject_Call+0x47)[0x41c9d7]
    python(PyEval_EvalFrameEx+0x3861)[0x4a38a1]
    python(PyEval_EvalFrameEx+0x5a70)[0x4a5ab0]

     
  • fastinetserver

    fastinetserver - 2011-10-16

    Zernia, thank you very much for the workaround!!!

    SOLVED my problem on Ubuntu 10.10
    Linux host_name 2.6.35-30-generic #59-Ubuntu SMP Tue Aug 30 15:58:00 UTC 2011 i686 GNU/Linux

    > There is a simple workaround : use curl.setopt(pycurl.NOSIGNAL, 1)
    > This will tell libcurl not to use any signal related code that causes in a
    > multithreaded python script this kind of error.