public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/102077] New: null-pointer dereference in std::thread::detach()
@ 2021-08-26 12:22 florin.iucha at amd dot com
  2021-08-26 12:42 ` [Bug libstdc++/102077] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: florin.iucha at amd dot com @ 2021-08-26 12:22 UTC (permalink / raw)
  To: gcc-bugs

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 .

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/102077] null-pointer dereference in std::thread::detach()
  2021-08-26 12:22 [Bug libstdc++/102077] New: null-pointer dereference in std::thread::detach() florin.iucha at amd dot com
@ 2021-08-26 12:42 ` redi at gcc dot gnu.org
  2021-08-26 12:43 ` redi at gcc dot gnu.org
  2021-08-26 12:47 ` florin.iucha at amd dot com
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-26 12:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
std::thread::detach doesn't dereference any pointers except 'this' and if that
is null or invalid, the problem is not in libstdc++. This looks like a GDB bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/102077] null-pointer dereference in std::thread::detach()
  2021-08-26 12:22 [Bug libstdc++/102077] New: null-pointer dereference in std::thread::detach() florin.iucha at amd dot com
  2021-08-26 12:42 ` [Bug libstdc++/102077] " redi at gcc dot gnu.org
@ 2021-08-26 12:43 ` redi at gcc dot gnu.org
  2021-08-26 12:47 ` florin.iucha at amd dot com
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-26 12:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
There's no evidence of a null pointer in that backtrace anyway.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/102077] null-pointer dereference in std::thread::detach()
  2021-08-26 12:22 [Bug libstdc++/102077] New: null-pointer dereference in std::thread::detach() florin.iucha at amd dot com
  2021-08-26 12:42 ` [Bug libstdc++/102077] " redi at gcc dot gnu.org
  2021-08-26 12:43 ` redi at gcc dot gnu.org
@ 2021-08-26 12:47 ` florin.iucha at amd dot com
  2 siblings, 0 replies; 4+ messages in thread
From: florin.iucha at amd dot com @ 2021-08-26 12:47 UTC (permalink / raw)
  To: gcc-bugs

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

Florin Iucha <florin.iucha at amd dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Florin Iucha <florin.iucha at amd dot com> ---
Sorry for the noise, I shall move this to GDB bugzilla.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-26 12:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 12:22 [Bug libstdc++/102077] New: null-pointer dereference in std::thread::detach() florin.iucha at amd dot com
2021-08-26 12:42 ` [Bug libstdc++/102077] " redi at gcc dot gnu.org
2021-08-26 12:43 ` redi at gcc dot gnu.org
2021-08-26 12:47 ` florin.iucha at amd dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).