Does anyone know what this error is? (Segfault) … nevermind

June 30th, 2008 § 4 comments

Ok, I’m at the end of my san­ity. I’m finally over the hell-death which is hand, foot and mouth (cour­tesy of my daugh­ter) which means I can type again, and now I’m stuck try­ing to debug some das­tardly seg­fault. Here is it (cour­tesy of /var/log/messages):


Jun 30 12:49:13 NON kernel: python[29965]: segfault at 000000010000000f rip
000000000044068e rsp 00002aabea0294b0 error 4

This is on a 64 bit machine. The appli­ca­tion is heav­ily, heav­ily threaded python using queues for inter-thread com­mu­ni­ca­tion, and the threads are using libcurl via pycurl under that.

I get no excep­tions, no errors: Noth­ing. The inter­preter sim­ply dies. If I attach an strace to it, I see this:


futex(0x2e4a6300, FUTEX_WAKE, 1) = 0
futex(0x2e4a6300, FUTEX_WAKE, 1) = 0
futex(0x2aaaac10cab0, FUTEX_WAIT, 0, NULL) = -1 EINTR (Interrupted system call)
--- SIGALRM (Alarm clock) @ 0 (0) ---
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---

Any ideas?

Edit: Never mind, I finally found the answer… I removed:
curl.setopt(pycurl.CONNECTTIMEOUT, 120)
After read­ing this mail thread, and the code now flies. I love life.

  • http://www.swordstyle.com Terry Pep­pers

    Jesse, I’m not sure which I loathe more from my son. The win­ter set of colds, flus and viruses. Or the sum­mer set of rashes, flus and viruses — of the gas­troin­testi­nal variation.

    I think summer.

  • http://bitheap.org/ Brodie Rao

    Were you not able to run gdb? You can usu­ally use it to get the stack trace of a seg­fault (using bt/backtrace). You have to load the Python binary with it though (and not your script), and then use “run /path/to/your/script arg1 arg2 …”.

    You can also change the user limit on core dumps so a full dump is pro­duced on a seg­fault using “ulimit –c unlim­ited”, and then load that core dump into gdb with “core core.123456″.

  • anony­mous

    Pure python code should *never* seg­fault! Every seg­fault should be con­sid­ered a bug and get fixed.

  • anony­mous

    Pure python code should *never* seg­fault! Every seg­fault should be con­sid­ered a bug and get fixed.

What's this?

You are currently reading Does anyone know what this error is? (Segfault) … nevermind at jessenoller.com.

meta