https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108188
Bug ID: 108188 Summary: Segfault in compatibility-condvar.cc Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: glex.spb at gmail dot com Target Milestone: --- I'd like to report a regression in the libstdc++ that comes with GCC 12 series (GCC 11 was OK). On mips32r2 with uClibc simply running `gdb` with no arguments segfaults (even `gdb --help` segfaults). I was able to obtain a stack trace by connecting to `gdb-server` from my desktop. On the device: $ gdbserver 10.1.1.1:8001 gdb On my desktop: $ bin/mipsel-linux-gdb -ix mipsel-gcw0-linux-uclibc/sysroot/usr/share/buildroot/gdbinit -ex="set sysroot ${PWD}/mipsel-gcw0-linux-uclibc/sysroot" -ex='target remote 10.1.1.2:8001' ../target/bin/gdb Remote debugging using 10.1.1.2:8001 Reading symbols from /home/gleb/repos/glebm/od_buildroot/output/gcw0/host/mipsel-gcw0-linux-uclibc/sysroot/lib/ld-uClibc.so.0... 0x77e28ed0 in _start () from /home/gleb/repos/glebm/od_buildroot/output/gcw0/host/mipsel-gcw0-linux-uclibc/sysroot/lib/ld-uClibc.so.0 (gdb) bt #0 0x77e28ed0 in _start () from /home/gleb/repos/glebm/od_buildroot/output/gcw0/host/mipsel-gcw0-linux-uclibc/sysroot/lib/ld-uClibc.so.0 #1 0x00000000 in ?? () Backtrace stopped: frame did not save the PC (gdb) c Continuing. [Detaching after vfork from child process 618] [New Thread 608.619] Thread 2 "gdb worker" received signal SIGSEGV, Segmentation fault. [Switching to Thread 608.619] #0 0x77b17ee0 in __gnu_cxx::__nothrow_wait_cv::wait (this=0xb5fd18, lock=...) at ../../../../libstdc++-v3/src/c++11/compatibility-condvar.cc:74 #1 0x77b17ef0 in __gnu_cxx::__nothrow_wait_cv::wait (this=<optimized out>, lock=...) at ../../../../libstdc++-v3/src/c++11/compatibility-condvar.cc:75 #2 0x77b17ef0 in __gnu_cxx::__nothrow_wait_cv::wait (this=<optimized out>, lock=...) at ../../../../libstdc++-v3/src/c++11/compatibility-condvar.cc:75 ... 60k more identical lines ... #65232 0x77b44ef0 in __gnu_cxx::__nothrow_wait_cv::wait (this=<optimized out>, lock=...) at ../../../../libstdc++-v3/src/c++11/compatibility-condvar.cc:75 #65233 0x77b44ef0 in __gnu_cxx::__nothrow_wait_cv::wait (this=<optimized out>, lock=...) at ../../../../libstdc++-v3/src/c++11/compatibility-condvar.cc:75 #65234 0x008f1e00 in ?? () #65235 0x77b7b9a8 in std::execute_native_thread_routine (__p=0xb9dba0) at ../../../../../libstdc++-v3/src/c++11/thread.cc:82 #65236 0x77a3f3d8 in start_thread (arg=0x779700f0) at libpthread/nptl/pthread_create.c:285 #65237 0x77980478 in __thread_start () at libc/sysdeps/linux/mips/clone.S:121 Backtrace stopped: frame did not save the PC Possible culprit: 9e18a25331fa25c3907249fede65a02c6817b06e (the function at compatibility-condvar.cc:75 was introduced in this commit). --- gcc version information: output/gcw0/host/bin/mipsel-linux-gcc -v Using built-in specs. COLLECT_GCC=/home/gleb/repos/glebm/od_buildroot/output/gcw0/host/bin/mipsel-linux-gcc.br_real COLLECT_LTO_WRAPPER=/home/gleb/repos/glebm/od_buildroot/output/gcw0/host/bin/../libexec/gcc/mipsel-gcw0-linux-uclibc/12.2.0/lto-wrapper Target: mipsel-gcw0-linux-uclibc Configured with: ./configure --prefix=/home/gleb/repos/glebm/od_buildroot/output/gcw0/per-package/host-gcc-final/host --sysconfdir=/home/gleb/repos/glebm/od_buildroot/output/gcw0/per-package/host-gcc-final/host/etc --enable-static --target=mipsel-gcw0-linux-uclibc --with-sysroot=/home/gleb/repos/glebm/od_buildroot/output/gcw0/per-package/host-gcc-final/host/mipsel-gcw0-linux-uclibc/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --enable-plugins --enable-lto --with-gmp=/home/gleb/repos/glebm/od_buildroot/output/gcw0/per-package/host-gcc-final/host --with-mpc=/home/gleb/repos/glebm/od_buildroot/output/gcw0/per-package/host-gcc-final/host --with-mpfr=/home/gleb/repos/glebm/od_buildroot/output/gcw0/per-package/host-gcc-final/host --with-pkgversion='Buildroot 2022.08-1514-g9c33974d6c-dirty' --with-bugurl=http://bugs.buildroot.net/ --without-zstd --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --disable-libsanitizer --enable-tls --enable-threads --without-isl --without-cloog --with-arch=mips32r2 --with-abi=32 --with-nan=legacy --with-fp-32=xx --enable-languages=c,c++ --with-build-time-tools=/home/gleb/repos/glebm/od_buildroot/output/gcw0/per-package/host-gcc-final/host/mipsel-gcw0-linux-uclibc/bin --enable-shared --disable-libgomp --with-mips-plt Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.2.0 (Buildroot 2022.08-1514-g9c33974d6c-dirty)