From owner-freebsd-java@FreeBSD.ORG Tue Dec 6 23:48:48 2005 Return-Path: X-Original-To: freebsd-java@FreeBSD.org Delivered-To: freebsd-java@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F39E316A41F; Tue, 6 Dec 2005 23:48:47 +0000 (GMT) (envelope-from freebsd@spatula.net) Received: from turing.morons.org (morons.org [64.147.161.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id E715643D49; Tue, 6 Dec 2005 23:48:33 +0000 (GMT) (envelope-from freebsd@spatula.net) Received: from localhost (localhost.morons.org [127.0.0.1]) by turing.morons.org (Postfix) with ESMTP id 7D86117044; Tue, 6 Dec 2005 15:48:32 -0800 (PST) Received: from turing.morons.org ([127.0.0.1]) by localhost (turing.morons.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23238-03; Tue, 6 Dec 2005 15:48:31 -0800 (PST) Received: by turing.morons.org (Postfix, from userid 1001) id 476941702F; Tue, 6 Dec 2005 15:48:31 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.morons.org (Postfix) with ESMTP id 44D111702D; Tue, 6 Dec 2005 15:48:31 -0800 (PST) Date: Tue, 6 Dec 2005 15:48:31 -0800 (PST) From: freebsd@spatula.net X-X-Sender: spatula@turing To: bug-followup@FreeBSD.org In-Reply-To: <20051206153047.J2752@turing> Message-ID: <20051206154223.C2752@turing> References: <200512062320.jB6NK9RS075945@freefall.freebsd.org> <20051206153047.J2752@turing> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: amavisd-new at morons.org Cc: freebsd-java@FreeBSD.org Subject: Re: threads/84778: libpthread busy loop/hang with Java when handling signals and Runtime.exec 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: Tue, 06 Dec 2005 23:48:48 -0000 I have found the problem, at long last. Resin uses a custom JNI library for acceleration of some features. In their compilation process, they specify -lc_r for the threading library used in their JNI library. This in turn seems to be the cause of unexpected and erratic behaviour when running Java with libpthread, and probably explains why the problems completely disappear when mapping Java to use libc_r. Modifying the makefile to link the JNI library to libpthread completely alleviates the signal handling problems. The process can be suspended and resumed from the keyboard ad-nauseam. Removing the JNI library from the picture entirely has the same effect (Resin will use the native Java code if the JNI library cannot be loaded.) I will follow up with the Resin folks and submit a patch to detect the thread library that is in use and use that one when compiling the JNI library. Please close this bug. Nick -- "The aptly-named morons.org is an obscenity-laced screed..." -- Robert P. Lockwood, Catholic League director of research Nick Johnson, version 2.1 http://web.morons.org/