From owner-freebsd-current@FreeBSD.ORG Sun Sep 5 05:38:41 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 850BE16A4CE for ; Sun, 5 Sep 2004 05:38:41 +0000 (GMT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72A7443D1F for ; Sun, 5 Sep 2004 05:38:41 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id 6622172DD4; Sat, 4 Sep 2004 22:38:41 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id 6143772DCB; Sat, 4 Sep 2004 22:38:41 -0700 (PDT) Date: Sat, 4 Sep 2004 22:38:41 -0700 (PDT) From: Doug White To: Maxim Maximov In-Reply-To: <41337564.7090905@mcsi.pp.ru> Message-ID: <20040904222320.I39360@carver.gumbysoft.com> References: <412FA7E8.80BE87BC@freebsd.org> <20040829172000.F69068@carver.gumbysoft.com> <20040830105333.L85743@carver.gumbysoft.com> <41337564.7090905@mcsi.pp.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@freebsd.org Subject: [PATCH] poll() hang with X apps X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2004 05:38:41 -0000 Attaching to an earlier message here... rwatson and I may have a solution to the poll() hangs you have been experiencing. Try downloading and applying this patch: http://www.watson.org/~robert/freebsd/netperf/20040905-sopoll.diff This seems to stop the hangs on my test system (2x600MHz P3 with XFree 4.3). I'll test it with its partner, a RELENG_5 box with either Xorg or XFree86 4.4. Please test it and get back to us if its working for you. For those of you tuning in late: Maxim has been having problems with WindowMaker dockapps not starting up all the way, with the app hanging in a poll() call in the X library while trying to draw itself. I am able to reproduce the problem by starting up a xscreensaver hack (rubik is my favorite right now) and running a -j3 buildworld in the background. Within a couple of minutes rubik would stop moving; focussing the window would wake it back up again. ps axl would show it in 'select' and gdb found it in a poll() call in a XPixmap primitive. This patch changes the socket locking to lock both send and receive buffers while poll() is scanning the file descriptor for available data. We think that the prior locking was allowing one process to write data into the socket buffers after it had been scanned and the decision made that there was no data on the socket. Thus the process would be put to sleep with available data. Another write to the socket (focussing the app in the test case) would cause it to be woken up. Again, please test and let me or rwatson know if you have feedback. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org