From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 25 22:26:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7367106564A for ; Thu, 25 Feb 2010 22:26:26 +0000 (UTC) (envelope-from psteele@maxiscale.com) Received: from server505.appriver.com (server505b.appriver.com [98.129.35.5]) by mx1.freebsd.org (Postfix) with ESMTP id 789F98FC16 for ; Thu, 25 Feb 2010 22:26:25 +0000 (UTC) X-Policy: GLOBAL - maxiscale.com X-Primary: psteele@maxiscale.com X-Note: This Email was scanned by AppRiver SecureTide X-ALLOW: psteele@maxiscale.com ALLOWED X-Virus-Scan: V- X-Note: Spam Tests Failed: X-Country-Path: UNITED STATES->UNITED STATES->UNITED STATES X-Note-Sending-IP: 98.129.23.14 X-Note-Reverse-DNS: ht01.exg5.exghost.com X-Note-WHTLIST: psteele@maxiscale.com X-Note: User Rule Hits: X-Note: Global Rule Hits: G173 G174 G175 G176 G180 G181 G192 G279 X-Note: Encrypt Rule Hits: X-Note: Mail Class: ALLOWEDSENDER X-Note: Headers Injected Received: from [98.129.23.14] (HELO ht01.exg5.exghost.com) by server505.appriver.com (CommuniGate Pro SMTP 5.3.2) with ESMTPS id 25725728 for freebsd-hackers@freebsd.org; Thu, 25 Feb 2010 16:26:23 -0600 Received: from mbx03.exg5.exghost.com ([169.254.1.200]) by ht01.exg5.exghost.com ([98.129.23.14]) with mapi; Thu, 25 Feb 2010 16:26:23 -0600 From: Peter Steele To: "freebsd-hackers@freebsd.org" Date: Thu, 25 Feb 2010 16:26:22 -0600 Thread-Topic: ntpd hangs under FBSD 8 Thread-Index: Acq2OfW9mRE3bd/fQzSGLzlKnSS2OAAAKTSQAAuB6ZA= Message-ID: <7B9397B189EB6E46A5EE7B4C8A4BB7CB39E95991@MBX03.exg5.exghost.com> References: <7B9397B189EB6E46A5EE7B4C8A4BB7CB385D60B7@MBX03.exg5.exghost.com> <7B9397B189EB6E46A5EE7B4C8A4BB7CB385D60DD@MBX03.exg5.exghost.com> <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> In-Reply-To: <7B9397B189EB6E46A5EE7B4C8A4BB7CB39E95765@MBX03.exg5.exghost.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: ntpd hangs under FBSD 8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 22:26:27 -0000 > We'll likely go with this solution instead of downgrading Python and the = related libraries. In fact I came up with another solution. I realized that since the problem = was related to the process signal mask, instead of called ntpd directly, wr= ap it up in a C app that resets the signal mask to something that works. I = have the following code: sigset_t set, oset; sigemptyset(&set); pthread_sigmask(SIG_SETMASK, &set, &oset); system("/usr/sbin/ntpd -g -q"); pthread_sigmask(SIG_SETMASK, &oset, NULL); I wrapped this up into a standalone app and call this from Python instead o= f calling ntpd directly. This solved the problem--no more hang. Thanks very= much to Kostik Belousov for his "wild guess" that this was related to the = process signal mask. His guess was dead on.