From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 11 11:36:36 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 611AC106566B for ; Wed, 11 Jan 2012 11:36:36 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 1C4848FC17 for ; Wed, 11 Jan 2012 11:36:35 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RkwFI-0004k5-IG for freebsd-hackers@freebsd.org; Wed, 11 Jan 2012 12:21:32 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Jan 2012 12:21:32 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Jan 2012 12:21:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Wed, 11 Jan 2012 12:21:18 +0100 Lines: 19 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120110 Thunderbird/9.0 Subject: 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 11:36:36 -0000 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.