From owner-freebsd-java@FreeBSD.ORG Mon Dec 3 20:17:11 2007 Return-Path: Delivered-To: java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEE1616A418 for ; Mon, 3 Dec 2007 20:17:11 +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 94AC813C461 for ; Mon, 3 Dec 2007 20:17:11 +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 lB3KH9U4074904 ; Mon, 3 Dec 2007 21:17:09 +0100 (CET) X-Ids: 166 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 lB3KH8MJ004843 ; Mon, 3 Dec 2007 21:17:08 +0100 (MET) Received: (from arno@localhost) by heho.snv.jussieu.fr (8.13.3/8.13.1/Submit) id lB3KH7Un004840; Mon, 3 Dec 2007 21:17:07 +0100 (MET) (envelope-from arno) To: nate@yogotech.com (Nate Williams) References: <200711301716.lAUHGEV1064334@repoman.freebsd.org> <47536361.8090203@freebsd.org> <18260.7752.293904.909660@caddis.yogotech.com> From: "Arno J. Klaassen" Date: 03 Dec 2007 21:17:07 +0100 In-Reply-To: <18260.7752.293904.909660@caddis.yogotech.com> Message-ID: Lines: 77 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.166]); Mon, 03 Dec 2007 21:17:09 +0100 (CET) X-Virus-Scanned: ClamAV 0.88.7/4984/Mon Dec 3 18:37:48 2007 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at shiva.jussieu.fr with ID 47546445.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! Cc: java@freebsd.org Subject: Re: cvs commit: src/lib/libkse/thread thr_kern.c X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2007 20:17:11 -0000 Hello, Nate Williams writes: > [ Java hang ] > > But the only easy way for me to reproduce it is just compiling jacorb > > (www.jacorb.org) on releng_6 (about ten days old) using libthr : after > > a while java hangs (can only be killed by -9) and 'top -H' shows three > > threads each taking 70-90% CPU-time. > > > > If I take a 'gcore' snapshot of it (dunno how trustful that is) > > it shows all threads in _thr_umtx_wait() (script-log attached). > > > > But : > > > > - only 2x2 smp-amd64 releng_6, 1x2 smp goes OK > > - only easy to produce when using optimized VM (I'll retry > > harder to produce a hang with java_g) > > - no prob on releng_7 (2x2 smp included) for this test > > > > This is thin, but all I have for now ... > > Obviously this isn't necessarily the case, but more times than not hangs > in the VM on multiple CPUs are almost always related to bugs in the Java > code. Rarely do developers write code that is multi-thread safe, and > just because code works fine on one platform doesn't mean that the code > is truly multi-thread safe. > > We had code that was originally developed under FreeBSD, but used code > from multiple vendors. We found problems in the code that were > triggered by our usage that needed to get fixed. > > Then, we we migrated the code to Windows, we found more bugs (both in > our code and other code). Finally, we found another set of bugs when we > ran the code under Solaris, and yet another class of bugs when we > switched thread models under Solaris (Solaris use to give you the option > of using different threading models for Java). Sure, I completely agree. That's why I ask my co-workers to produce me some simple test-code I can test under FreeBSD (the only platform we use in production) and test it as well under Linux/Windows and sometimes MacosX/Solaris (only maintained boxes available). > That may not be the case here, but just because something is in ports > doesn't necessarily mean it is bug free. It's certainly possible that > FreeBSD's SMP libraries may now expose incorrect assumptions the author > of the Java code never considered which will cause deadlocks using a > different threading model. Bon, I'm probably too old to write proper Java code, and old enough to understand the test code, the might be underlying OS-problems and accept the shame when the testing code was bluntly wrong. That said, I try to not too often spoil fbsd-developers with wrong PRs; but on the present matter my feeling that something is wrong with XxY-smp wrt forking has proven to be stronger than my retention to write possibly garbish. I might be wrong. I do have problems which [work|fail] on releng[6|7] using lib[thr|kse] (and never the same combination ...) The Test_cmd.java my coworkers produced me, does consistently fail on stock releng_7/libkse. The hang on releng_6 with libthr is with plain stock 'javac' *and** my 'own'(tm) java-progs exhibit the same behaviour. I doubt no-one else ever tried to javac code on XxY-smp on something else than FreeBSD. Once again, I might be wrong .. Best, Arno