[Bug libc/33959] New: WAIT_FOR_DEBUGGER=1 doesn't work (gdb errors out; wait_for_debugger not found)
sam at gentoo dot org
sourceware-bugzilla@sourceware.org
Wed Mar 4 18:07:45 GMT 2026
https://sourceware.org/bugzilla/show_bug.cgi?id=33959
Bug ID: 33959
Summary: WAIT_FOR_DEBUGGER=1 doesn't work (gdb errors out;
wait_for_debugger not found)
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: sam at gentoo dot org
CC: drepper.fsp at gmail dot com
Target Milestone: ---
For quite a while (a few years), I've been unable to use WAIT_FOR_DEBUGGER, but
Frank asked me about it when I referenced it today so finally filing a bug:
```
$ CFLAGS="-Og -g" ~/git/glibc/configure --prefix=/usr --disable-werror
$ make -j$(nproc) -l$(nproc)
$ make check -j$(nproc) -l$(nproc)
$ WAIT_FOR_DEBUGGER=1 make test t=nptl/tst-pthread-exited -Onone -j1
[...]
```
Waiting for debugger, test process is pid 853244
In another terminal:
```
$ gdb -x /tmp/glibc-bld/nptl/tst-pthread-exited.gdb
⚠ warning: Build ID mismatch between current exec-file
/tmp/glibc-bld/nptl/tst-pthread-exited
and automatically determined exec-file /tmp/glibc-bld/elf/ld.so
exec-file-mismatch handling is currently "ask"
⚠ warning: Unable to find libthread_db matching inferior's thread library,
thread debugging will not be available.
__internal_syscall_cancel (a1=<optimized out>, a2=a2@entry=0, a3=<optimized
out>, a4=<optimized out>, a5=a5@entry=0, a6=a6@entry=0, nr=230) at
cancellation.c:64
64 }
❌ /tmp/glibc-bld/nptl/tst-pthread-exited.gdb:6: Error in sourced command file:
No symbol "wait_for_debugger" in current context.
(gdb)
```
This is w/ recent gcc and gdb trunk but that's not related to this, as I've
seen it for such a long time:
```
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/16/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/16
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/16/python
--enable-libphobos --enable-objc-gc
--enable-languages=c,c++,d,go,objc,obj-c++,fortran,ada,cobol,algol68,m2,rust,jit
--enable-obsolete --enable-secureplt --disable-werror --with-system-zlib
--enable-nls --without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 16.0.9999 p, commit
fce599abdf3636cf28c4f3396bb8c889166553a9' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch
--enable-linker-build-id --enable-libada --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --with-tls=gnu2 --enable-multilib
--with-multilib-list=m32,mx32,m64 --disable-fixed-point --with-abi=m64
--enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--disable-cet --enable-systemtap --enable-valgrind-annotations
--enable-valgrind-interop --disable-vtable-verify --disable-libvtv --with-zstd
--with-isl --disable-isl-version-check --enable-default-pie --enable-host-pie
--enable-host-bind-now --enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1 --enable-host-shared
--enable-libgdiagnostics --with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260227 (experimental)
f23a339a686ed6cc6a4838459bc220e48ba901cb (Gentoo Hardened 16.0.9999 p, commit
fce599abdf3636cf28c4f3396bb8c889166553a9)
```
```
$ gdb --version
GNU gdb (Gentoo 9999 vanilla) 18.0.50.20260304-git
Copyright (C) 2026 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
sam@mop ~ $
```
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list