[SOLVED] Crashes when running swing besides JME3

i have a current issue with running swing framework besides JME3 framework , sometimes when i exit the game class then start it again for the third time from my JForm swing gui program , the whole jar program crashes & it writes a new log file this one :

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f264429cc98, pid=1454, tid=0x00007f264c2fe700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_201-b09) (build 1.8.0_201-b09)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.201-b09 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libstdc++.so.6+0x1bec98]  vtable for __cxxabiv1::__si_class_type_info+0x10
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x00007f26781d4800):  JavaThread "Finalizer" daemon [_thread_in_native, id=1542, stack(0x00007f264c1fe000,0x00007f264c2ff000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x00007f264429cc98

Registers:
RAX=0x00007f2604fee8d0, RBX=0x0000000000000000, RCX=0x00007f25e9f69d30, RDX=0x00007f25e9f5b260
RSP=0x00007f264c2fd6c8, RBP=0x00007f25e9f69d30, RSI=0x00007f25b254cf90, RDI=0x00007f25e81c69d0
R8 =0x0000000000000000, R9 =0x0000000000000001, R10=0x00007f266901869b, R11=0x00007f2680125db0
R12=0x00007f25b254cf90, R13=0x00007f25e9f5b260, R14=0x0000000000000000, R15=0x00007f25e9f5b260
RIP=0x00007f264429cc98, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000015
  TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007f264c2fd6c8)
0x00007f264c2fd6c8:   00007f2604d1be25 00007f25e9f5b260
0x00007f264c2fd6d8:   00007f25e9b05610 0000000000000000
0x00007f264c2fd6e8:   00007f25e9f69d30 00007f25b254cf90
0x00007f264c2fd6f8:   00007f2604d06d99 0000000000000000
0x00007f264c2fd708:   0000000104da724c 00007f264c2fd760
0x00007f264c2fd718:   00007f25b3328c10 0000000000000000
0x00007f264c2fd728:   00007f25e9b05610 00007f264c2fd7a0
0x00007f264c2fd738:   00007f25e9f5b260 00007f264c2fd75f
0x00007f264c2fd748:   00007f2604d066fc 00007f264c2fd7a0
0x00007f264c2fd758:   800e9d1e24cc9600 00007f264c2fd890
0x00007f264c2fd768:   00007f25e9f69d30 00007f25ec02e130
0x00007f264c2fd778:   00007f25e9f5b260 00007f25e81c69d0
0x00007f264c2fd788:   00007f264c2fd8c0 00007f26781d4800
0x00007f264c2fd798:   00007f2604d0650d 00007f2604fec290
0x00007f264c2fd7a8:   00007f25e9f69d30 00007f25ec02e130
0x00007f264c2fd7b8:   00007f2604d70e49 00007f25e83fa5e0
0x00007f264c2fd7c8:   0000000000000000 00007f25e9f69d30
0x00007f264c2fd7d8:   00007f2604d2c023 00007f26781d4800
0x00007f264c2fd7e8:   00007f25e83fa5e0 00007f264c2fd890
0x00007f264c2fd7f8:   0000000000000000 00007f25f058d378
0x00007f264c2fd808:   00007f2604d50619 00007f25e9ae74e0
0x00007f264c2fd818:   00007f2604d3c981 00007f25f058d378
0x00007f264c2fd828:   00007f26690186c7 00007f264c2fd890
0x00007f264c2fd838:   00007f2669018419 fffffffe00000000
0x00007f264c2fd848:   00007f26690183e2 00007f264c2fd850
0x00007f264c2fd858:   00007f25f058d378 00007f264c2fd8c0
0x00007f264c2fd868:   00007f25f0598a40 0000000000000000
0x00007f264c2fd878:   00007f25f058d378 0000000000000000
0x00007f264c2fd888:   00007f264c2fd8b0 00007f264c2fd908
0x00007f264c2fd898:   00007f26690082bd 0000000000000000
0x00007f264c2fd8a8:   00007f2669011d18 00007f25e9ae74e0
0x00007f264c2fd8b8:   0000000088d55fe8 0000000088d55fe8 

Instructions: (pc=0x00007f264429cc98)
0x00007f264429cc78:   20 07 25 44 26 7f 00 00 e0 bf 29 44 26 7f 00 00
0x00007f264429cc88:   00 00 00 00 00 00 00 00 70 cc 29 44 26 7f 00 00
0x00007f264429cc98:   50 46 18 44 26 7f 00 00 70 46 18 44 26 7f 00 00
0x00007f264429cca8:   b0 48 18 44 26 7f 00 00 b0 48 18 44 26 7f 00 00 

Register to memory mapping:

RAX=0x00007f2604fee8d0: <offset 0x3f98d0> in /home/jpluto/libbulletjme.so at 0x00007f2604bf5000
RBX=0x0000000000000000 is an unknown value
RCX=0x00007f25e9f69d30 is an unknown value
RDX=0x00007f25e9f5b260 is an unknown value
RSP=0x00007f264c2fd6c8 is pointing into the stack for thread: 0x00007f26781d4800
RBP=0x00007f25e9f69d30 is an unknown value
RSI=0x00007f25b254cf90 is an unknown value
RDI=0x00007f25e81c69d0 is an unknown value
R8 =0x0000000000000000 is an unknown value
R9 =0x0000000000000001 is an unknown value
R10=0x00007f266901869b is at code_begin+859 in an Interpreter codelet
method entry point (kind = native)  [0x00007f2669018340, 0x00007f2669018cc0]  2432 bytes
R11=0x00007f2680125db0: <offset 0x9bfdb0> in /home/jpluto/jdk1.8.0_201/jre/lib/amd64/server/libjvm.so at 0x00007f267f766000
R12=0x00007f25b254cf90 is an unknown value
R13=0x00007f25e9f5b260 is an unknown value
R14=0x0000000000000000 is an unknown value
R15=0x00007f25e9f5b260 is an unknown value


Stack: [0x00007f264c1fe000,0x00007f264c2ff000],  sp=0x00007f264c2fd6c8,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libstdc++.so.6+0x1bec98]  vtable for __cxxabiv1::__si_class_type_info+0x10

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.jme3.bullet.PhysicsSpace.finalizeNative(J)V+0
j  com.jme3.bullet.PhysicsSpace.finalize()V+34
J 1501 C1 java.lang.ref.Finalizer.runFinalizer(Lsun/misc/JavaLangAccess;)V (62 bytes) @ 0x00007f266950ae3c [0x00007f266950a8a0+0x59c]
J 1500 C1 java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;Lsun/misc/JavaLangAccess;)V (6 bytes) @ 0x00007f266950b59c [0x00007f266950b540+0x5c]
j  java.lang.ref.Finalizer$FinalizerThread.run()V+45
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x00007f25bd2fd800 JavaThread "jME3 Audio Decoder" daemon [_thread_blocked, id=1639, stack(0x00007f2644dac000,0x00007f2644ead000)]
  0x00007f25e98e5000 JavaThread "jME3 Main" [_thread_in_Java, id=1629, stack(0x00007f25df4f5000,0x00007f25df5f6000)]
  0x00007f260c1b3000 JavaThread "Thread-6" [_thread_in_native, id=1626, stack(0x00007f2604af5000,0x00007f2604bf5000)]
  0x00007f25ec018000 JavaThread "process reaper" daemon [_thread_blocked, id=1587, stack(0x00007f26440a5000,0x00007f26440de000)]
  0x00007f260c25d800 JavaThread "TimerQueue" daemon [_thread_blocked, id=1583, stack(0x00007f26443c9000,0x00007f26444ca000)]
  0x00007f260c01a000 JavaThread "Image Animator 3" daemon [_thread_blocked, id=1563, stack(0x00007f2645b77000,0x00007f2645c78000)]
  0x00007f267800b000 JavaThread "DestroyJavaVM" [_thread_blocked, id=1498, stack(0x00007f267f521000,0x00007f267f621000)]
  0x00007f26784ce000 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=1562, stack(0x00007f2645c78000,0x00007f2645d79000)]
  0x00007f26784cd000 JavaThread "AWT-Shutdown" [_thread_blocked, id=1561, stack(0x00007f2645d79000,0x00007f2645e7a000)]
  0x00007f2678476800 JavaThread "AWT-XAWT" daemon [_thread_in_native, id=1560, stack(0x00007f264607a000,0x00007f264617b000)]
  0x00007f2678451800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=1559, stack(0x00007f264617b000,0x00007f264627c000)]
& **so on a long text log file**

so is there’s a fix for that ?

1 Like

Are you using LWJGL3?

If so, can you try with LWJGL2 and see if crash happens yet.

1 Like

I am using lwjgl 2.9.3

Judging by the stack trace, the crash is occurring in physics-simulation code. I think it’s unlikely it has anything to do with Swing or LWJGL.

In fact, it looks a lot like issue 1351.

Are you using Minie or jme3-bullet? And if using Minie, which version?

1 Like

@sgold yes indeed
image

i have tried this command

ulimit -H -c unlimited 

in my mate terminal for core dump but it didinot work

1 Like

I’ve never managed to get a code dump out of the JVM.

Try switching to Minie v2.

1 Like

Okay , what’s Minie v2 …is it a library ?

Yes, it’s a library. Not included in the v3.2.4 SDK, unfortunately.

You can read about it here: Project overview :: The Minie project

1 Like

Do I need to change my code ? Or just replace libraries & everything is fine ?

Possibly. I haven’t seen your code.

For most applications the required changes are minor. And many applications will work without any source-code modifications at all.

1 Like

Okay , thanks @sgold

1 Like

okay, i have dowloaded minie & replaced it with old jbullet but i get this & i cannot find this class from the lib lists in jmonkeySDK from where can i get this jar file ?..it seems like core utilities not added in minie !

java.lang.NoClassDefFoundError: jme3utilities/Validate
	at com.jme3.bullet.collision.shapes.CapsuleCollisionShape.<init>(CapsuleCollisionShape.java:122)
	at main_WorldMap.GameApplication.prepare_shipPlayer(GameApplication.java:230)
	at main_WorldMap.GameApplication.setup_scene(GameApplication.java:667)
	at main_WorldMap.GameApplication.simpleInitApp(GameApplication.java:174)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:220)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: jme3utilities.Validate
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 8 more

image

i have found a git thread where there’s this Heart Library → downloaded & included it but get another exception for lookAt camera method …seems its deprecated

java.lang.NoSuchMethodError: com.jme3.math.Quaternion.lookAt(Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)Lcom/jme3/math/Quaternion;
	at com.jme3.bullet.control.CharacterControl.update(CharacterControl.java:366)
	at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:736)
	at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:879)
	at com.jme3.scene.Node.updateLogicalState(Node.java:230)
	at com.jme3.scene.Node.updateLogicalState(Node.java:241)
	at com.jme3.app.SimpleApplication.update(SimpleApplication.java:242)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
	at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:197)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
	at java.lang.Thread.run(Thread.java:748)
1 Like

The Quaternion class is part of jme3-core. The return type of that method changed between JME 3.2 and 3.3. Minie v2 is compiled for the v3.3 version of jme3-core. So you probably need the JME 3.3 version of jme3-core.

(Management of library versions is much easier if you use Gradle. A pity the JME 3.2 SDK didn’t come with Gradle built in. It’s not difficult to install the Gradle plugin, but then to use it you have to rewrite your build scripts…)

1 Like

I was using Gradle in intellij but I cannot build jar file & intellij is too old it’s 2018 that supports jme

Are you talking about the plugin I made? The problem with that plugin is the same as the SDK. Restricting the user to a specific IDE. Which is why I made the gradle plugin - it works on any IDE - or none at all. It’s just a gradle plugin.

That’s why I stopped development and moved on. But the code is open source. Anyone can continue its development. If I get a PR I’ll even publish it to IntelliJ.

Writing an SDK from scratch requires experience, and with each attempt it evolved to a better way. I’m confident that the gradle plugin is the way to go.

2 Likes

@sgold finally , the crash problem is fixed , i have run the game 12 times continously & it didnot crash i have added the JME3.3.2 stable lib folder contents + the Heart.jar + Minie V2.jar to my project …thank you !

@jayfella concering gradle , i will try to move my project as fast as possible to suppport gradle ,but can you make a quick 5 mins video on how to use the gradle plugin on any IDE especially intellij & Netbeans !
Thank you !

1 Like
1 Like

You’re very welcome. I’ve upgraded the Minie documentation to highlight the dependency on JME 3.3.

It occurred to me last night that an alternative workaround for issue 1351 (for developers who don’t want Minie) would be to replace jme3-bullet (and jme3-bullet-native) with jme3-jbullet.

Out of curiosity: Did switching your project from jme3-bullet to Minie necessitate any source-code changes?

1 Like

So, where i can found the jme3-bulllet.jar file in case i need this alternative fix ?

about source code changes , not a major change just :
these dudes :

        CollisionShape shape=CollisionShapeFactory.createBoxShape(rover);
        player = new CharacterControl(shape, 0.5f);

with these ones
new snippet:simply one line :slight_smile: :smile:

        player = new CharacterControl(new BoxCollisionShape(1f, 1f, 2.5f), 0.5f);

→ because CharacterControl can only uses convexshapes & the new minie physics library implementing the CollisionShape class as a NativePhysicsObject(using extend) but BoxCollisionShape in new Minie extends a ConvexShape so it works with BoxCollisionShape not CollisionShapeFactory: