Free Tool

What Did the Sanitizer Just Tell You?

Paste the report your program printed. The decoder names the bug class, the file and line it points to, and the fix — in plain language, with no jargon. It runs entirely in your browser: nothing you paste leaves the page.

Decode your report

Paste an AddressSanitizer, UBSan, or ThreadSanitizer report below. The decoder reads it in your browser, names each bug it finds, and tells you what to fix. It never uploads the paste.

Or load a sample report, produced by a real run:

What the decoder reads

Three sanitizers print three different report shapes. The decoder matches each shape the way the report actually looks, not the way a summary says it looks.

AddressSanitizer (ASan) prints an ERROR header naming the bug, an access line (READ or WRITE of some size), a region or frame line, stacks, and a SUMMARY line that names the file, the line, and the function. A use-after-free report carries three stacks in order: the bad access, the free, and the original allocation. A stack overflow report carries a frame-object line that names the variable — [32, 40) 'buf' means the variable buf occupies bytes 32 to 40 of its stack frame. The ERROR line alone never names the variable. ASan stops the program at the first error it finds, so fix that one before re-running: later reports can mislead once memory is corrupt.

UndefinedBehaviorSanitizer (UBSan) prints one line per failed check: file:line:col: runtime error: <check>: <values>. There is no SUMMARY block and no stack trace unless UBSAN_OPTIONS=print_stacktrace=1 is set. One buggy line can print two reports — a misaligned store and the load that follows it — so the decoder counts distinct file, line, and check triples, not reports. The check list is long (signed overflow, misaligned access, out-of-bounds indexing, bad shifts, null dereference, and more), but the line shape is the same for all of them.

ThreadSanitizer (TSan) prints a WARNING header naming the race, two access blocks (one per thread, each with its size and thread), a "created at" stack for the spawned thread, and a SUMMARY line.

Six reports

Heap use-after-free. Flags: -fsanitize=address -O1. Exit code 1. Three stacks are present: the bad access, the free, and the original allocation.

SUMMARY: AddressSanitizer: heap-use-after-free uaf.cpp:2 in main

Heap buffer overflow. Flags: -fsanitize=address -O0. Exit code 1. The write landed 0 bytes after a 10-byte region — the first byte past the end.

SUMMARY: AddressSanitizer: heap-buffer-overflow hbo2.cpp:3 in main

Stack buffer overflow. Flags: -fsanitize=address -O1. Exit code 1. The frame line names the variable buf.

SUMMARY: AddressSanitizer: stack-buffer-overflow sbo.cpp:1 in main

Signed integer overflow. Flags: -fsanitize=undefined -O1. Exit code 0. The program printed -2147483648 and kept going.

ubsan.cpp:2:35: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'

Misaligned store and load. Flags: -fsanitize=undefined -O1. Exit code 0. Two reports from one line: a store and a load to the same misaligned address.

misalign.cpp:3:54: runtime error: store to misaligned address 0x7ffcd65f42b1 for type 'int', which requires 4 byte alignment
misalign.cpp:3:65: runtime error: load of misaligned address 0x7ffcd65f42b1 for type 'int', which requires 4 byte alignment

Data race. Flags: -fsanitize=thread -O1. Exit code 66. No race report. The runtime printed the line below and died before the program ran.

FATAL: ThreadSanitizer: unexpected memory mapping 0x5b052d750000-0x5b052d751000

The last row is the honest one. ThreadSanitizer maps a large amount of virtual address space for its shadow memory, and that mapping step fails. A second run died the same way with a segmentation fault (exit code 139). Neither run produced a race report.

The -O1 trap

The heap overflow row above carries -O0 for a reason. The first attempt compiled the same one-line fixture at -O1, and the program ran clean: exit code 120, empty error output, no report at all. Exit code 120 is not a sanitizer code. It is the ASCII code of the letter x — the program stored 'x' past the end of a 10-byte buffer, then returned that byte, and the optimizer forwarded the stored value to the load and deleted the dead store along with its check. Even with the index taken from the command line, the optimizer still removed the check at -O1.

The Clang documentation advises -O1 or higher for reasonable performance while finding bugs in real code, and that advice is right for real code. It is wrong for a one-line fixture whose entire bug is a single store the optimizer can prove dead. If you are writing a fixture to test a decoder — or to teach someone what an overflow report looks like — compile it at -O0, or put a volatile or no-inline boundary between the store and the load. And assert the exit code and the SUMMARY line for every fixture: a fixture that passes silently proves nothing about the decoder.

Exit codes lie

Each sanitizer signals failure differently, and the difference matters when you wire one into CI.

AddressSanitizer exits with code 1 on the first error it finds. That is the easy case: a non-zero exit means the build failed.

UBSan, in its default recover mode, prints the report and keeps running. The signed-overflow fixture above printed its one-line report, printed -2147483648, and exited 0. A CI job that checks only the exit code would pass a build with a signed overflow in it. Rebuilding the same fixture with -fno-sanitize-recover changed the exit code to 1 with the same report line. If the report should fail the build, that flag is the one that makes it fail.

ThreadSanitizer's default exit code on a found race is 66, not 1. But 66 is also the code the runtime exits with when its own mapping setup fails — the failed TSan run exited 66 with a FATAL line and no race report at all. Do not treat a TSan exit code of 66 on WSL as a found race. Read the output: a race report starts with WARNING: ThreadSanitizer: data race, and a runtime failure starts with FATAL:.

What this page cannot do

This page parses report text. It does not run your program, and it cannot tell you that code is clean. A clean run under the sanitizer is the only evidence of that, and this page cannot produce one.

It cannot run ThreadSanitizer for you, and it cannot reproduce the runtime's symbolization: the stack traces in a real report come from debug information in your binary and the llvm-symbolizer tool, which a web page does not have. The decoder reads the file and line from the SUMMARY line and the access blocks, which is what the report itself states.

It cannot judge a report it has never seen the shape of. ASan, UBSan, and TSan cover the common cases — out-of-bounds access, use-after-free, double free, leaks, undefined behavior checks, data races — but a sanitizer you did not build with prints nothing at all. If you paste program output with no report in it, the decoder says so plainly instead of guessing.

Frequently asked questions

Does this page send my report anywhere? No. The decoder is client-side JavaScript. Your paste stays in your browser tab and is never uploaded, logged, or sent to any server.

Does the decoder run my program? No. It reads the report text you paste and matches it against the report shapes the three sanitizers print. It cannot run your binary, and it cannot tell you whether code is clean — only a clean run under the sanitizer itself can do that.

My program printed a UBSan report and still exited 0. Is that a bug in UBSan? No. UBSan runs in recover mode by default: it prints the report and the program keeps running, so the exit code stays 0. Build with -fno-sanitize-recover if a report should fail the build.

My ThreadSanitizer run printed FATAL: unexpected memory mapping. Did it find a race? No. The ThreadSanitizer runtime died while setting up its own memory mapping, before the program ran under the checker. No race was found and none was ruled out. Run the ThreadSanitizer build on a native Linux machine instead.

Why did my heap overflow produce no report at -O1? The optimizer can prove a single-store overflow is dead code and remove it, along with its check. A one-line fixture that stores once and returns the value compiles to a program that returns the stored byte and exits 120 — the ASCII code of x, not a sanitizer code. Rebuild the fixture at -O0, or give the store a boundary the optimizer cannot see through, and the report fires.

Can the decoder tell me my code is clean? No. It can only read the report you paste. A clean run under the sanitizer is the evidence; this page reads reports, it does not produce them.

Sources

  • Clang, AddressSanitizer — the bug list, the 2x slowdown figure, "exits on the first detected error", and the canonical use-after-free report with its three stacks.
  • Clang, UndefinedBehaviorSanitizer — the canonical signed-overflow line, the check list, recover mode continuing after a report, and -fno-sanitize-recover.
  • Clang, ThreadSanitizer — the canonical data-race report, the default exit code of 66, and the 5x–15x slowdown and 5x–10x memory figures.
  • IREE, Model development debugging — sanitizers catch memory issues (ASan), thread synchronization issues (TSan), and undefined behavior (UBSan). The older IREE sanitizers URL now returns 404; this is the current page.

Keep Exploring