public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27899] New: [GNU/Linux, sparc64] GDB crashes when debugging multithreaded programs
@ 2021-05-22 17:22 koachan+sourceware at protonmail dot com
  2021-05-22 17:23 ` [Bug gdb/27899] " koachan+sourceware at protonmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: koachan+sourceware at protonmail dot com @ 2021-05-22 17:22 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27899

            Bug ID: 27899
           Summary: [GNU/Linux, sparc64] GDB crashes when debugging
                    multithreaded programs
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: koachan+sourceware at protonmail dot com
  Target Milestone: ---

Created attachment 13465
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13465&action=edit
Test code to trigger the behavior

On sparc64, GDB 10.2 crashes with the following message when debugging
multithreaded programs:
thread.c:1309: internal-error: void switch_to_thread(thread_info*): Assertion
`thr != NULL' failed.

Steps to reproduce:

- Compile the attached source with `gcc -g3 -o threaded-hello threaded-hello.c
-lpthread -static` on a sparc64 machine.
- Load the file

Expected result (from GDB 9.2 and 10.1):

$ gdb threaded-hello
[... snipped ...]
Reading symbols from threaded-hello...
(gdb) break thread
Breakpoint 1 at 0x100984: file threaded-hello.c, line 18.
(gdb) run
Starting program: /home/k/threaded-hello 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Hello World from the main thread!
[New Thread 0xffff800100805870 (LWP 46440)]
[Switching to Thread 0xffff800100805870 (LWP 46440)]

Thread 2 "threaded-hello" hit Breakpoint 1, thread (
    vargp=<error reading variable: Cannot access memory at address 0x87f>) at
threaded-hello.c:18
18          printf("Hello World from a thread created by the main thread!\n");
(gdb)

Actual result (from GDB 10.2):

$ gdb threaded-hello
[... snipped ...]
Reading symbols from threaded-hello...
(gdb) break thread
Breakpoint 1 at 0x100984: file threaded-hello.c, line 18.
(gdb) run
Starting program: /home/k/threaded-hello 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Hello World from the main thread!
thread.c:1309: internal-error: void switch_to_thread(thread_info*): Assertion
`thr != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) 

I've attached the source and the compiled binary (built with GCC 9.3.0).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-06-07 15:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22 17:22 [Bug gdb/27899] New: [GNU/Linux, sparc64] GDB crashes when debugging multithreaded programs koachan+sourceware at protonmail dot com
2021-05-22 17:23 ` [Bug gdb/27899] " koachan+sourceware at protonmail dot com
2021-05-23 11:54 ` simark at simark dot ca
2021-05-23 11:54 ` simark at simark dot ca
2021-05-23 13:09 ` simark at simark dot ca
2021-05-23 15:42 ` koachan+sourceware at protonmail dot com
2021-05-25 14:10 ` koachan+sourceware at protonmail dot com
2021-05-27  2:34 ` simark at simark dot ca
2021-05-31  1:17 ` simark at simark dot ca
2021-06-07 15:03 ` cvs-commit at gcc dot gnu.org
2021-06-07 15:04 ` simark at simark dot ca

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).