C++ Crash Explainer
A beginner-friendly developer tool that translates cryptic C++ AddressSanitizer (ASan) diagnostic reports into plain, actionable English.
🎯 What Problem Does This Solve?
Compiling C++ programs with -fsanitize=address is the gold standard for catching memory safety errors (like buffer overflows and use-after-free bugs). However, the default diagnostic output is verbose, technical, and often overwhelms students and beginners.
C++ Crash Explainer parses the raw ASan crash report and provides:
- Error Type: What kind of bug happened in clear terms.
- Where: The exact source file, line number, and function where the crash occurred.
- What The Report Tells Us: Facts extracted from the report (how many bytes were read/written, buffer size, allocation site).
- What To Check Next: Actionable hints on common root causes (off-by-one errors, loop boundaries, pointer math).
- Limitations: Clear statements on what the report cannot know so beginners don't make assumptions.
🚀 Quick Start
Installation
pip install cpp-crash-explainer
Usage
Pass a saved AddressSanitizer report file directly:
cpp-crash-explainer report.txt
Or pipe a crash output directly via standard input:
./my_program 2>&1 | cpp-crash-explainer
💡 Example
Given an AddressSanitizer heap-buffer-overflow report, the tool outputs:
C++ CRASH EXPLAINER
ERROR TYPE
Heap buffer overflow
WHAT HAPPENED
The program attempted to read or write memory outside the valid boundaries of a dynamically allocated (heap) array or object.
WHERE
/home/student/projects/buffer_test.cpp:14 (in function 'main')
WHAT THE REPORT TELLS US
The program crashed while reading 4 byte(s). The memory access occurred 4 byte(s) past the end of a 40-byte allocated heap buffer. The heap buffer was allocated at /home/student/projects/buffer_test.cpp:10.
WHAT TO CHECK NEXT
1. Check the array/buffer indexing at the crash location to see if the index exceeds the size.
2. Remember that in C++, an array of size N has valid indices from 0 to N-1 (off-by-one errors are common).
3. Check loop bounds (e.g., using '<=' instead of '<').
4. If using raw pointers or manual allocation (new[] / malloc), verify that the allocated byte size matches the data type.
LIMITATIONS
AddressSanitizer detects that an out-of-bounds address was accessed, but it cannot know what value you intended to calculate or why the index became invalid. You must inspect the logic leading up to the access.
🧪 Running Tests
pytest
Metadata
Release files for cpp-crash-explainer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cpp_crash_explainer-0.1.0.tar.gz | 11.5 kB | Without provenance | Details for cpp_crash_explainer-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cpp_crash_explainer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cpp_crash_explainer-0.1.0-py3-none-any.whl |
Total release size: 23.2 kB
Release files / cpp_crash_explainer-0.1.0.tar.gz
| Download URL | cpp_crash_explainer-0.1.0.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73aa19b7bd838a44c34f561228b37807d689606dc7885bd38fe15fbd1804adcd
|
|
BLAKE2b-256 checksum How to use checksums |
fea6811e331fe1e478ca95856a5854b051cac08b3564d3485224c15f1e0733c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / cpp_crash_explainer-0.1.0-py3-none-any.whl
| Download URL | cpp_crash_explainer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1b54f4b1e79f02815f695c238694b1e09164d942eb63c05de1f7152e6375ed0
|
|
BLAKE2b-256 checksum How to use checksums |
30bf79db9ef768a23658988b57988d4dcbee8d7518e529f84fa4cfcddd74c163
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for cpp-crash-explainer 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.