trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

Fix null pointer dereference in traffic_crashlog

Open bryancall opened this issue 1 month ago • 0 comments

Summary

  • Fix ASAN SEGV in crashlog_write_backtrace() when ServerBacktrace() returns 0 but leaves trace pointer null
  • This occurs when the target process has already exited before crashlog can retrieve the backtrace
  • Added null check before calling fprintf() with the trace pointer

Root Cause

Introduced in PR #10811 which moved backtrace logging from traffic_manager to traffic_crashlog but didn't account for trace being null.

Test plan

  • [x] Build with ASAN (cmake --preset dev-asan)
  • [x] Create invalid remap.config to trigger crash
  • [x] Verify traffic_crashlog no longer crashes with ASAN SEGV
  • [x] Verify crash log contains "Unable to retrieve backtrace: trace is null" message

bryancall avatar Dec 11 '25 23:12 bryancall