lptrace icon indicating copy to clipboard operation
lptrace copied to clipboard

detaching results in SIGABRT

Open nbeaver opened this issue 6 years ago • 0 comments

I tried running this trivial Python program with lptrace:

$ cat loop_forever.py
#! /usr/bin/env python

import os
print os.getpid()

while True:
    pass

I ran it:

$ ./loop_forever.py 
25116

then I ran lptrace in another terminal.

$ sudo python lptrace -p 25116

I had to use Ctrl-C twice to get it to quit.

$ sudo python lptrace -p 25116
^CReceived Ctrl-C, quitting
^CReceived Ctrl-C, quitting

After this, loop_forever.py exited with signal 6 (SIGABRT):

$ ./loop_forever.py 
25116
Fatal Python error: This thread state must be current when releasing
Aborted (core dumped)

This may be the same bug as #11, but I wanted to demonstrate it is easy to reproduce on a trivial program, not just Guake.

I am on Debian 9.3 (Stretch), running Python 2.7.13, GDB version 7.12-6, and the latest Github version of lptrace.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.3 (stretch)
Release:	9.3
Codename:	stretch
$ python --version
Python 2.7.13
$ gdb --version | head -n 1
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
$ git rev-parse HEAD
537053c5fd6c3d84d0fb73d675fe926d470c82d5

Full backtrace of dumped core file is below:

Core was generated by `python ./loop_forever.py'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
set = {__val = {0, 140451948041416, 140726353628400, 4294967301, 140451948040560, 140726353628384, 93833867754558, 252833149, 4294967295, 1, 140451930217944, 140451947630592, 93833869879752, 93833869879750, 140451946566352, 8}}
pid = <optimized out>
tid = <optimized out>
sig = 6
  Id   Target Id         Frame 
* 1    Thread 0x7fbd84723700 (LWP 31965) __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51

Thread 1 (Thread 0x7fbd84723700 (LWP 31965)):
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
        set = {__val = {0, 140451948041416, 140726353628400, 4294967301, 140451948040560, 140726353628384, 93833867754558, 252833149, 4294967295, 1, 140451930217944, 140451947630592, 93833869879752, 93833869879750, 140451946566352, 8}}
        pid = <optimized out>
        tid = <optimized out>
#1  0x00007fbd836b73fa in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0, 93833891493728, 0, 1, 140451943638619, 93833891511584, 93833868582196, 93833891493728, 0, 0, 2880, 0, 140451933972304, 140451933967648, 140451933972304, 140451947624192}}, sa_flags = -2089902068, sa_restorer = 0x7fbd83a1d6e0 <stderr>}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00005557665fb8b2 in Py_FatalError (msg=<optimized out>) at ../Python/pythonrun.c:1700
No locals.
#3  0x000055576664aff8 in PyGILState_Release (oldstate=PyGILState_LOCKED) at ../Python/pystate.c:635
        tcur = <optimized out>
#4  0x00007ffd68518f0f in ?? ()
No symbol table info available.
#5  0x0000000000000300 in ?? ()
No symbol table info available.
#6  0xcc00000000000330 in ?? ()
No symbol table info available.
#7  0x000000000000000c in ?? ()
No symbol table info available.
#8  0x4fab7054cad2ce00 in ?? ()
No symbol table info available.
#9  0x0000000000000002 in ?? ()
No symbol table info available.
#10 0x00007fbd8465e5d0 in ?? ()
No symbol table info available.
#11 0x00007fbd845fbf80 in ?? ()
No symbol table info available.
#12 0x0000000000000000 in ?? ()
No symbol table info available.

nbeaver avatar Feb 06 '18 23:02 nbeaver