New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libpython.py: nicer py-bt output #56205
Comments
py-bt is too much verbose, I'm unable to read it. Example: $ gdb -args ./python -c 'import time, threading; threading.Thread(target=lambda:time.sleep(3)).start()'
...
[New Thread 0x7ffff69d9700 (LWP 17193)]
^C
Program received signal SIGINT, Interrupt.
sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
86 ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Aucun fichier ou dossier de ce type.
in ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
(gdb) py-bt
#6 Frame 0xc52620, for file /home/haypo/prog/HG/cpython/Lib/threading.py, line 237, in wait (self=<_Condition(release=<built-in method release of _thread.lock object at remote 0xc1f1e0>, acquire=<built-in method acquire of _thread.lock object at remote 0xc1f1e0>, _lock=<_thread.lock at remote 0xc1f1e0>, _waiters=[<_thread.lock at remote 0xafb590>], _verbose=False) at remote 0xc1cbe0>, timeout=None, waiter=<_thread.lock at remote 0xafb590>, saved_state=None)
waiter.acquire()
#10 Frame 0xbbb580, for file /home/haypo/prog/HG/cpython/Lib/threading.py, line 851, in join (self=<Thread(_target=<function at remote 0xbb5d30>, _block=<_Condition(release=<built-in method release of _thread.lock object at remote 0xc1f1e0>, acquire=<built-in method acquire of _thread.lock object at remote 0xc1f1e0>, _lock=<_thread.lock at remote 0xc1f1e0>, _waiters=[<_thread.lock at remote 0xafb590>], _verbose=False) at remote 0xc1cbe0>, _args=(), _initialized=True, _name='Thread-1', _daemonic=False, _kwargs={}, _stderr=<_io.TextIOWrapper at remote 0xac15a0>, _ident=140737330910976, _started=<_Event(_flag=True, _cond=<_Condition(release=<built-in method release of _thread.lock object at remote 0xad7e00>, acquire=<built-in method acquire of _thread.lock object at remote 0xad7e00>, _lock=<_thread.lock at remote 0xad7e00>, _waiters=[], _verbose=False) at remote 0xc1ce40>, _verbose=False) at remote 0xaec980>, _stopped=False, _verbose=False) at remote 0xc2fb70>, timeout=None)
self._block.wait()
#14 Frame 0xc42eb0, for file /home/haypo/prog/HG/cpython/Lib/threading.py, line 965, in _exitfunc (self=<_MainThread(_target=None, _block=<_Condition(release=<built-in method release of _thread.lock object at remote 0xc66290>, acquire=<built-in method acquire of _thread.lock object at remote 0xc66290>, _lock=<_thread.lock at remote 0xc66290>, _waiters=[], _verbose=False) at remote 0xc66110>, _args=(), _initialized=True, _name='MainThread', _daemonic=False, _kwargs={}, _stderr=<_io.TextIOWrapper at remote 0xac15a0>, _ident=140737353987840, _started=<_Event(_flag=True, _cond=<_Condition(release=<built-in method release of _thread.lock object at remote 0xc62fe0>, acquire=<built-in method acquire of _thread.lock object at remote 0xc62fe0>, _lock=<_thread.lock at remote 0xc62fe0>, _waiters=[], _verbose=False) at remote 0xc65d20>, _verbose=False) at remote 0xc65840>, _stopped=True, _verbose=False) at remote 0xc64c90>, t=<Thread(_target=<function at remote 0xbb5d30>, _block=<_Condition(release=<built-in method release o...(truncated)
t.join() Attached patch uses a syntax closer to classic Python tracebacks: $ gdb -args ./python -c 'import time, threading; (gdb) run
...
[New Thread 0x7ffff69d9700 (LWP 17193)]
^C
Program received signal SIGINT, Interrupt.
sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
86 ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Aucun fichier ou dossier de ce type.
in ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
(gdb) py-bt
Traceback (most recent call first):
File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 237, in wait
File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 851, in join
File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 965, in _exitfunc
(gdb) info threads
2 Thread 0x7ffff69d9700 (LWP 17193) 0x00007ffff72a0c73 in select () at ../sysdeps/unix/syscall-template.S:82
* 1 Thread 0x7ffff7fdb700 (LWP 17190) sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
(gdb) thread 2
[Switching to thread 2 (Thread 0x7ffff69d9700 (LWP 17193))]#0 0x00007ffff72a0c73 in select ()
at ../sysdeps/unix/syscall-template.S:82
82 ../sysdeps/unix/syscall-template.S: Aucun fichier ou dossier de ce type.
in ../sysdeps/unix/syscall-template.S
(gdb) py-bt
Traceback (most recent call first):
File "<string>", line 1, in <lambda>
File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 690, in run
File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 737, in _bootstrap_inner
File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 710, in _bootstrap |
I would also like a less verbose output for where, especially be able to hidden the value of the globals argument of PyEval_EvalCodeEx. Example of where output: Without python-gdb.py: |
New changeset b340d1577dc5 by Victor Stinner in branch '3.2': New changeset 804abc2c60de by Victor Stinner in branch 'default': |
Without any reaction from Dave Malcolm, I kept its name under the name "py-bt-full".
Well, I will maybe open a new issue for this one. But I consider that the work is done on this issue so I close it. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: