Overview of PyStack capabilities
mainPyStack is a diagnostic tool designed to inspect the stack frames of running Python processes or Python core dump files. It allows developers to understand process behavior (or crash causes) without needing to manually interpret CPython internals.
Key Capabilities:
- Dual Mode: Works with both live running processes and core dump files.
- GIL Awareness: Identifies if threads hold the Python GIL, are waiting for it, or are dropping it.
- GC Visibility: Shows if a thread is currently executing a garbage collection cycle.
- Multi-Interpreter Support: Reports on multiple interpreters residing within the same process.
- Hybrid Stack Traces: Optionally merges native function calls (C/C++/Rust) with Python callables, replacing internal interpreter C-code with the actual Python code being executed.
- Symbol Handling: Automatically demangles symbols in native stacks and includes inlined functions when debug info is available.
- Variable Inspection: Optionally displays local variables and function arguments within Python stack frames.
- Low Impact/High Safety:
- Does not modify memory or execute code in the target process.
- Supports a non-pausing mode for Python stack analysis to minimize impact (though this carries a risk of data races).
- Performance: Optimized for speed, capable of analyzing core files significantly faster than general-purpose tools like GDB.
- Robustness: Works with optimized binaries, binaries lacking symbols (for Python stacks), and is resilient to memory corruption.