KOEN
All notes
DEBUGGING & EVIDENCE

When the crash disappears under GDB

An ASan incident report and GDB’s manual prompt a closer look at launch conditions. Success under a debugger does not by itself demonstrate a code fix.

Blocks arranged differently in two paper trays, with a neat arrangement beneath a hand-held magnifying glass

The debugger changes a condition

Imagine a native GNU/Linux test. The same executable crashes when launched from a terminal but starts normally under GDB. Before treating the bug as camera-shy, I want to know whether those two runs actually shared the same conditions.

A similar scene appears in Stock Engineer’s ASan incident report. The author describes a server failing before main() and not reproducing under the debugger. Comparing ASan with address-space layout randomization, or ASLR, supplied a clue in that environment.

That failure was not reproduced here. No server or kernel settings were changed. After reading the author’s account, I checked GDB’s official manual for a launch condition the debugger can alter.

The manual gives disable-randomization a default of on. It disables native address-space randomization for the program GDB starts, on supported targets including GNU/Linux. That description does not extend automatically to attaching to an already running process or to every operating system.

The name takes a second reading: on enables the disabling of randomization. For an actual comparison, I would use show disable-randomization to record the current value beside the result. Reading a documented default and confirming what applied to a particular run are separate checks.

Beside the successful row

Back at the fictional server, “terminal: failure; GDB: success” does not establish a code fix. The chosen observation setup may have changed a condition. Discovering such a difference would not establish ASLR as the cause of every crash either.

For my reproduction notes, I would record launch mode and observed settings beside each outcome. I would also check the binary and input being compared. A more detailed view of one run does not by itself make it a matching experiment.

Suppose matching a condition makes the failure return. That observation narrows the investigation, while further work may still be needed to explain the cause. Conversely, a few attempts without failure would not justify reporting that the problem had disappeared in the original environment.

I can imagine an AI summary losing this distinction. Reading only the outcome column, it could reduce the account to “rerunning succeeded.” Before carrying the author’s remedy into a different environment, I would want the conditions that produced the result to survive the summary.

Two rows remain on screen: one failure and one success. Before checking off the successful row, I add a column for how the program was started.

Sources

All notes