From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 11 13:06:35 2012 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 568F71065675; Wed, 11 Jan 2012 13:06:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2E5B48FC0A; Wed, 11 Jan 2012 13:06:35 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D8B4B46B52; Wed, 11 Jan 2012 08:06:34 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 42C60B977; Wed, 11 Jan 2012 08:06:34 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 11 Jan 2012 08:06:30 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201110806.30620.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 11 Jan 2012 08:06:34 -0500 (EST) Cc: Ivan Voras , davidxu@freebsd.org Subject: Re: sem(4) lockup in python? 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: Wed, 11 Jan 2012 13:06:35 -0000 On Wednesday, January 11, 2012 6:21:18 am Ivan Voras wrote: > The lang/python27 port can optionally be built with the support for > POSIX semaphores - i.e. sem(4). This option is labeled as experimental > so it may be that the code is simply incorrect. I've tried it and get > frequent hangs with the python process in the "usem" state. The kernel > stack is as follows and looks reasonable: > > # procstat -kk 19008 > PID TID COMM TDNAME KSTACK > > 19008 101605 python - mi_switch+0x174 > sleepq_catch_signals+0x2f4 sleepq_wait_sig+0x16 _sleep+0x269 > do_sem_wait+0xa19 __umtx_op_sem_wait+0x51 amd64_syscall+0x450 > Xfast_syscall+0xf7 > > The process doesn't react to SIGINT or SIGTERM but fortunately reacts to > SIGKILL. > > This could be an error in Python code but OTOH this code is not > FreeBSD-specific so it's unlikely. This is using the new umtx-based semaphore code that David Xu wrote. He is probably the best person to ask (cc'd). -- John Baldwin