Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #17114

Bug#1118386: RFP: pystack -- Print the stack trace of a running Python process or core dump

From Joseph Nahmias <joe@nahmias.net>
Newsgroups linux.debian.bugs.dist, linux.debian.maint.python
Subject Bug#1118386: RFP: pystack -- Print the stack trace of a running Python process or core dump
Date 2025-10-19 06:10 +0200
Message-ID <LHsU1-6hl2-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


Package: wnpp
Severity: wishlist
X-Debbugs-Cc: Pablo Galindo Salgado <Pablogsal@gmail.com>, opensource@bloomberg.net, debian-python@lists.debian.org, joe@nahmias.net

* Package name    : pystack
  Version         : 1.5.1
  Upstream Contact: Pablo Galindo Salgado <Pablogsal@gmail.com>
* URL             : https://bloomberg.github.io/pystack/
* License         : Apache-2.0
  Programming Lang: Python
  Description     : Print the stack trace of a running Python process or core dump

PyStack is a tool that uses forbidden magic to let you inspect the stack
frames of a running Python process or a Python core dump, helping you
quickly and easily learn what it's doing (or what it was doing when it
crashed) without having to interpret nasty CPython internals.  What
PyStack can do

PyStack has the following amazing features:

    ๐Ÿ’ป Works with both running processes and core dump files.
    ๐Ÿงต Shows if each thread currently holds the Python GIL, is waiting to acquire it, or is currently dropping it.
    ๐Ÿ—‘๏ธ Shows if a thread is running a garbage collection cycle.
    ๐Ÿ Optionally shows native function calls, as well as Python ones. In this mode, PyStack prints the native stack trace (C/C++/Rust function calls), except that the calls to Python callables are replaced with frames showing the Python code being executed, instead of showing the internal C code the interpreter used to make the call.
    ๐Ÿ” Automatically demangles symbols shown in the native stack.
    ๐Ÿ“ˆ Includes calls to inlined functions in the native stack whenever enough debug information is available.
    ๐Ÿ” Optionally shows the values of local variables and function arguments in Python stack frames.
    ๐Ÿ”’ Safe to use on running processes. PyStack does not modify any memory or execute any code in a process that is running. It simply attaches just long enough to read some of the process's memory.
    โšก Optionally, it can perform a Python stack analysis without pausing the process at all. This minimizes impact to the debugged process, at the cost of potentially failing due to data races.
    ๐Ÿš€ Super fast! It can analyze core files 10x faster than general-purpose tools like GDB.
    ๐ŸŽฏ Even works with aggressively optimized Python interpreter binaries.
    ๐Ÿ” Even works with Python interpreters' binaries that do not have symbols or debug information (Python stack only).
    ๐Ÿ’ฅ Tolerates memory corruption well. Even if the process crashed due to memory corruption, PyStack can usually reconstruct the stack.
    ๐Ÿ’ผ Self-contained: it does not depend on external tools or programs other than the Python interpreter used to run PyStack itself.

Back to linux.debian.maint.python | Previous | Next | Find similar


Thread

Bug#1118386: RFP: pystack -- Print the stack trace of a running Python process or core dump Joseph Nahmias <joe@nahmias.net> - 2025-10-19 06:10 +0200

csiph-web