Problem with Windows Java/Mathemaica under wine

Questions about Wine on Linux
Locked
David Bailey
Level 2
Level 2
Posts: 14
Joined: Thu Jun 02, 2011 11:11 am

Problem with Windows Java/Mathemaica under wine

Post by David Bailey »

I would like to run the Windows version Mathematica 7.0 on 64-bit Fedora 17, using wine.This may seem a little strange, because Wolfram Research do produce a linux version of this software. However, I have Windows users for clients, so to use Linux,
I really would like to run the same software as they will run.

Anyway, I first experimented under Ubuntu using wine 1.3.35, and the installation program worked perfectly, and the software worked well as well.
I was pleasantly surprised by this, because Mathematica comes with its own copy of Java, which it uses as a separate process, btu the Mathematica Java
includes some native methods, so clearly at 1.3.35, the whole Windows Java execution and JIT engine must have worked.

After moving to Fedora 17, I find I am on wine 1.5.3, and now the installer works well, but Mathematica seems to break as soon as it accesses java, with the following information:


# An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (sharedRuntime.cpp:552), pid=66, tid=86
# Error: guarantee(cb != 0i64,"exception happened outside interpreter, nmethods and vtable stubs (1)")
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0-b15 mixed mode windows-amd64)
fixme:msvcrt:MSVCRT__sopen_s : pmode 0x01b6 ignored
# An error report file with more information is saved as:
# C:\users\dave\My Documents\hs_err_pid66.log
[thread 85 also had an error]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
err:ole:CoGetClassObject class {e26b366d-f998-43ce-836f-cb6d904432b0} not registered
err:ole:CoGetClassObject no class object {e26b366d-f998-43ce-836f-cb6d904432b0} could be created for context 0x1
err:ole:CoGetClassObject class {e26b366d-f998-43ce-836f-cb6d904432b0} not registered
err:ole:CoGetClassObject no class object {e26b366d-f998-43ce-836f-cb6d904432b0} could be created for context 0x1
fixme:heap:HeapSetInformation 0x240000 0 0x23fce0 4
fixme:seh:RtlAddFunctionTable 0x640170 1 640000: stub
WARNING: gnome-keyring:: couldn't connect to: /home/dave/.cache/keyring-hmaZEN/pkcs11: No such file or directory
fixme:heap:HeapSetInformation 0x19a74000 0 0x63c8c0 4
fixme:heap:HeapSetInformation 0x19b84000 0 0x63c920 4
fixme:heap:HeapSetInformation 0x19c94000 0 0x63d270 4
fixme:heap:HeapSetInformation 0x19eb0000 0 0x63d270 4
fixme:heap:HeapSetInformation 0x19fc0000 0 0x63d270 4
fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
#
# An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (sharedRuntime.cpp:552), pid=90, tid=9
# Error: guarantee(cb != 0i64,"exception happened outside interpreter, nmethods and vtable stubs (1)")
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0-b15 mixed mode windows-amd64)
fixme:msvcrt:MSVCRT__sopen_s : pmode 0x01b6 ignored
# An error report file with more information is saved as:
# C:\users\dave\My Documents\hs_err_pid90.log
[thread 13 also had an error]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#

Note that this is wine executing the 32-bit version of Mathematica on 64-bit linux (as in my earlier experiments).


1) I'd like to offer this information to help to remove this bug in later versions.

2) I wonder if there is anything that I could tweak that might fix this.

David Bailey
Martin Gregorie

Problem with Windows Java/Mathemaica under wine

Post by Martin Gregorie »

On Sat, 2012-06-16 at 17:00 -0500, David Bailey wrote:
I would like to run the Windows version Mathematica 7.0 on 64-bit Fedora 17, using wine.This may seem a little strange, because Wolfram Research do produce a linux version of this software. However, I have Windows users for clients, so to use Linux,
I really would like to run the same software as they will run.
Are you sure that the Java component is reasonably current? The
reference to the Sun URL rather than to an Oracle one makes me wonder if
there's a more recent version. If there is, it may be a good idea to try
that.


Martin
User avatar
dimesio
Moderator
Moderator
Posts: 13208
Joined: Tue Mar 25, 2008 10:30 pm

Re: Problem with Windows Java/Mathemaica under wine

Post by dimesio »

David Bailey wrote: # Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0-b15 mixed mode windows-amd64)
Try installing it to a pure 32 bit wineprefix. That's probably what you had in Ubuntu, as they've only recently begun packaging 64 bit Wine. Create a 32 bit wineprefix with

Code: Select all

WINEARCH=win32 WINPREFIX=/path/to/wineprefix winecfg
then install to that wineprefix.
David Bailey
Level 2
Level 2
Posts: 14
Joined: Thu Jun 02, 2011 11:11 am

Post by David Bailey »

Dimesio,

Thanks for that - restricting to win32 solved the problem - I hadn't realised that wine now comes with 64-bit capability.

However, the Mathematica installer automatically detects whether it is running under 32-bit or 64-bit Windows, and installs the right binaries as appropriate, so does my original problem indicate that something is wrong with the 64-bit part of wine?

Martin: Mathematica comes bundled with its own Java, which is usually outdated by the time Mathematica ships.

Thanks again to both of you,

David
User avatar
dimesio
Moderator
Moderator
Posts: 13208
Joined: Tue Mar 25, 2008 10:30 pm

Post by dimesio »

David Bailey wrote: Thanks for that - restricting to win32 solved the problem - I hadn't realised that wine now comes with 64-bit capability.

However, the Mathematica installer automatically detects whether it is running under 32-bit or 64-bit Windows, and installs the right binaries as appropriate, so does my original problem indicate that something is wrong with the 64-bit part of wine?
Yes. You should file a bug for that.
David Bailey
Level 2
Level 2
Posts: 14
Joined: Thu Jun 02, 2011 11:11 am

Post by David Bailey »

dimesio wrote: Yes. You should file a bug for that.
I notice that most bugs relate to games, but if all bugs are taken seriously, I guess I could try to reduce it to something that simply runs the Windows version of Java in 64 bits.

David
Martin Gregorie

Problem with Windows Java/Mathemaica under wine

Post by Martin Gregorie »

On Mon, 2012-06-18 at 03:34 -0500, David Bailey wrote:
dimesio wrote:
Yes. You should file a bug for that.
I notice that most bugs relate to games, but if all bugs are taken
seriously, I guess I could try to reduce it to something that simply
runs the Windows version of Java in 64 bits.
Only do that if you are absolutely certain that Mathematica is
distributed with a standard, if old, JVM.

If Mathematica is stated to run with only the JVM distributed with it
the odds are quite high that either the JVM or the standard class
library has been modified. Backward compatibility has always been a
feature of Sun/Oracle JVMs and any software that is distributed for
general use as a Java JVM must pass the certification tests. This
includes OpenJava and the IBM JVM. Failure to pass certification was a
root cause of M$ losing the right to distribute Java. Also, it is a
design aim that a Java app should run with a more recent JRE version,
hence all the deprecated classes and methods that are still included in
the standard class library.


Martin
David Bailey
Level 2
Level 2
Posts: 14
Joined: Thu Jun 02, 2011 11:11 am

Re: Problem with Windows Java/Mathemaica under wine

Post by David Bailey »

Martin Gregorie wrote:Only do that if you are absolutely certain that Mathematica is
distributed with a standard, if old, JVM.
Martin
My thought would be to take a standard Windows 64-bit Java, and try to run it under wine. I would imagine this is something that has rarely if ever been tried because normally it would make sense to use the Linux Java. In my case, however, Mathematica adds some native methods, so obviously, since these are WIN32, the whole Java must be too.

Clearly wine should run Windows Java, even if it is not normally very useful to do so.

David
Martin Gregorie

Problem with Windows Java/Mathemaica under wine

Post by Martin Gregorie »

On Mon, 2012-06-18 at 08:08 -0500, David Bailey wrote:
Martin Gregorie wrote:
Only do that if you are absolutely certain that Mathematica is
distributed with a standard, if old, JVM.
Martin
My thought would be to take a standard Windows 64-bit Java, and try to
run it under wine.
That would certainly be worth trying - for that matter, running it under
any standard JRE, i.e. either Oracle 6,7 or OpenJava, since the current
series of SE JRE and JDK are scheduled to be replaced by OpenJava fairly
soon. would be a worthwhile think to do. I'm far from certain that it
matters to a compiled bytecode object whether the JVM its running on is
32 or 64 bit. It shouldn't matter, since that would drive a coach &
horses through the WORA concept.
I would imagine this is something that has rarely if ever been tried
because normally it would make sense to use the Linux Java.
Bytecode shouldn't care about either OS or the address size the JVM is
implemented in. See above.
In my case, however, Mathematica adds some native methods, so
obviously, since these are WIN32, the whole Java must be too.
Yes, agreed. Since this is normal compiled binary code, the OS and
address size of the hardware it was compiled for matter a lot.
Clearly wine should run Windows Java, even if it is not normally very
useful to do so.
Agreed, though as you say, there are entanglements, such as native code
or nasties like applications that hide the existence of Java by
insisting on launching the JVM from within a Windows binary.

Martin
Locked