Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jun 2000 15:01:16 -0700 (PDT)
From:      Nate Williams <nate@yogotech.com>
To:        pranje@yahoo.com
Cc:        freebsd-java@FreeBSD.ORG
Subject:   Re: Subject: Segmentation violation when invoking JNI call to C from Java  with Pthreads 
Message-ID:  <200006102201.PAA03393@nomad.yogotech.com>
In-Reply-To: <3941096D.A8AF35CA@yahoo.com>
References:  <3941096D.A8AF35CA@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>       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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006102201.PAA03393>