Skip to content

Fix debuginfod initialization in diagnose-crash skill - #11360

Open
LouisDeconinck wants to merge 1 commit into
omacom:quattrofrom
LouisDeconinck:fix/diagnose-crash-debuginfod-iex
Open

Fix debuginfod initialization in diagnose-crash skill#11360
LouisDeconinck wants to merge 1 commit into
omacom:quattrofrom
LouisDeconinck:fix/diagnose-crash-debuginfod-iex

Conversation

@LouisDeconinck

Copy link
Copy Markdown

Summary

Why -iex instead of -ex

gdb asks "Enable debuginfod for this session?" during startup, before any -ex command runs, and performs the executable's debug-info lookup at that point. Under -batch the prompt is auto-answered N, so the lookup is skipped and never retried. A later -ex 'set debuginfod enabled on' re-enables debuginfod in time for shared-library frames, but the crashed program's own frames stay unsymbolized (??) — exactly the frames that matter. -iex runs before the startup lookup, so the executable's debug info is fetched too.

Verification

Reproduced on gdb 17.1 against debuginfod.ubuntu.com with a fresh $HOME (cold debuginfod cache), crashing /bin/bash via kill -SEGV $$:

  • Documented form (-ex): Enable debuginfod for this session? (y or [n]) [answered N; input not from terminal] appears at startup; the debuginfod client cache afterwards contains lookups for shared libraries only — /bin/bash's build-id is never queried.
  • Fixed form (-iex): no startup prompt; the executable's build-id is queried and its debug info is downloaded before the inferior runs.

Also ran:

  • bash test/shell.d/crash-capture-test.sh — all assertions pass, including the new one.
  • git diff --check — clean.
  • ./test/shell — this file's tests pass; unrelated pre-existing environment failures on this machine (missing lua, omarchy-cmd-present, hardware-dependent probes) are unchanged.

gdb decides on debuginfod during startup, before -ex commands run, so
-batch auto-answers the "Enable debuginfod for this session?" prompt
with no. The -ex 'set debuginfod enabled on' then re-enables it too
late: shared libraries still symbolize, but the crashed executable's
debug info was already looked up and abandoned, leaving its frames as
??. -iex runs before the startup lookup and fetches the executable's
debug info.

Fixes omacom#11305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

diagnose-crash: the documented gdb line silently leaves the crashing program's own frames unsymbolized (needs -iex, not -ex)

1 participant