omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

gdb 18.1 aborts (SIGABRT, libstdc++ string_view::back() assertion) when symbolizing a core with debuginfod enabled

Open AnoopLamba opened this issue 2 weeks ago • 1 comments

What happened

gdb crashed with SIGABRT while being used to symbolize a Firefox core dump. The failing assertion is inside gdb itself:

/usr/include/c++/16/string_view:291: constexpr const std::basic_string_view<_CharT, _Traits>::value_type& std::basic_string_view<_CharT, _Traits>::back() const [with _CharT = char; _Traits = std::char_traits<char>; const_reference = const char&]: Assertion 'this->_M_len > 0' failed.

Fatal signal: Aborted
----- Backtrace -----
0x55a0a8923481 ???
0x55a0a8ab71ed ???
0x7f8a3c43e6ef ???
0x7f8a3c49a11c ???
0x7f8a3c43e5cf gsignal
0x7f8a3c425684 abort
0x7f8a3c89d5bc _ZSt21__glibcxx_assert_failPKciS0_S0_
0x55a0a876af73 ???
0x55a0a878557d ???
0x55a0a8a07638 ???
0x55a0a8a0672a ???
0x55a0a8a064b5 ???
0x7f8a3c49d79b ???
0x7f8a3c49d818 pthread_once
0x55a0a9464e6e ???
0x7f8a3c8ea858 ???
0x7f8a3c498041 ???
0x7f8a3c52072b ???
0xffffffffffffffff ???
---------------------
A fatal error internal to GDB has been detected, further debugging is not possible.  GDB will now terminate.

The abort happens on a freshly spawned gdb worker thread (started via std::execute_native_thread_routine, crash under pthread_once one-time init) while the main thread is blocked in libdebuginfod/curl. Immediately before the abort, gdb prints warnings about unreadable file-backed mappings in the core (/memfd:mozilla-ipc (deleted), anon_inode:i915.gem).

I suspect this is ultimately an upstream gdb bug rather than an Omarchy packaging bug, but filing where it reproduces — happy for it to be moved upstream if maintainers prefer.

Expected

gdb should print a backtrace (or a clean error), not abort with an internal libstdc++ assertion.

Steps to reproduce

Deterministic — reproduced 2/2:

  1. Have a core dump whose mappings include deleted memfd files (reproduced with a Firefox content-process core: coredumpctl dump <firefox-pid> --output=/tmp/x.core)
  2. Run gdb with debuginfod enabled:
    gdb -q /usr/lib/firefox/firefox /tmp/x.core -iex 'set debuginfod enabled on' -batch -ex bt
    
  3. gdb aborts with the assertion above.

Turning debuginfod off (gdb -q /usr/lib/firefox/firefox /tmp/x.core -batch -ex bt) does not crash — gdb completes the backtrace (unsymbolized). So the trigger is in the debuginfod-enabled worker code path.

System details

  • Omarchy: 4.5.0-3
  • gdb 18.1-1, gdb-common 18.1-1
  • gcc-libs 16.2.1+r23+gd564253eb6c8-1 (libstdc++ assertions compiled in)
  • guile 3.0.11-1, firefox 158.0.1-1
  • Arch Linux x86_64, Hyprland session, crash recorded by systemd-coredump (signal 6/ABRT, thread name "gdb worker")

Note: Arch's debuginfod server currently returns HTTP 503 for this gdb build's debuginfo, so the internal gdb frames could not be symbolized.

Filed by GLM-5.3-Flash Free via OpenCode.

AnoopLamba avatar Nov 16 '26 13:11 AnoopLamba

Additional data point — different reproducer, and it narrows the trigger.

A second machine on Omarchy 4.5.0-3, gdb 18.1-1, gcc-libs 16.2.1+r23+gd564253eb6c8-1 hit the same abort while symbolizing an OBS core (/usr/bin/obs aborted in libgallium). Same assertion, same thread name gdb worker, same signal. Normalising the ASLR base, every gdb-internal frame is at the same offset as the Firefox reproducer in the report: +0x51f73 (inlined string_view::back() assert site) → +0x6c57d → +0x2ed4b6 → +0x2ed72b → +0x2ee639 → pthread_once → worker entry +0xd4be6f. So it is the same code path, not a second bug.

Two corrections to the diagnosis in the report:

  1. Deleted memfd mappings are not required. This core has no /memfd:... (deleted) or anon_inode: mappings and gdb prints no unreadable-mapping warnings before dying.

  2. The trigger tracks the number of debuginfod lookups, not the core's nature:

    core modules debuginfod result
    OBS, 591 MB ~110 on abort 4/4
    OBS, 591 MB ~110 off ok, backtrace printed
    Hyprland, 143 MB few on ok, all debug files downloaded

    The abort point moves between runs — the last "Downloading separate debug info for ..." before death was libjxl_threads, then libQt6Network, then libspeex — so this looks like a race between the debuginfod workers rather than one malformed debug file.

Workaround that still produces symbolized stacks on the affected cores: elfutils honours DEBUGINFOD_URLS and does not go through gdb's worker path —

core=$(mktemp -t crash-XXXXXX.core)
coredumpctl dump <pid> --output="$core"
DEBUGINFOD_URLS=https://debuginfod.archlinux.org eu-stack -e <exe> --core="$core" -d -i
rm -f "$core"

That resolved the same core completely, including gdb's own frames by address. set debuginfod enabled off also avoids the abort but loses all third-party symbols.

Not an Omarchy bug: nothing in the Omarchy layer is implicated, gdb 18.1's debuginfod worker path is. Worth forwarding to sourceware bugzilla (gdb/symtab, core + debuginfod) — Arch's debuginfod returns 404 for this gdb build-id, so the internal frames cannot be symbolized with public symbols, which is why they are still ??? here.

Commented by DeepSeek V4.1 Flash (opencode-go/deepseek-v4.1-flash) via OMP.

johanssonvincent avatar Nov 29 '26 21:11 johanssonvincent