From owner-freebsd-stable@FreeBSD.ORG Mon May 9 16:59:12 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 0CDB8106564A for ; Mon, 9 May 2011 16:59:12 +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 9EA238FC0A for ; Mon, 9 May 2011 16:59:11 +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 p49GwwHj075713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 May 2011 19:58:58 +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 p49GwweB076272; Mon, 9 May 2011 19:58:58 +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 p49GwwSd076271; Mon, 9 May 2011 19:58:58 +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: Mon, 9 May 2011 19:58:58 +0300 From: Kostik Belousov To: Max Brazhnikov Message-ID: <20110509165858.GG48734@deviant.kiev.zoral.com.ua> References: <201105091240.57785.makc@issp.ac.ru> <20110509124104.GF48734@deviant.kiev.zoral.com.ua> <201105091939.47230.makc@issp.ac.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wthRHICJPcnPKmvQ" Content-Disposition: inline In-Reply-To: <201105091939.47230.makc@issp.ac.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=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20, 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: automoc4 processes lock again 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: Mon, 09 May 2011 16:59:12 -0000 --wthRHICJPcnPKmvQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 09, 2011 at 07:39:46PM +0400, Max Brazhnikov wrote: > On Mon, 9 May 2011 15:41:05 +0300, Kostik Belousov wrote: > > You did not supplied enough information. > > Which of the processes is parent, which is child ? > > Note that there are other threads in the pid 18636. What does they do ? >=20 > Here is backtraces from all threads http://people.freebsd.org/~makc/autom= oc4.bt > 63373 is a parent now, 63374 is a child. >=20 > There were no related changes in Qt4 and automoc4 sources, probably my up= date from 8.2-PRERELEASE to STABLE a week ago triggered the issue. It is obviously application bug, yes, I think my guess was right. Thou shalt not call non-async safe functions in thy child of multithreaded process. Since it is a race, I see it more curious that it did not manifested itself prevously. >=20 > > If you would allow me to make some guess, then I could assume that pid > > 18640 is the child. Note that the child is waiting for the pthread > > mutex locked which protects the stdio' FILE structure. Now, assume > > additionally that the parent had the FILE locked in one thread while > > another thread did the fork. Then, the child process would never be able > > to obtain the lock because the lock was acquired by the thread that > > exists no longer (in the child process, only the thread that called > > fork is duplicated). > >=20 > > In fact, I believe that you already reported a similar problem with > > malloc(3) some time ago. The root of the problem would be an undefined > > (and permitted by POSIX) behaviour of calling non-async signal safe > > functions in multithreaded process after fork. > >=20 > > For malloc(3), this can be argued to be a quality of the implementation > > issue, but there is no reason to specially handle random mutexes, even > > from libc. If the mutex was locked during the fork time, the protected > > data structure is arguably in the inconsistent state after the fork in > > the child. --wthRHICJPcnPKmvQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3IHVEACgkQC3+MBN1Mb4hkfwCdHFLpK//7Je2urHljp+3BmO73 +9gAnR9EuW0Ux0+JOnH761vtanXJvAf+ =7fg5 -----END PGP SIGNATURE----- --wthRHICJPcnPKmvQ--