You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
debug_drop_sites.lldb breaks before address filters and loses backtrace commands #1160
tools/debug_drop_sites.lldb does not provide the advertised address-filtered
allocation/free backtraces.
During the #1158 investigation, a run with WITH_DEBUG_ALLOC=1 and WITH_DEBUG_ALLOC_TRAP_FREE=4712080096 stopped on every invocation of dbg_trap_alloc_check/dbg_trap_free_check, including unrelated addresses.
The helper sets entry breakpoints, before each function's address comparison.
Its repeated --one-liner options also leave only the final continue,
discarding the expected bt command.
The exact same binary and environment produced the intended lifetime history
when breakpoints were placed after the filter, at dbg_trap_alloc_check +108
and dbg_trap_free_check +116, using --command "bt 12" --auto-continue true.
Those offsets are diagnostic evidence, not a portable fix: the product helper
should bind a stable post-filter site and verify its command list.
Expected: only the selected address triggers a stack, for every allocation and
free, followed by the final double-free report. Add a reproducible helper
smoke test so a future silent/noisy debugger route cannot pass unnoticed.
Triage 2026-10-25, with v0.15.3.0 (main a261b65): reproduced in source for the filter half. tools/debug_drop_sites.lldb now uses command lists (thread backtrace -c 12, continue), so the backtraces survive. But it still breaks on entry to dbg_trap_free_check / dbg_trap_alloc_check, and rt/rt_core.w:1774 calls the check on every free; the address comparison is inside the function (:1238), after the breakpoint.
post-release: a debugging-tool fix (break after the compare, or guard the call).
Fixed since filing; verified on main 6ea2ec2 with the header's recipe 2 on a real double free (test/debug_alloc/da_3103_large_block_double_free_reported.w, built with with build):
tools/debug_drop_sites.lldb breaks on dbg_trap_hit (by regex, so the release binary's mangled name binds), which the runtime calls only after its address filter; the command list is thread backtrace -c 12 + continue.
lldb --batch -s tools/debug_drop_sites.lldb -o "settings set target.env-vars WITH_DEBUG_ALLOC=1 WITH_DEBUG_ALLOC_TRAP_FREE=4296228880" -o run -o "bt 6" -o quit -- ./df: 8 stops, every one an event of that address (trap-alloc hit=1, trap-release, trap-free hit=1, …), each followed by its backtrace through dbg_trap_alloc_check / dbg_trap_count_check / dbg_trap_free_check into the program's line, then the DOUBLE FREE report.
The requested smoke test is not added to the build: lldb is a host tool and the toolchain's own targets run none (D171, law 8). The trap the helper rides on is exercised by the debug-allocator lane.
Activity
ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): reproduced in source for the filter half.tools/debug_drop_sites.lldbnow uses command lists (thread backtrace -c 12,continue), so the backtraces survive. But it still breaks on entry todbg_trap_free_check/dbg_trap_alloc_check, andrt/rt_core.w:1774calls the check on every free; the address comparison is inside the function (:1238), after the breakpoint.post-release: a debugging-tool fix (break after the compare, or guard the call).
ehartford commentedon Nov 11, 2026
Fixed since filing; verified on main 6ea2ec2 with the header's recipe 2 on a real double free (test/debug_alloc/da_3103_large_block_double_free_reported.w, built with
with build):tools/debug_drop_sites.lldbbreaks ondbg_trap_hit(by regex, so the release binary's mangled name binds), which the runtime calls only after its address filter; the command list isthread backtrace -c 12+continue.lldb --batch -s tools/debug_drop_sites.lldb -o "settings set target.env-vars WITH_DEBUG_ALLOC=1 WITH_DEBUG_ALLOC_TRAP_FREE=4296228880" -o run -o "bt 6" -o quit -- ./df: 8 stops, every one an event of that address (trap-alloc hit=1,trap-release,trap-free hit=1, …), each followed by its backtrace throughdbg_trap_alloc_check/dbg_trap_count_check/dbg_trap_free_checkinto the program's line, then the DOUBLE FREE report.The requested smoke test is not added to the build: lldb is a host tool and the toolchain's own targets run none (D171, law 8). The trap the helper rides on is exercised by the debug-allocator lane.