From owner-freebsd-java Sat Jun 10 15: 1:25 2000 Delivered-To: freebsd-java@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 83E4C37C825 for ; Sat, 10 Jun 2000 15:01:20 -0700 (PDT) (envelope-from nate@yogotech.com) Received: from nomad.yogotech.com (nomad.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id QAA08576; Sat, 10 Jun 2000 16:01:17 -0600 (MDT) (envelope-from nate@nomad.yogotech.com) Received: (from nate@localhost) by nomad.yogotech.com (8.8.8/8.8.8) id PAA03393; Sat, 10 Jun 2000 15:01:16 -0700 (PDT) (envelope-from nate) Date: Sat, 10 Jun 2000 15:01:16 -0700 (PDT) Message-Id: <200006102201.PAA03393@nomad.yogotech.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: pranje@yahoo.com Cc: freebsd-java@FreeBSD.ORG Subject: Re: Subject: Segmentation violation when invoking JNI call to C from Java with Pthreads In-Reply-To: <3941096D.A8AF35CA@yahoo.com> References: <3941096D.A8AF35CA@yahoo.com> X-Mailer: VM 6.34 under 19.16 "Lille" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I am using FreeBsd 3.4 with jdk 1.1.8 green threads on i386 . I > am getting Segmentation violation from JNI call as reported in PR > 12286. This is probably due to cockpit error. > When I link a static library which calls pthread routines into a > shared object file with gcc -shared -pthread, and then run the > java compiled program which calls it through JNI with JDK 1.1.8 > (green threads), (I had to add -lc_r to the link flags in order > to get pthread_mutex_lock() to be found when linking the .so file), If you've done this, then the program won't work. pthread_mutex_lock and friends aren't compatible with the threading using the JDK1.1 VM. The bug is almost certainly in your JNI code that is doing something 'wrong', although it's not necessarily your fault, since doing JNI isn't documented, and is (as expected) different for each platform, FreeBSD being no exception. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message