On Jan 31, 2012, at 10:31 PM, Sam.Park wrote:
>
>
> Hi .
>
> I am trying to port JNA to HP-UX 11i IA64 platform at this time .
>
> I couldn't get success to make JNA library 32bit. but i can get 64bit
> JNA library with 98.37%
>
> success rate on unit test. all Failure of unit test come from
> CallbacksTest I have 4 failures below :
Since the other callback tests do not fail, it would appear that the native test code (libtest.so) is not able to properly spawn a new thread. It assumes the pthreads is available. There may be some extra stuff required on HP-UX to init/spawn new threads, or maybe it has different defaults than other platforms.
>
> CallbacksTest testCallbackThreadDefaults Failure Timed out waiting for
> callback, invoked 0 times so far
> CallbacksTest testCustomizeCallbackThread Failure Timed out waiting
> for callback, invoked 0 times so far
> CallbacksTest testCallbackThreadPersistence Failure Timed out waiting
> for callback, invoked 0 times so far
> CallbacksTest testDynamicCallbackThreadPersistence Failure Timed out
> waiting for callback, invoked 0 times so far
>
> And 3 Error . this errors make jvm crash.
>
> CallbacksTest testCallNativeMappedCallback
> LastErrorTest testThrowLastError
Please run each of these tests standalone and post the crash log.
e.g. java -Djna.library.path=build/native -cp build/test-classes:build/classes:lib/junit.jar com.sun.jna.CallbacksTest
> LibraryLoadTest testLoadLibraryWithUnicodeName Error Unable to load
> library 'флсву': Mmap failed for the library</var/tmp/lib?????.so> :
> Permission denied.
Are you sure this one crashed? it looks like there's a disagreement between Java and the system about how to map UTF16 filenames.
On Feb 2, 2012, at 4:08 AM, Sam.Park wrote:
> Hi T.
>
> I tried to set the gcc -mt/-pthread but it didn't work as expected.
>
> When i tested callback tests It emited this error : JNA: Can't attach
> native thread to VM for callback: -1;
>
> I think it's coming from callback.c
>
> else {
> attach_status = (*jvm)->AttachCurrentThread(jvm, (void *)&env,
> &args);
> }
> if (attach_status != JNI_OK) {
> fprintf(stderr, "JNA: Can't attach native thread to VM for
> callback: %d\n", attach_status);
> return;
> }
Perhaps the test thread init/spawn needs to have different/additional options? see if there are any issues specific to hp-ux with respect to attaching the VM to an existing native thread. The other callback tests work because the thread is already attached (the initial call starts in java).