0
\$\begingroup\$

I am trying to add a Character Controller to a Discrete Dynamics World in Bullet via the LibGDX wrapper and everything seems to work, but when I attempt to update the world via the StepSimulation method the program crashes and returns an illegal access exception. Debugging on my own I've found that the line that crashes is the return from the following method:

public int stepSimulation(float timeStep, int maxSubSteps, float fixedTimeStep) {
    return DynamicsJNI.btDiscreteDynamicsWorld_stepSimulation__SWIG_0(swigCPtr, this, timeStep, maxSubSteps, fixedTimeStep);
  }

The following is the section of code where I build the CharacterController:

modelBuilder.begin();
modelBuilder.node().id = "player";
modelBuilder.part("player", GL20.GL_TRIANGLES, VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal, new Material(ColorAttribute.createDiffuse(Color.RED))).box(.5f,.8f,.25f);
modelBuilder.end();

modelInstanceBody = new ModelInstance(model, "player");
transform = modelInstanceBody.transform;
btBoxShape collisionShape = new btBoxShape(new Vector3(.5f,.8f,.25f));

ghost = new btPairCachingGhostObject();
ghost.setWorldTransform(transform);
ghost.setCollisionShape(collisionShape);
ghost.setCollisionFlags(btCollisionObject.CollisionFlags.CF_CHARACTER_OBJECT);
ghost.setActivationState(CollisionConstants.DISABLE_DEACTIVATION);
characterController = new btKinematicCharacterController(ghost, collisionShape,.35f, Vector3.Y);

Lastly the console error I receive:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000067d51a91, pid=27816, tid=30856
#
# JRE version: Java(TM) SE Runtime Environment (11.0.2+9) (build 11.0.2+9-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.2+9-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [gdx-bullet64.dll+0x91a91]
#
# 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:
# Q:\Creed\Documents\Java\BulletTest\core\assets\hs_err_pid27816.log
#
# 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.
#
AL lib: (EE) alc_cleanup: 1 device not closed

> Task :desktop:DesktopLauncher.main() FAILED

Execution failed for task ':desktop:DesktopLauncher.main()'.
> Process 'command 'C:/Program Files/Java/jdk-11.0.2/bin/java.exe'' finished with non-zero exit value 1

Any help to further troubleshoot this or resolve this error would be greatly appreciated.

EDIT: The generated log file:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000067d51a91, pid=27816, tid=30856
#
# JRE version: Java(TM) SE Runtime Environment (11.0.2+9) (build 11.0.2+9-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.2+9-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [gdx-bullet64.dll+0x91a91]
#
# 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:
#   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.
#

---------------  S U M M A R Y ------------

Command Line: -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=57941 -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant com.creedvi.games.dfg.prototype.desktop.DesktopLauncher

Host: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 12 cores, 31G,  Windows 10 , 64 bit Build 19041 (10.0.19041.546)
Time: Sun Dec  6 13:27:15 2020 Eastern Standard Time elapsed time: 15 seconds (0d 0h 0m 15s)

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

Current thread (0x00000231de242000):  JavaThread "LWJGL Application" [_thread_in_native, id=30856, stack(0x0000003cb5700000,0x0000003cb5800000)]

Stack: [0x0000003cb5700000,0x0000003cb5800000],  sp=0x0000003cb57fea40,  free space=1018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [gdx-bullet64.dll+0x91a91]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.badlogic.gdx.physics.bullet.dynamics.DynamicsJNI.btDiscreteDynamicsWorld_stepSimulation__SWIG_0(JLcom/badlogic/gdx/physics/bullet/dynamics/btDiscreteDynamicsWorld;FIF)I+0
j  com.badlogic.gdx.physics.bullet.dynamics.btDiscreteDynamicsWorld.stepSimulation(FIF)I+8
j  com.creedvi.games.dfg.prototype.Utilities.CollisionManager.update(F)V+8
j  com.creedvi.games.dfg.prototype.Screens.GameScreen.update(F)V+5
j  com.creedvi.games.dfg.prototype.Screens.GameScreen.render(F)V+2
j  com.badlogic.gdx.Game.render()V+19
j  com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop()V+776
j  com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run()V+27
v  ~StubRoutines::call_stub

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000008


Register to memory mapping:

RIP=0x0000000067d51a91 gdx-bullet64.dll
RAX=0x0 is NULL
RBX=0x00000231e8182d10 points into unknown readable memory: 40 ea 03 68 00 00 00 00
RCX=0x00000231e8182ab0 points into unknown readable memory: f0 cf 03 68 00 00 00 00
RDX=0x0 is NULL
RSP=0x0000003cb57fea40 is pointing into the stack for thread: 0x00000231de242000
RBP=0x0000003cb57feddf is pointing into the stack for thread: 0x00000231de242000
RSI=0x0 is NULL
RDI=0x00000231e8182250 points into unknown readable memory: e0 c5 03 68 00 00 00 00
R8 =0x0000003cb57fea70 is pointing into the stack for thread: 0x00000231de242000
R9 =0x0000003cb57feab0 is pointing into the stack for thread: 0x00000231de242000
R10=0x000000003f800000 is an unknown value
R11=0x0 is NULL
R12=0x0 is NULL
R13={method} {0x00000231e7bb1e48} 'btDiscreteDynamicsWorld_stepSimulation__SWIG_0' '(JLcom/badlogic/gdx/physics/bullet/dynamics/btDiscreteDynamicsWorld;FIF)I' in 'com/badlogic/gdx/physics/bullet/dynamics/DynamicsJNI'
R14=0x0000003cb57fefc8 is pointing into the stack for thread: 0x00000231de242000
R15=0x00000231de242000 is a thread


Registers:
RAX=0x0000000000000000, RBX=0x00000231e8182d10, RCX=0x00000231e8182ab0, RDX=0x0000000000000000
RSP=0x0000003cb57fea40, RBP=0x0000003cb57feddf, RSI=0x0000000000000000, RDI=0x00000231e8182250
R8 =0x0000003cb57fea70, R9 =0x0000003cb57feab0, R10=0x000000003f800000, R11=0x0000000000000000
R12=0x0000000000000000, R13=0x00000231e7bb1e40, R14=0x0000003cb57fefc8, R15=0x00000231de242000
RIP=0x0000000067d51a91, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x0000003cb57fea40)
0x0000003cb57fea40:   0000000000000817 0000000000000000
0x0000003cb57fea50:   00000231ad6c2498 0000003cb57fea60
0x0000003cb57fea60:   0000023100000003 0000003cb57fee90
0x0000003cb57fea70:   800000003f800000 0000000000000000
0x0000003cb57fea80:   0000000000000000 000000003f800000
0x0000003cb57fea90:   bf80000080000000 0000000000000000
0x0000003cb57feaa0:   0000000000000000 0000000000000000
0x0000003cb57feab0:   800000003f800000 0000000000000000
0x0000003cb57feac0:   0000000000000000 000000003f800000
0x0000003cb57fead0:   bf80000080000000 0000000000000000
0x0000003cb57feae0:   3eb3333300000000 0000000000000000
0x0000003cb57feaf0:   000000006803fa50 000000013f800000
0x0000003cb57feb00:   00000000ffffffff 0000000000000000
0x0000003cb57feb10:   0000000000000000 0000000000000000
0x0000003cb57feb20:   0000000000000000 0000000000000000
0x0000003cb57feb30:   000000003c888889 0000000000000000 

Instructions: (pc=0x0000000067d51a91)
0x0000000067d51a71:   24 18 01 00 00 f3 0f 11 8c 24 1c 01 00 00 f3 0f
0x0000000067d51a81:   11 9c 24 24 01 00 00 f3 0f 11 94 24 28 01 00 00
0x0000000067d51a91:   8b 50 08 f3 0f 10 47 54 89 94 24 bc 00 00 00 8b
0x0000000067d51aa1:   40 0c f3 0f 11 44 24 28 48 8b 53 18 89 84 24 c0 


Stack slot to memory mapping:
stack at sp + 0 slots: 0x0000000000000817 is an unknown value
stack at sp + 1 slots: 0x0 is NULL
stack at sp + 2 slots: 0x00000231ad6c2498 points into unknown readable memory: 00 00 00 00 00 00 00 00
stack at sp + 3 slots: 0x0000003cb57fea60 is pointing into the stack for thread: 0x00000231de242000
stack at sp + 4 slots: 0x0000023100000003 is an unknown value
stack at sp + 5 slots: 0x0000003cb57fee90 is pointing into the stack for thread: 0x00000231de242000
stack at sp + 6 slots: 0x800000003f800000 is an unknown value
stack at sp + 7 slots: 0x0 is NULL

VM Arguments:
jvm_args: -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=57941 -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant 
java_command: com.creedvi.games.dfg.prototype.desktop.DesktopLauncher
java_class_path (initial): Q:\Creed\Documents\Java\BulletTest\desktop\build\classes\java\main;Q:\Creed\Documents\Java\BulletTest\desktop\build\resources\main;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-tools\1.9.12\c122d87d03f1df0e99ccae9ca029009523e449cf\gdx-tools-1.9.12.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-backend-lwjgl\1.9.12\82ff0003171e3e0df9a12c8f86d264a88afb112\gdx-backend-lwjgl-1.9.12.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-platform\1.9.12\6b5da746f38d84818fe376f57f6b5cf93a39f75b\gdx-platform-1.9.12-natives-desktop.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-freetype-platform\1.9.12\d7dbccdb8a12233aba7ede3ba2898f1ea9b65fa8\gdx-freetype-platform-1.9.12-natives-desktop.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-bullet-platform\1.9.12\9d9a11896df9f46a439cac5eeb1f62b2ca67c310\gdx-bullet-platform-1.9.12-natives-desktop.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-controllers-desktop\1.9.12\12dd980d564a79a340fcaf391ae02c260fe461fa\gdx-controllers-desktop-1.9.12.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-controllers-platform\1.9.12\65a2d622dcec1d8ac25814c27d0f656f99ed4b6f\gdx-controllers-platform-1.9.12-natives-desktop.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-box2d-platform\1.9.12\6462b97b9749a5da6525dfa478e0af10b974867b\gdx-box2d-platform-1.9.12-natives-desktop.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\de.tomgrill.gdxdialogs\gdx-dialogs-desktop\1.2.5\233048054a845d7a59d86c54e9d74f95749f74b5\gdx-dialogs-desktop-1.2.5.jar;Q:\Creed\Documents\Java\BulletTest\core\build\libs\core-1.0.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-backend-headless\1.9.12\6a086bb3f673b6760ace10577f847c110f66c852\gdx-backend-headless-1.9.12.jar;Q:\Creed\.gradle\caches\modules-2\files-2.1\com.badlogicgames
Launcher Type: SUN_STANDARD

[Global flags]
     intx CICompilerCount                          = 4                                         {product} {ergonomic}
     uint ConcGCThreads                            = 3                                         {product} {ergonomic}
     uint G1ConcRefinementThreads                  = 10                                        {product} {ergonomic}
   size_t G1HeapRegionSize                         = 2097152                                   {product} {ergonomic}
    uintx GCDrainStackTargetSize                   = 64                                        {product} {ergonomic}
   size_t InitialHeapSize                          = 536870912                                 {product} {ergonomic}
   size_t MarkStackSize                            = 4194304                                   {product} {ergonomic}
   size_t MaxHeapSize                              = 8573157376                                {product} {ergonomic}
   size_t MaxNewSize                               = 5142216704                                {product} {ergonomic}
   size_t MinHeapDeltaBytes                        = 2097152                                   {product} {ergonomic}
    uintx NonNMethodCodeHeapSize                   = 5835340                                {pd product} {ergonomic}
    uintx NonProfiledCodeHeapSize                  = 122911450                              {pd product} {ergonomic}
    uintx ProfiledCodeHeapSize                     = 122911450                              {pd product} {ergonomic}
    uintx ReservedCodeCacheSize                    = 251658240                              {pd product} {ergonomic}
     bool SegmentedCodeCache                       = true                                      {product} {ergonomic}
     bool UseCompressedClassPointers               = true                                 {lp64_product} {ergonomic}
     bool UseCompressedOops                        = true                                 {lp64_product} {ergonomic}
     bool UseG1GC                                  = true                                      {product} {ergonomic}
     bool UseLargePagesIndividualAllocation        = false                                  {pd product} {ergonomic}

Logging:
Log output configuration:
 #0: stdout all=warning uptime,level,tags
 #1: stderr all=off uptime,level,tags

Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk-jdk1.8.0_202
PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Gradle\gradle-5.2.1\bin;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Program Files (x86)\Calibre2\;C:\Program Files\Calibre2\;C:\Program Files\CMake\bin;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\Creed\AppData\Local\Microsoft\WindowsApps;C:\Users\Creed\AppData\Local\Programs\Microsoft VS Code\bin;C:\mingw-w64\mingw32\i686-w64-mingw32\bin;Q:\Program Files (x86)\FAHClient;
USERNAME=Creed
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 158 Stepping 10, GenuineIntel

END.
\$\endgroup\$
3
  • \$\begingroup\$ What do you see in Q:\Creed\Documents\Java\BulletTest\core\assets\hs_err_pid27816.log ? \$\endgroup\$
    – DMGregory
    Dec 6 '20 at 18:34
  • \$\begingroup\$ @DMGregory Added an edit with an abridged version of the log file as the whole item was too large to add in the post \$\endgroup\$
    – Calvin Day
    Dec 6 '20 at 18:41
  • \$\begingroup\$ Do you have the ability to run this under a debugger that can give you more human-readable insight into where the error occurred? \$\endgroup\$
    – DMGregory
    Dec 6 '20 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.