From owner-freebsd-stable@FreeBSD.ORG Wed Aug 24 19:50:48 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A28D1065670 for ; Wed, 24 Aug 2011 19:50:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A98B18FC14 for ; Wed, 24 Aug 2011 19:50:47 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p7OJoZq7075404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Aug 2011 22:50:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p7OJoZLQ080304; Wed, 24 Aug 2011 22:50:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p7OJoZHW080303; Wed, 24 Aug 2011 22:50:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 24 Aug 2011 22:50:35 +0300 From: Kostik Belousov To: Slawa Olhovchenkov Message-ID: <20110824195035.GA17489@deviant.kiev.zoral.com.ua> References: <20110824181907.GA48394@zxy.spb.ru> <20110824190703.GY17489@deviant.kiev.zoral.com.ua> <20110824192446.GB48394@zxy.spb.ru> <20110824193202.GZ17489@deviant.kiev.zoral.com.ua> <20110824194229.GC48394@zxy.spb.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WA7H3kVYsfCLkbZb" Content-Disposition: inline In-Reply-To: <20110824194229.GC48394@zxy.spb.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-stable@freebsd.org Subject: Re: sigwait return 4 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2011 19:50:48 -0000 --WA7H3kVYsfCLkbZb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 24, 2011 at 11:42:29PM +0400, Slawa Olhovchenkov wrote: > On Wed, Aug 24, 2011 at 10:32:02PM +0300, Kostik Belousov wrote: >=20 > > > > What should the system do for a delivered signal not present in the= set ? > > > > I guess this is the case of your ktrace. > > > >=20 > > > > Looking at the SUSv4, I see no mention of the situation, but in Ora= cle > > > > SunOS 5.10 man page for sigwait(2), it is said explicitely > > > > EINTR The wait was interrupted by an unblocked, caught signal. > > >=20 > > > I don't think you right in this case. > > > This is kas-milter and in this thread (this is multi-thread > > > application) kas-milter wait for USR2 for reload config. > > >=20 > > > System return from sigwait only on USR2, but not each return w/ > > > non-zero return code. > > >=20 > > > On freebsd7 this application don't complain about sigwait's return va= lue. > >=20 > > Could it be that some other thread has the signal unblocked ? > > (You can verify this with procstat -j). > >=20 > > Can you write the self-contained test case that demonstrates the behavi= our ? >=20 > This is closed-source software. How is this statement related to the creation of the standalone test case ? > # procstat -j > PID TID COMM SIG FLAGS > 1395 100199 kas-milter USR2 -- > 1395 100232 kas-milter USR2 -- Both threads have the signal not blocked. This is not definitive, since signal must be blocked during the call to sigwait(2). Note that the SUSv4 says that "The signals defined by set shall have been blocked at the time of the call to sigwait(); otherwise, the behavior is undefined." --WA7H3kVYsfCLkbZb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk5VVgoACgkQC3+MBN1Mb4gSqgCg1EVAlsC1UQ7Suy7UIvitzv7G rloAoJesCMp4Fi6zmv2QcMhc60WqLtfm =cFkN -----END PGP SIGNATURE----- --WA7H3kVYsfCLkbZb--