NetBSD Problem Report #54960

From  Thu Feb 13 15:17:57 2020
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id D80741A9213
	for <>; Thu, 13 Feb 2020 15:17:56 +0000 (UTC)
Message-Id: <>
Date: Thu, 13 Feb 2020 15:17:56 +0000 (UTC)
Subject: Concurrent signals to threads are reported multiple times via ptrace/SIGTRAP
X-Send-Pr-Version: www-1.0

>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&#322; Górny
>Release:        NetBSD 9.99.46
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

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.
I will commit a new ATF test for it shortly.


/usr/tests/lib/libc/sys/t_ptrace_wait thread_concurrent_signals_sig_ign

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.