From 7faf534153f3ae769f0298fdcf743eeea11d5b83 Mon Sep 17 00:00:00 2001 From: Louis Deconinck Date: Fri, 11 Sep 2026 21:26:12 +0200 Subject: [PATCH] Enable debuginfod before gdb's startup lookup in diagnose-crash 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 #11305 --- default/agents/skills/diagnose-crash/SKILL.md | 2 +- test/shell.d/crash-capture-test.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/default/agents/skills/diagnose-crash/SKILL.md b/default/agents/skills/diagnose-crash/SKILL.md index ea77300721c..3fd25ab8c5c 100644 --- a/default/agents/skills/diagnose-crash/SKILL.md +++ b/default/agents/skills/diagnose-crash/SKILL.md @@ -61,7 +61,7 @@ trap 'rm -f "$core"' EXIT coredumpctl dump --output="$core" DEBUGINFOD_URLS="https://debuginfod.archlinux.org" \ gdb -q "$core" \ - -batch -ex 'set debuginfod enabled on' -ex 'bt' + -batch -iex 'set debuginfod enabled on' -ex 'bt' ``` A core is a verbatim copy of the process's memory and can hold passwords, tokens, diff --git a/test/shell.d/crash-capture-test.sh b/test/shell.d/crash-capture-test.sh index 1b7e93d05e2..03f385e3e4e 100755 --- a/test/shell.d/crash-capture-test.sh +++ b/test/shell.d/crash-capture-test.sh @@ -378,6 +378,13 @@ grep -Fq 'omarchy-crash-mute' "$skill" || fail "the diagnosis no longer names the command that mutes, so the offer it makes cannot be carried out" pass "the diagnosis names the command that mutes" +# gdb decides on debuginfod during startup, before -ex commands run, and never +# retries the executable lookup; only -iex enables it in time, so -ex leaves +# the crashed program's own frames unsymbolized while libraries still resolve. +grep -Fq -- "-iex 'set debuginfod enabled on'" "$skill" || + fail "the diagnosis enables debuginfod with -ex, which runs after gdb's startup lookup and leaves the crashed executable unsymbolized" +pass "the diagnosis enables debuginfod before gdb's startup lookup" + grep -Fq 'GROUP_DESCRIPTIONS[crash]' "$ROOT/bin/omarchy" || fail "the crash group has no description, so the router lists a group it cannot describe" pass "the crash group is described in the router"