From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 082DC3847839; Sat, 22 May 2021 17:22:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 082DC3847839 From: "koachan+sourceware at protonmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/27899] New: [GNU/Linux, sparc64] GDB crashes when debugging multithreaded programs Date: Sat, 22 May 2021 17:22:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: koachan+sourceware at protonmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2021 17:22:07 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27899 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=3D13465&action=3Ded= it 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*): Asserti= on `thr !=3D NULL' failed. Steps to reproduce: - Compile the attached source with `gcc -g3 -o threaded-hello threaded-hell= o.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=20 [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=3D= ) 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=20 [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*): Asserti= on `thr !=3D NULL' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n)=20 I've attached the source and the compiled binary (built with GCC 9.3.0). --=20 You are receiving this mail because: You are on the CC list for the bug.=