From owner-cvs-src-old@FreeBSD.ORG Wed Jan 20 11:58:59 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DB69106566B for ; Wed, 20 Jan 2010 11:58:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0CE2A8FC08 for ; Wed, 20 Jan 2010 11:58:59 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KBwwgB037138 for ; Wed, 20 Jan 2010 11:58:58 GMT (envelope-from kib@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o0KBwwMf037137 for cvs-src-old@freebsd.org; Wed, 20 Jan 2010 11:58:58 GMT (envelope-from kib@repoman.freebsd.org) Message-Id: <201001201158.o0KBwwMf037137@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to kib@repoman.freebsd.org using -f From: Konstantin Belousov Date: Wed, 20 Jan 2010 11:58:04 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern kern_sig.c src/sys/sys signalvar.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 11:58:59 -0000 kib 2010-01-20 11:58:04 UTC FreeBSD src repository Modified files: sys/kern kern_sig.c sys/sys signalvar.h Log: SVN rev 202692 on 2010-01-20 11:58:04Z by kib When traced process is about to receive the signal, the process is stopped and debugger may modify or drop the signal. After the changes to keep process-targeted signals on the process sigqueue, another thread may note the old signal on the queue and act before the thread removes changed or dropped signal from the process queue. Since process is traced, it usually gets stopped. Or, if the same signal is delivered while process was stopped, the thread may erronously remove it, intending to remove the original signal. Remove the signal from the queue before notifying the debugger. Restore the siginfo to the head of sigqueue when signal is allowed to be delivered to the debugee, using newly introduced KSI_HEAD ksiginfo_t flag. This preserves required order of delivery. Always restore the unchanged signal on the curthread sigqueue, not to the process queue, since the thread is about to get it anyway, because sigmask cannot be changed. Handle failure of reinserting the siginfo into the queue by falling back to sq_kill method, calling sigqueue_add with NULL ksi. If debugger changed the signal to be delivered, use sigqueue_add() with NULL ksi instead of only setting sq_signals bit. Reported by: Gardner Bell Analyzed and first version of fix by: Tijl Coosemans PR: 142757 Reviewed by: davidxu MFC after: 2 weeks Revision Changes Path 1.385 +30 -15 src/sys/kern/kern_sig.c 1.86 +1 -0 src/sys/sys/signalvar.h