NetBSD-Bugs archive

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

kern/54960: Concurrent signals to threads are reported multiple times via ptrace/SIGTRAP



>Number:         54960
>Category:       kern
>Synopsis:       Concurrent signals to threads are reported multiple times via ptrace/SIGTRAP
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 13 15:20:00 +0000 2020
>Originator:     Michał Górny
>Release:        NetBSD 9.99.46
>Organization:
>Environment:
System: NetBSD pomiocikbsd.local 9.99.46 NetBSD 9.99.46 (GENERIC) #1: Thu Feb 13 13:13:04 CET 2020 root@pomiocikbsd.local:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64

>Description:
A multithreaded program is being debugged via ptrace().  The individual threads receive (different) signals concurrently (via pthread_kill()).  The debugger receives information about those signals via wait() + PT_GET_SIGINFO, then resumes the program via PT_CONTINUE.

When data=0 for PT_CONTINUE (i.e. the signal should be discarded), all signals are reported correctly.  However, when data!=0 (i.e. the signal is delivered to the program) and the signal handler is either set to SIG_IGN or to a real handler function, many of the signals are reported repeatedly to the debugger (some as many as 12 times, but all are reported at least once).

If I were to guess, I'd suspect that the repeat code is at fault.
>How-To-Repeat:
I will commit a new ATF test for it shortly.

Then:

/usr/tests/lib/libc/sys/t_ptrace_wait thread_concurrent_signals_sig_ign
>Fix:



Home | Main Index | Thread Index | Old Index