Hi there,
(my first post, new here…)
I'm currently working on embedding jMonkey in an Eclipse RCP application (succeeded). Currently, the easiest way I found was by using the SWT AWT bridge that comes with SWT.
I also used the specialized SWTRenderer Monkeyworld3d uses (succeeded) but that involves overriding a lot of classes in JME. I preferred to keep JME intact is much as possible (no changes were required…). It also gave a lot of trouble with the specialized classloader in Eclipse, so I had to do some extra changes in JME.
I used the JMESwingTest (in jmetest.util) example to setup an example scene. I noticed that my SWT Example application and my Eclipse RCP application crash when closing the window containing the JME window.
Going back to JMESwingTest I noticed the System.exit(0) call, when the windows is closed. Removing that call gives me the same VM crash.
I'm running Ubuntu Linux (x86) with Java VM: Java HotSpot™ Server VM (1.5.0_04-b05 mixed mode)
On Windows removing the System.exit from JMESwingTest doesn't produce a VM crash.
Does anyone know a solution to this? I think that if the problem is on the OpenGL side, it's probably in LWJGL, but I'm not sure…
Regards,
Erwin.
Oops, I forgot the report from the VM:
#
An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0x8d6e3198, pid=15543, tid=2374196144
#
Java VM: Java HotSpot™ Server VM (1.5.0_04-b05 mixed mode)
Problematic frame:
C 0x8d6e3198
#
An error report file with more information is saved as hs_err_pid15543.log
#
If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
I don't think attaching the whole hs_err_pid15543.log file will appreciated, but will be done on request…
Erwin.
Well not sure with Your custom renderer but if this was on LWJGL i'd say:
Check if the display is closed before quitting the app.
This is the bit from BaseGame:
/**
* Quits the program abruptly using <code>System.exit</code>.
* @see AbstractGame#quit()
*/
protected void quit() {
if (display != null)
display.close();
System.exit(0);
}
Sorry for the confusion, but I'm not using a custom renderer.
The crash happens using a standard jmetest.util.JMESwingTest where I have removed System.exit(0). This to simulate the behavior in my program, where I want to close and open JME windows.
I tried the suggestion to call display.close(), so where JMESwingTest has System.exit(0), I put:
DisplaySystem.getDisplaySystem().close();
This unfortunately still crashes the VM :(.
Well, I'll keep digging. Instead of the LWJGL libs from JME CVS, I'll try to compile them myself. This way I can debug them…
Erwin.
Well, don't know if anybody is reading this, but here is my progress:
Checked out LWJGL from CVS and managed to compile both Java and C parts…
JMESwingTest still crashes with the System.exit(0) removed…
I'm starting to consider to do what the crash report says: send it to Sun Microsystems.
I'm sorry that I haven't replied, but I just wouldn't be able to offer much. I really don't know what is causing the problem as I haven't seen it. I am reading this thread though. So if you determine it's something we are doing, we'll fix it.
I've seen this a lot in the past when using RTT but not with Swing… I'll keep an eye out as well.
I managed to reproduce the error in a pure LWJGL and AWT implementation. So JME is innocent
I'll head over to the LWJGL forums…
Erwin.