From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 25 13:10:25 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 710A116A400 for ; Thu, 25 Jan 2007 13:10:25 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 5FA4C13C457 for ; Thu, 25 Jan 2007 13:10:25 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0PDAO5J062872 for ; Thu, 25 Jan 2007 13:10:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0PDAOaa062865; Thu, 25 Jan 2007 13:10:24 GMT (envelope-from gnats) Date: Thu, 25 Jan 2007 13:10:24 GMT Message-Id: <200701251310.l0PDAOaa062865@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "Joerg Lehners" Cc: Subject: kern/107109: [nfs] Netbeans/Eclipse/Java provoke deadlocks when used with NFS X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Joerg Lehners List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jan 2007 13:10:25 -0000 The following reply was made to PR kern/107109; it has been noted by GNATS. From: "Joerg Lehners" To: bug-followup@FreeBSD.org Cc: Subject: kern/107109: [nfs] Netbeans/Eclipse/Java provoke deadlocks when used with NFS Date: Thu, 25 Jan 2007 13:57:40 +0100 (MET) I have experimented further and narrowed down the problem somewhat. In the meantime I upgraded to FreeBSD 6.2-STABLE as of 8. Jan 2007 and Java 1.5.0 p4 (patchkit 4 from a few days ago). I got someone to wrote a short Java program for me (thanks to Felix Kronlage!) that is able to provoke the problem more easily than with Netbeans and 'do this and than that and ...'. With the program running the Java process locks up after a few seconds of running it, sometime it takes longer. As I suspected initially it is the intermixed fork()ing and stat()ing of NFS files/directories in different threads and some other magic. I tried the Java program with Java 1.5.0 for FreeBSD (patchkit 4), which locks up after some seconds. With Java 1.5.0 for Linux the program crashes after some seconds with some HotSpot error (which is not uncommon for Java 1.5.0 for Linux on FreeBSD 6). With Java 1.6.0 for Linux the program ran for many minutes without any crashes or lockups jet. I also tried Java 1.4.2 for FreeBSD (built from Java SCSL source code with patchkit 8): no crashes or lockups even after many minutes of running. So there seems to be some magic in Java 1.5.0 for FreeBSD (built from Java SCSL source code with at least patchkit p3 and p4) that provoke some deadlock in the kernel when threads do execute fork() and stat() on NFS files/directories intermixed. In the program NFSStressTest.java the variable 'directories' must list some directories that are accessible via NFS. --- NFSStressTest.java begins here --- import java.io.*; public class NFSStressTest { public static void main(String[] args) { int intervall= 1000; boolean debug= true; String[] directories = { "/user/admin/joerg/Src/%Archiv", "/user/admin/joerg/Src/%DONE", "/user/admin/joerg/Bin" }; String[] commands = { "/bin/echo 'hallo'", "/bin/ls /tmp" , "/sbin/md5 /bin/ls" }; IOMaker[] ioMakers= new IOMaker[directories.length]; CMDMaker[] cmdMakers= new CMDMaker[commands.length]; for(int i=0;i