From owner-freebsd-emulation@FreeBSD.ORG Sat Jan 22 14:04:56 2011 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CF58106564A; Sat, 22 Jan 2011 14:04:56 +0000 (UTC) (envelope-from andrew@dreamindustries.ru) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id A89248FC0C; Sat, 22 Jan 2011 14:04:55 +0000 (UTC) Received: by eyf6 with SMTP id 6so1335319eyf.13 for ; Sat, 22 Jan 2011 06:04:54 -0800 (PST) Received: by 10.14.48.6 with SMTP id u6mr2149631eeb.7.1295703440116; Sat, 22 Jan 2011 05:37:20 -0800 (PST) Received: from localhost ([82.179.192.158]) by mx.google.com with ESMTPS id t12sm2050660eeh.3.2011.01.22.05.37.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 22 Jan 2011 05:37:18 -0800 (PST) Sender: Andrew Pantyukhin Date: Sat, 22 Jan 2011 16:37:14 +0300 From: Andrew Pantyukhin To: Alexander Best Message-ID: <20110122133714.GA1469@vocha.office.zvq.me> References: <269E4CF4-7C22-49CC-A263-D3F3E48F5E18@FreeBSD.org> <20110122091448.GA60450@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110122091448.GA60450@freebsd.org> X-OS: FreeBSD 8.1-PRERELEASE amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: emulation@freebsd.org, zvqops , kib@FreeBSD.org, dchagin@FreeBSD.org Subject: Re: linux futex deadlock X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 14:04:56 -0000 On Sat, Jan 22, 2011 at 09:14:48AM +0000, Alexander Best wrote: > On Thu Jan 20 11, Andrew Pantyukhin wrote: > > I've stumbled upon an easily reproducible problem, seemingly > > somewhere around the linux_futex.c code. > > i haven't tried reproducing your example case, but i've also experienced the > same problem with other applications, such as adobe's flash. right now i have > about 10 instances of npviewer.bin stuck in the futex state. > > apparently this issue has been known for several years now. unfortunetaly > nobody is able to do something about it. rdivacky@ is pretty much the only > person working on the linux code, but he doesn't have time atm. > > i think the netbsd folks have been dealing with linux emulation, too. you might > want to go through their commit log and see, if they fixed any futex related > problems. the fixes (if they exist) should be portable to freebsd without any > major adjustments. Okay, it looks like there's a fix for this in NetBSD: http://mail-index.netbsd.org/tech-kern/2008/06/06/msg001587.html http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/compat/linux/common/linux_futex.c.diff?r1=1.14&r2=1.15&only_with_tag=MAIN However, Dmitry Chagin (cc'ed with kib, who reviewed the patch) has since reworked the futexes into something more fine-grained: http://svn.freebsd.org/viewvc/base/head/sys/compat/linux/linux_futex.c?r1=191269&r2=191719 So porting the fix, even if it's correct, is not perfectly straightforward. Dmitry, do you think you might have time to look at it? Please check this thread for an easy way to reproduce the problem.