From owner-freebsd-current@FreeBSD.ORG Sun Nov 18 01:48:17 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC4FE16A41A; Sun, 18 Nov 2007 01:48:17 +0000 (UTC) (envelope-from arno@heho.snv.jussieu.fr) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.freebsd.org (Postfix) with ESMTP id 53C7C13C467; Sun, 18 Nov 2007 01:48:17 +0000 (UTC) (envelope-from arno@heho.snv.jussieu.fr) Received: from heho.snv.jussieu.fr (heho.snv.jussieu.fr [134.157.184.22]) by shiva.jussieu.fr (8.13.8/jtpda-5.4) with ESMTP id lAI1m7aH089203 ; Sun, 18 Nov 2007 02:48:07 +0100 (CET) X-Ids: 164 Received: from heho.snv.jussieu.fr (localhost [127.0.0.1]) by heho.snv.jussieu.fr (8.13.3/jtpda-5.2) with ESMTP id lAI1m6th003158 ; Sun, 18 Nov 2007 02:48:06 +0100 (MET) Received: (from arno@localhost) by heho.snv.jussieu.fr (8.13.3/8.13.1/Submit) id lAI1m678003155; Sun, 18 Nov 2007 02:48:06 +0100 (MET) (envelope-from arno) To: Nate Williams References: <18239.29090.668331.584942@caddis.yogotech.com> From: "Arno J. Klaassen" Date: 18 Nov 2007 02:48:06 +0100 In-Reply-To: <18239.29090.668331.584942@caddis.yogotech.com> Message-ID: Lines: 39 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (shiva.jussieu.fr [134.157.0.164]); Sun, 18 Nov 2007 02:48:07 +0100 (CET) X-Virus-Scanned: ClamAV 0.88.7/4832/Sun Nov 18 02:07:36 2007 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at shiva.jussieu.fr with ID 473F99D7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! Cc: java@freebsd.org, current@freebsd.org Subject: Re: mutex-bug in recent releng_[67]? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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, 18 Nov 2007 01:48:17 -0000 Nate Williams writes: > > I have serious problems with " Runtime.getRuntime ().exec ()" : either > > it hangs or gives a spinning mutex running at 99% cpu. > > This is a Java FAQ, Oops. Sorry for the noise .... > and is unrelated to FreeBSD. This program will hang > on any OS once you reach a certain threshold of unread output that the > OS will block the process until something 'reads' the data. > > What you need to do is once you execute the command, you need to have a > process that reads the output from the process. OK. I see (and most often do); but indeed I didn't in cases where I were just interested in the exit value of the command (and then afterwards read "proc.getErrorStream" to see what went wrong ... ). Thank you very much for your help. > [ .. ] > Here is my (trivial) implementation, use it as you see fit. > [ .. ] Thanx! I'l try. > Why it works on linux-sun-jdk15 is probably due to the fact that there > is more stack space allocated to processes, but if you modified the > process to generate more output ('ls -R /'), it will eventually fail. Yop, you're right. Best, Arno (a bit ashamed)