[Bug libstdc++/102077] New: null-pointer dereference in std::thread::detach()

florin.iucha at amd dot com gcc-bugzilla@gcc.gnu.org
Thu Aug 26 12:22:59 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102077

            Bug ID: 102077
           Summary: null-pointer dereference in std::thread::detach()
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: florin.iucha at amd dot com
  Target Milestone: ---

Building static GDB using crosstool-ng
(https://github.com/cpackham/crosstool-ng/tree/glibc-2.34) using: glibc 2.34,
binutils 2.37, GCC from 11 branch (2e90914b79dd1c591c8a4d663ae2319fbb15df2c),
gdb 10.2 (statically linked) I get crash on startup:


fldiag114 ~/x-tools/x86_64-tng-linux-gnu$ gdb
./x86_64-tng-linux-gnu/debug-root/usr/bin/gdb
GNU gdb (Ubuntu 10.2-0ubuntu1~18.04~2) 10.2
Copyright (C) 2021 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.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Traceback (most recent call last):
  File "<string>", line 3, in <module>
ModuleNotFoundError: No module named 'libstdcxx'
/home/fiucha/.gdbinit:7: Error in sourced command file:
Error while executing Python code.
Reading symbols from ./x86_64-tng-linux-gnu/debug-root/usr/bin/gdb...
(gdb) run
Starting program:
/home/fiucha/x-tools/x86_64-tng-linux-gnu/x86_64-tng-linux-gnu/debug-root/usr/bin/gdb
[Detaching after vfork from child process 35124]
[New LWP 35125]

Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000000ac96c9 in std::thread::detach() ()
#2  0x0000000000a4424b in gdb::thread_pool::set_thread_count(unsigned long) ()
#3  0x000000000070be47 in update_thread_pool_size() ()
#4  0x000000000070cb5e in _initialize_maint_cmds() ()
#5  0x00000000008fad52 in initialize_all_files() ()
#6  0x0000000000899f0b in gdb_init(char*) ()
#7  0x0000000000703cb4 in captured_main_1(captured_main_args*) ()
#8  0x0000000000704913 in captured_main(void*) ()
#9  0x000000000070497e in gdb_main(captured_main_args*) ()
#10 0x00000000004022de in main ()
(gdb)

This is running on x86-64, built for x86-64. Os is Ubuntu 18.04 .


More information about the Gcc-bugs mailing list