wine and new JVM

Questions about Wine on Linux
Locked
chrisjonmcdonald
Newbie
Newbie
Posts: 4
Joined: Sat Oct 20, 2012 12:49 pm

wine and new JVM

Post by chrisjonmcdonald »

Hi.

Problem:
step1: Native windows EXE which loads a DLL mylib.dll with LoadLibraryA(), finds a function with GetProcAddress() and the calls the function.

step2: I have compiled mylib.dll using winegcc. mylib.dll.so makes a call into a separate unix shared library libmyjavalib.so which creates a JDK7 (1.7.0_40) Oracle JVM (not the fedora one), finds a class and then call it.

To be clear I have a windows exe on fedora 18 x86 running under wine trying to start a unix x86 java 1.7 JVM within a shared library.

When I use a unix executable to call into libmyjavalib.so, then it creates the JVM and executes the java class as expected proving that the shared object works fine.

But if I call into libmyjavalib.so from mylib.dll.so and from mywindows.exe via wine, then the JVM creation API fails with the error:

Code: Select all

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (threadLocalStorage.cpp:56), pid=3863, tid=3074471616
#  guarantee(get_thread() == thread) failed: must be the same thread, quickly
#
# JRE version:  (7.0_40-b43) (build )
# Java VM: Java HotSpot(TM) Client VM (24.0-b56 mixed mode, sharing linux-x86 )
Is this something to do with the fact that (I read from the doco that) wine implements TLS itself and does not use the pthreads implementation?

Any ideas for a solution?

chris
Locked