tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Gdb misdetects threads (SA_ONSTACK?)



On Tue, Jan 03, 2023 at 15:20:22 +0300, Valery Ushakov wrote:

> Date: Tue, 3 Jan 2023 15:20:22 +0300
> From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
> Subject: Gdb misdetects threads (SA_ONSTACK?)
> To: tech-toolchain%netbsd.org@localhost
> Mail-Followup-To: tech-toolchain%netbsd.org@localhost
> 
> On a ~month old current, GNU gdb (GDB) 11.0.50.20200914-git seems to
> get very confused.  My uninformed guess is it's alternative stacks for
> signal handlers that confuse it and make it think a program is
> threaded when it's not.  E.g.
> 
> $ gdb -q --args ./Self ...
> Reading symbols from ./Self...
> (No debugging symbols found in ./Self)
> (gdb) r
> ...
> ^C
> Thread 2 received signal SIGINT, Interrupt.
> [Switching to process 1470]
> 0x0818be0e in zone::flushZombies() ()
> (gdb) info threads
>   Id   Target Id                   Frame 
>   1    LWP 1470 of process 1470 "" 0x0818be0e in zone::flushZombies() ()
> * 2    process 1470                0x0818be0e in zone::flushZombies() ()
> (gdb) display/i $eip
> 1: x/i $eip
> => 0x818be0e <_ZN4zone12flushZombiesEv+86>:	mov    %eax,-0x20(%ebp)
> (gdb) si
> [New process 1470]
> /home/uwe/work/netbsd/ro/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/infrun.c:5683: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Quit this debugging session? (y or n) 

PS: Sorry, managed to paste this bit twice in the original mail
(actually, thrice; deleted the third copy and thought it was the
second).

-uwe


Home | Main Index | Thread Index | Old Index