I am working on implementing ragdoll physics to my game, and am running into trouble trying to get the DynamicAnimControl to work when I have more than 1 DAC controlled model in the scene. (Also having a similar crash with one specific model even when its the only one, but only sometimes so I can’t reproduce it as easily).
Here is the output right before the game crashes, immediately after I call setRagDolMode()
on the second DAC controlled model in the scene. (first it gives me this series of warnings that only occurr prior to the crash)
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
May 10, 2022 10:24:14 PM com.jme3.bullet.objects.PhysicsRigidBody setGravity
WARNING: The body is not in any PhysicsSpace.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff96b2541fc, pid=14860, tid=12420
#
# JRE version: OpenJDK Runtime Environment (11.0.6+10) (build 11.0.6+10)
# Java VM: OpenJDK 64-Bit Server VM (11.0.6+10, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C [bulletjme.dll+0x41fc]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\ryan\Desktop\JM\TheAfflictedForests\hs_err_pid14860.log
#
# If you would like to submit a bug report, please visit:
# https://github.com/AdoptOpenJDK/openjdk-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
AL lib: (EE) alc_cleanup: 1 device not closed
> Task :run FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command 'C:\Program Files\jmonkeyplatform\jdk\bin\java.exe'' finished with non-zero exit value 1
And here is what is written to the hs_err_pid14860.log referenced in the above crash error: ( i shortened it because it was way over the character limit for a forum post and including a lot of memory location info I assume isn’t necessary, but I think I included the important part; let me know if I need to include more)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff96b2541fc, pid=14860, tid=12420
#
# JRE version: OpenJDK Runtime Environment (11.0.6+10) (build 11.0.6+10)
# Java VM: OpenJDK 64-Bit Server VM (11.0.6+10, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C [bulletjme.dll+0x41fc]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# https://github.com/AdoptOpenJDK/openjdk-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- S U M M A R Y ------------
Command Line: -Djava.library.path=libs -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant com.theafflictedforests.MainSA.Main
Host: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz, 8 cores, 15G, Windows 10 , 64 bit Build 19041 (10.0.19041.1645)
Time: Tue May 10 22:24:14 2022 Eastern Daylight Time elapsed time: 33 seconds (0d 0h 0m 33s)
--------------- T H R E A D ---------------
Current thread (0x0000019cdf599000): JavaThread "jME3 Main" [_thread_in_native, id=12420, stack(0x00000059cb100000,0x00000059cb200000)]
Stack: [0x00000059cb100000,0x00000059cb200000], sp=0x00000059cb1fe860, free space=1018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [bulletjme.dll+0x41fc]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 5449 com.jme3.bullet.PhysicsSpace.stepSimulation(JFIFZZZ)V (0 bytes) @ 0x0000019cc882edb2 [0x0000019cc882ed40+0x0000000000000072]
J 5448 c1 com.jme3.bullet.PhysicsSpace.update(FIZZZ)V (96 bytes) @ 0x0000019cc19dab5c [0x0000019cc19da9e0+0x000000000000017c]
J 5447 c1 com.jme3.bullet.PhysicsSpace.update(FI)V (126 bytes) @ 0x0000019cc19da524 [0x0000019cc19da0a0+0x0000000000000484]
J 4456 c1 com.jme3.bullet.PhysicsSpace.update(F)V (79 bytes) @ 0x0000019cc174f6f4 [0x0000019cc174f5e0+0x0000000000000114]
J 4455 c1 com.jme3.bullet.BulletAppState.render(Lcom/jme3/renderer/RenderManager;)V (76 bytes) @ 0x0000019cc174f08c [0x0000019cc174ee00+0x000000000000028c]
J 6525 c2 com.jme3.app.state.AppStateManager.render(Lcom/jme3/renderer/RenderManager;)V (93 bytes) @ 0x0000019cc8a372ec [0x0000019cc8a37160+0x000000000000018c]
J 5620 c1 com.jme3.app.SimpleApplication.update()V (235 bytes) @ 0x0000019cc1a52824 [0x0000019cc1a51fe0+0x0000000000000844]
J 5619 c1 com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop()V (141 bytes) @ 0x0000019cc1a51174 [0x0000019cc1a50f80+0x00000000000001f4]
J 5614 c1 com.jme3.system.lwjgl.LwjglDisplay.runLoop()V (149 bytes) @ 0x0000019cc1a4c25c [0x0000019cc1a49e00+0x000000000000245c]
j com.jme3.system.lwjgl.LwjglAbstractDisplay.run()V+136
j java.lang.Thread.run()V+11 java.base@11.0.6
v ~StubRoutines::call_stub
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000019bc2375eb0
Register to memory mapping:
The crash and the setGravity warnings do not occur when I load a single DAC model into my game. I am working with a Fox, Bear, and Elf model right now, and both the Fox and Bear work perfectly when they are loaded in 1 at a time. But as soon as I load in a second one and call setRagDollMod() on it, the crash occurs.
I also get inconsistent crashes with the wood elf model. When it is used for the player’s character model, it crashes nearly every time even when loaded on its own, and other times it will take a while before the crash occurs if I spawn in a second wood elf before setting myself into ragdoll mode. Also, when I use a dark skinned version of the same model that is loaded from a separate .j3o (but has same animation rig so the same DAC code works), then it works just like the Bear and Fox where everything works until a second model is set to ragdoll mode.