From owner-freebsd-python@FreeBSD.ORG Fri Feb 26 11:23:39 2010 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35B4E106566B; Fri, 26 Feb 2010 11:23:39 +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 92AF88FC1C; Fri, 26 Feb 2010 11:23:38 +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 o1QBNbC0064844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Feb 2010 13:23:37 +0200 (EET) (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 o1QBNaw0056146; Fri, 26 Feb 2010 13:23:36 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o1QBNaJk056145; Fri, 26 Feb 2010 13:23:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 26 Feb 2010 13:23:36 +0200 From: Kostik Belousov To: Peter Steele Message-ID: <20100226112336.GF2489@deviant.kiev.zoral.com.ua> References: <7B9397B189EB6E46A5EE7B4C8A4BB7CB39E95389@MBX03.exg5.exghost.com> <20100224190035.GA5026@wep4035.physik.uni-wuerzburg.de> <7B9397B189EB6E46A5EE7B4C8A4BB7CB39E95522@MBX03.exg5.exghost.com> <20100225125838.13cd6c0e.ray@dlink.ua> <7B9397B189EB6E46A5EE7B4C8A4BB7CB39E95689@MBX03.exg5.exghost.com> <20100225151828.GA2489@deviant.kiev.zoral.com.ua> <7B9397B189EB6E46A5EE7B4C8A4BB7CB39E95703@MBX03.exg5.exghost.com> <20100225164514.GB2489@deviant.kiev.zoral.com.ua> <7B9397B189EB6E46A5EE7B4C8A4BB7CB39E95765@MBX03.exg5.exghost.com> <7B9397B189EB6E46A5EE7B4C8A4BB7CB39E95991@MBX03.exg5.exghost.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XIiC+We3v3zHqZ6Z" Content-Disposition: inline In-Reply-To: <7B9397B189EB6E46A5EE7B4C8A4BB7CB39E95991@MBX03.exg5.exghost.com> 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 Cc: "freebsd-hackers@freebsd.org" , freebsd-python@freebsd.org Subject: Re: ntpd hangs under FBSD 8 X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 11:23:39 -0000 --XIiC+We3v3zHqZ6Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 25, 2010 at 04:26:22PM -0600, Peter Steele wrote: > > We'll likely go with this solution instead of downgrading Python and th= e related libraries. >=20 > In fact I came up with another solution. I realized that since the proble= m was related to the process signal mask, instead of called ntpd directly, = wrap it up in a C app that resets the signal mask to something that works. = I have the following code: >=20 > sigset_t set, oset; > sigemptyset(&set); > pthread_sigmask(SIG_SETMASK, &set, &oset); > system("/usr/sbin/ntpd -g -q"); > pthread_sigmask(SIG_SETMASK, &oset, NULL); >=20 > I wrapped this up into a standalone app and call this from Python instead= of calling ntpd directly. This solved the problem--no more hang. Thanks ve= ry much to Kostik Belousov for his "wild guess" that this was related to th= e process signal mask. His guess was dead on. So this is arguably a Python bug. Did you contacted anybody who cares about the Python ? --XIiC+We3v3zHqZ6Z Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkuHrzgACgkQC3+MBN1Mb4jFJwCcDNnuSfbIUExMzREKJOkYiCXz jZsAn2H6LQChB1guq5NaUoZkKzeBsfiO =v7X+ -----END PGP SIGNATURE----- --XIiC+We3v3zHqZ6Z--