skillfed

pystack

Analysis of the stack of remote python processes

pystack v1.7.1 335.3K downloads/30d#7,477 on PyPI1,208
Permissive license Apache-2.0 Active released

What it is and what it does

PyStack is a command-line debugger that attaches to running Python processes or analyzes core dump files to extract and display their call stacks. It works by reading process memory directly, making it safe for production use since it does not execute code or modify memory in the target process. The tool can show which threads hold the Python GIL, whether garbage collection is running, and optionally display native C/C++/Rust frames alongside Python frames, local variables, and function arguments.

The package is built on low-level system introspection and is designed to work even with optimized or stripped Python binaries. It supports multiple interpreters in the same process and can tolerate memory corruption, making it useful for diagnosing hangs, deadlocks, and crashes in production systems. PyStack requires Linux and system libraries (libdw, libelf) to build, but pre-built wheels are available for Python 3.9 through 3.15.

Use it for:

  • Diagnose why a production Python service is hanging or unresponsive by inspecting its current call stack without restarting.
  • Analyze a core dump from a crashed Python process to understand the execution state at the time of failure.
  • Debug deadlocks or GIL contention by checking which threads hold the lock and what code they are running.
  • Inspect native function calls mixed with Python frames to troubleshoot crashes in C extensions or mixed-language code.
  • Examine local variables and function arguments in stack frames to understand program state without interactive debugging.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyStack inspects the stack frames of a running Python process or core dump file, showing what code is executing or what caused a crash, without modifying the target process.

Yes, if you develop or operate Python services on Linux and need non-intrusive runtime diagnostics. PyStack fills a gap between interactive debuggers (which require stopping execution) and coarse-grained monitoring. The active maintenance, zero security vulnerabilities, permissive license, and broad Python version support make it low-risk. The main barrier is the Linux-only requirement and system library dependencies; if you're on a different OS or cannot install libdw and libelf, it is not an option.

Install

pystack on PyPI

pip

pip install pystack

uv

uv add pystack

poetry

poetry add pystack

Installing pystack

Before you install

Medium install friction due to compiled C extensions requiring libdw and libelf system libraries. The package is actively maintained with recent releases and broad wheel coverage across Python 3.9–3.15 on Linux platforms.

License in practice

Apache-2.0 is permissive; you may use, modify, and distribute PyStack freely in commercial and open-source projects, provided you include a copy of the license and state any changes.

Quickstart

pip install pystack
pystack remote <PID>
# or for core dumps:
pystack core <core_file> [executable]

Linux only; requires libdw and libelf system libraries installed. Building from source requires pkg-config or manual configuration of library paths.

Verify before relying

  • Whether PyStack can safely inspect processes under heavy load or with memory corruption without data loss.
  • Performance characteristics when analyzing very large core files or processes with thousands of threads.
  • Compatibility with non-CPython implementations or alternative Python distributions.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 335,257/month — #7,477 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pystack-1.7.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp310-cp310-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp311-cp311-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp312-abi3-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp313-cp313t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp313-cp313t-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp314-cp314t-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp315-cp315t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp315-cp315t-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp39-cp39-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Debuggers

Tags

python stack trace inspectionrunning process debuggercore dump analysispython thread debuggingprocess memory inspectionpython crash analysisnative stack trace
debuggingproduction-diagnosticslinux-only

More Debuggers packages