--- id: pystack version: "1.7.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # pystack — Analysis of the stack of remote python processes License: permissive · Maintenance: active · Downloads: 335.3K/mo ## 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 above — 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 pip install pystack uv add pystack 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 # or for core dumps: pystack core [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_current - Install friction: medium - Maintenance: active - Downloads: 335.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python stack trace inspection, running process debugger, core dump analysis, python thread debugging, process memory inspection, python crash analysis, native stack trace, debugging, production-diagnostics, linux-only [View on SkillFed](https://skillfed.io/packages/pystack) · [View on PyPI](https://pypi.org/project/pystack/)