[SOLVED] JVM crash in Stranded

When I try to run your game, I get this.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000001002d8c00, pid=20244, tid=31476
#
# JRE version: OpenJDK Runtime Environment OpenLogic-OpenJDK (17.0.5+8) (build 17.0.5+8-adhoc..jdk17u)
# Java VM: OpenJDK 64-Bit Server VM OpenLogic-OpenJDK (17.0.5+8-adhoc..jdk17u, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C  0x00000001002d8c00
#
# 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://techsupport.roguewave.com/
# 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: -Xmx1G 

Host: AMD Ryzen 9 5900X 12-Core Processor            , 24 cores, 31G,  Windows 10 , 64 bit Build 19041 (10.0.19041.3636)
Time: Thu Dec  7 00:22:56 2023 Central Standard Time elapsed time: 9.804639 seconds (0d 0h 0m 9s)

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

Current thread (0x000001316ad61540):  JavaThread "jME3 Main" [_thread_in_native, id=31476, stack(0x00000007a9c10000,0x00000007a9d10000)]

Stack: [0x00000007a9c10000,0x00000007a9d10000],  sp=0x00000007a9d0d738,  free space=1013k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x00000001002d8c00

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy.serialize(J)[B+0
j  com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy.serialize()[B+6
j  com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+6
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 4823 c2 com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;)Ljava/lang/Object; (7 bytes) @ 0x000001315ae24bd8 [0x000001315ae24ba0+0x0000000000000038]
j  com.jme3.bullet.collision.shapes.MeshCollisionShape.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+27
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 4823 c2 com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;)Ljava/lang/Object; (7 bytes) @ 0x000001315ae24bd8 [0x000001315ae24ba0+0x0000000000000038]
j  com.jme3.bullet.collision.PhysicsCollisionObject.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+50
j  com.jme3.bullet.objects.PhysicsRigidBody.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+79
j  com.jme3.bullet.control.RigidBodyControl.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+69
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 2682 c1 com.jme3.util.clone.ListCloneFunction.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/util/List;Ljava/util/List;)V (42 bytes) @ 0x0000013153d13fac [0x0000013153d13e00+0x00000000000001ac]
J 2681 c1 com.jme3.util.clone.ListCloneFunction.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;Ljava/lang/Object;)V (14 bytes) @ 0x0000013153d13a34 [0x0000013153d137c0+0x0000000000000274]
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+238
J 4822 c1 com.jme3.scene.Spatial.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V (230 bytes) @ 0x0000013153fba9bc [0x0000013153fb9c60+0x0000000000000d5c]
j  com.jme3.scene.Geometry.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+3
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 2682 c1 com.jme3.util.clone.ListCloneFunction.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/util/List;Ljava/util/List;)V (42 bytes) @ 0x0000013153d13fac [0x0000013153d13e00+0x00000000000001ac]
J 2681 c1 com.jme3.util.clone.ListCloneFunction.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;Ljava/lang/Object;)V (14 bytes) @ 0x0000013153d13a34 [0x0000013153d137c0+0x0000000000000274]
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+238
J 4827 c1 com.jme3.scene.Node.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V (37 bytes) @ 0x0000013153e06b8c [0x0000013153e06a80+0x000000000000010c]
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 4950 c2 com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object; (615 bytes) @ 0x000001315aeaa900 [0x000001315aea9fa0+0x0000000000000960]
J 4827 c1 com.jme3.scene.Node.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V (37 bytes) @ 0x0000013153e06b8c [0x0000013153e06a80+0x000000000000010c]
J 4950 c2 com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object; (615 bytes) @ 0x000001315aeaaf98 [0x000001315aea9fa0+0x0000000000000ff8]
J 4950 c2 com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object; (615 bytes) @ 0x000001315aeaa900 [0x000001315aea9fa0+0x0000000000000960]
J 4827 c1 com.jme3.scene.Node.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V (37 bytes) @ 0x0000013153e06b8c [0x0000013153e06a80+0x000000000000010c]
J 4950 c2 com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object; (615 bytes) @ 0x000001315aeaaf98 [0x000001315aea9fa0+0x0000000000000ff8]
J 4823 c2 com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;)Ljava/lang/Object; (7 bytes) @ 0x000001315ae24bd8 [0x000001315ae24ba0+0x0000000000000038]
j  com.jme3.scene.Spatial.clone(Z)Lcom/jme3/scene/Spatial;+51
j  com.jme3.scene.Node.clone(Z)Lcom/jme3/scene/Node;+2
j  com.jme3.scene.Node.clone(Z)Lcom/jme3/scene/Spatial;+2
j  com.jme3.scene.Spatial.clone()Lcom/jme3/scene/Spatial;+2
j  com.jme3.scene.Spatial.clone()Lcom/jme3/asset/CloneableSmartAsset;+1
j  com.jme3.asset.CloneableAssetProcessor.createClone(Ljava/lang/Object;)Ljava/lang/Object;+6
j  com.jme3.asset.DesktopAssetManager.registerAndCloneSmartAsset(Lcom/jme3/asset/AssetKey;Ljava/lang/Object;Lcom/jme3/asset/AssetProcessor;Lcom/jme3/asset/cache/AssetCache;)Ljava/lang/Object;+17
j  com.jme3.asset.DesktopAssetManager.loadAsset(Lcom/jme3/asset/AssetKey;)Ljava/lang/Object;+213
j  com.jme3.asset.DesktopAssetManager.loadModel(Lcom/jme3/asset/ModelKey;)Lcom/jme3/scene/Spatial;+2
j  com.jme3.asset.DesktopAssetManager.loadModel(Ljava/lang/String;)Lcom/jme3/scene/Spatial;+9
j  com.bruynhuis.envision.controls.brain.LoadSceneControl.loadNewScene()V+68
j  com.bruynhuis.envision.controls.brain.LoadSceneControl.graphicsUpdate(F)V+23
J 4568 c2 com.bruynhuis.envision.controls.brain.BrainControl.controlUpdate(F)V (172 bytes) @ 0x000001315af838f8 [0x000001315af83880+0x0000000000000078]
J 4197 c2 com.jme3.scene.control.AbstractControl.update(F)V (14 bytes) @ 0x000001315af06648 [0x000001315af06600+0x0000000000000048]
J 4528 c2 com.jme3.scene.Node.updateLogicalState(F)V (55 bytes) @ 0x000001315af5f0ac [0x000001315af5efa0+0x000000000000010c]
J 4528 c2 com.jme3.scene.Node.updateLogicalState(F)V (55 bytes) @ 0x000001315af5f170 [0x000001315af5efa0+0x00000000000001d0]
J 4468 c1 com.jme3.app.SimpleApplication.update()V (235 bytes) @ 0x000001315403f61c [0x000001315403f1c0+0x000000000000045c]
J 4368 c1 com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop()V (141 bytes) @ 0x0000013153ff443c [0x0000013153ff4260+0x00000000000001dc]
J 4366 c1 com.jme3.system.lwjgl.LwjglDisplay.runLoop()V (151 bytes) @ 0x0000013153ff9f6c [0x0000013153ff8480+0x0000000000001aec]
j  com.jme3.system.lwjgl.LwjglAbstractDisplay.run()V+136
j  java.lang.Thread.run()V+11 java.base@17.0.5
v  ~StubRoutines::call_stub

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), data execution prevention violation at address 0x00000001002d8c00


Register to memory mapping:

RIP=0x00000001002d8c00 is a pointer to class: 
jdk.internal.reflect.GeneratedConstructorAccessor40 {0x00000001002d8c08}
 - instance size:     2
 - klass size:        68
 - access:            public 
 - state:             fully_initialized
 - name:              'jdk/internal/reflect/GeneratedConstructorAccessor40'
 - super:             'jdk/internal/reflect/ConstructorAccessorImpl'
 - sub:               
 - arrays:            NULL
 - methods:           Array<T>(0x0000013110088508)
 - method ordering:   Array<T>(0x0000013168c00018)
 - default_methods:   Array<T>(0x0000000000000000)
 - local interfaces:  Array<T>(0x0000013168c00058)
 - trans. interfaces: Array<T>(0x0000013168c60bb8)
 - constants:         constant pool [116] {0x0000013110088088} for 'jdk/internal/reflect/GeneratedConstructorAccessor40' cache=0x0000013110088800
 - class loader data:  loader data: 0x000001317897d000 for instance a 'jdk/internal/reflect/DelegatingClassLoader'{0x00000000c3a33518}
 - class annotations:       Array<T>(0x0000000000000000)
 - class type annotations:  Array<T>(0x0000000000000000)
 - field annotations:       Array<T>(0x0000000000000000)
 - field type annotations:  Array<T>(0x0000000000000000)
 - inner classes:     Array<T>(0x0000013168c00028)
 - nest members:     Array<T>(0x0000013168c00028)
 - permitted subclasses:     Array<T>(0x0000013168c00028)
 - java mirror:       a 'java/lang/Class'{0x00000000c3a335a0} = 'jdk/internal/reflect/GeneratedConstructorAccessor40'
 - vtable length      6  (start addr: 0x00000001002d8dc8)
 - itable length      5 (start addr: 0x00000001002d8df8)
 - ---- static fields (0 words):
 - ---- non-static fields (0 words):
 - non-static oop maps: 
RAX=0x00000131698c4760 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
RBX=0x000001317487ceb0 points into unknown readable memory: 0x00000000c3a335a0 | a0 35 a3 c3 00 00 00 00
RCX=0x000001317487ceb0 points into unknown readable memory: 0x00000000c3a335a0 | a0 35 a3 c3 00 00 00 00
RDX=0x00000131698c4760 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
RSP=0x00000007a9d0d738 is pointing into the stack for thread: 0x000001316ad61540
RBP=0x00000131698c4760 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
RSI=0x00000000000003a0 is an unknown value
RDI=0x000001316ad617e8 points into unknown readable memory: 0x00007ffe1d0c47d0 | d0 47 0c 1d fe 7f 00 00
R8 =0x00000000000003a0 is an unknown value
R9 =0x0000000000000001 is an unknown value
R10=0x00000000c3a335a0 is an oop: java.lang.Class 
{0x00000000c3a335a0} - klass: 'java/lang/Class'
 - ---- fields (total size 14 words):
 - private volatile transient 'classRedefinedCount' 'I' @12  0
 - private volatile transient 'cachedConstructor' 'Ljava/lang/reflect/Constructor;' @40  a 'java/lang/reflect/Constructor'{0x00000000c3963b28} (c3963b28)
 - private transient 'name' 'Ljava/lang/String;' @44  "jdk.internal.reflect.GeneratedConstructorAccessor40"{0x00000000c3963ac8} (c3963ac8)
 - private transient 'module' 'Ljava/lang/Module;' @48  a 'java/lang/Module'{0x00000000c0315738} (c0315738)
 - private final 'classLoader' 'Ljava/lang/ClassLoader;' @52  a 'jdk/internal/reflect/DelegatingClassLoader'{0x00000000c3a33518} (c3a33518)
 - private transient 'classData' 'Ljava/lang/Object;' @56  NULL (0)
 - private transient 'packageName' 'Ljava/lang/String;' @60  "jdk.internal.reflect"{0x00000000c026de18} (c026de18)
 - private final 'componentType' 'Ljava/lang/Class;' @64  NULL (0)
 - private volatile transient 'reflectionData' 'Ljava/lang/ref/SoftReference;' @68  a 'java/lang/ref/SoftReference'{0x00000000c39639e0} (c39639e0)
 - private volatile transient 'genericInfo' 'Lsun/reflect/generics/repository/ClassRepository;' @72  NULL (0)
 - private volatile transient 'enumConstants' '[Ljava/lang/Object;' @76  NULL (0)
 - private volatile transient 'enumConstantDirectory' 'Ljava/util/Map;' @80  NULL (0)
 - private volatile transient 'annotationData' 'Ljava/lang/Class$AnnotationData;' @84  NULL (0)
 - private volatile transient 'annotationType' 'Lsun/reflect/annotation/AnnotationType;' @88  NULL (0)
 - transient 'classValueMap' 'Ljava/lang/ClassValue$ClassValueMap;' @92  NULL (0)
 - signature: Ljdk/internal/reflect/GeneratedConstructorAccessor40;
 - fake entry for mirror: 'jdk/internal/reflect/GeneratedConstructorAccessor40'
 - fake entry for array: NULL
 - fake entry for oop_size: 14
 - fake entry for static_oop_field_count: 0
R11=0x00000131698c4760 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
R12=0x0 is NULL
R13={method} {0x00000131100810b8} 'serialize' '(J)[B' in 'com/jme3/bullet/collision/shapes/infos/BoundingValueHierarchy'
R14=0x00000007a9d0d820 is pointing into the stack for thread: 0x000001316ad61540
R15=0x000001316ad61540 is a thread


Registers:
RAX=0x00000131698c4760, RBX=0x000001317487ceb0, RCX=0x000001317487ceb0, RDX=0x00000131698c4760
RSP=0x00000007a9d0d738, RBP=0x00000131698c4760, RSI=0x00000000000003a0, RDI=0x000001316ad617e8
R8 =0x00000000000003a0, R9 =0x0000000000000001, R10=0x00000000c3a335a0, R11=0x00000131698c4760
R12=0x0000000000000000, R13=0x00000131100810b0, R14=0x00000007a9d0d820, R15=0x000001316ad61540
RIP=0x00000001002d8c00, EFLAGS=0x0000000000010206


GC Precious Log:
 CPUs: 24 total, 24 available
 Memory: 32693M
 Large Page Support: Disabled
 NUMA Support: Disabled
 Compressed Oops: Enabled (32-bit)
 Heap Region Size: 1M
 Heap Min Capacity: 8M
 Heap Initial Capacity: 512M
 Heap Max Capacity: 1G
 Pre-touch: Disabled
 Parallel Workers: 18
 Concurrent Workers: 5
 Concurrent Refinement Workers: 18
 Periodic GC: Disabled

Heap:
 garbage-first heap   total 126976K, used 88757K [0x00000000c0000000, 0x0000000100000000)
  region size 1024K, 52 young (53248K), 3 survivors (3072K)
 Metaspace       used 27644K, committed 27904K, reserved 1081344K
  class space    used 2805K, committed 2944K, reserved 1048576K


Card table byte_map: [0x00000131630d0000,0x00000131632d0000] _byte_map_base: 0x0000013162ad0000

Marking Bits (Prev, Next): (CMBitMap*) 0x000001314fd3f130, (CMBitMap*) 0x000001314fd3f170
 Prev Bits: [0x00000131634d0000, 0x00000131644d0000)
 Next Bits: [0x00000131644d0000, 0x00000131654d0000)

Polling page: 0x000001314ef20000

Metaspace:

Usage:
  Non-class:     24.26 MB used.
      Class:      2.74 MB used.
       Both:     27.00 MB used.

Virtual space:
  Non-class space:       32.00 MB reserved,      24.38 MB ( 76%) committed,  4 nodes.
      Class space:        1.00 GB reserved,       2.88 MB ( <1%) committed,  1 nodes.
             Both:        1.03 GB reserved,      27.25 MB (  3%) committed. 

Chunk freelists:
   Non-Class:  3.38 MB
       Class:  1.13 MB
        Both:  4.51 MB

MaxMetaspaceSize: unlimited
CompressedClassSpaceSize: 1.00 GB
Initial GC threshold: 21.00 MB
Current GC threshold: 37.31 MB
CDS: off
MetaspaceReclaimPolicy: balanced
 - commit_granule_bytes: 65536.
 - commit_granule_words: 8192.
 - virtual_space_node_default_size: 1048576.
 - enlarge_chunks_in_place: 1.
 - new_chunks_are_fully_committed: 0.
 - uncommit_free_chunks: 1.
 - use_allocation_guard: 0.
 - handle_deallocations: 1.


Internal statistics:

num_allocs_failed_limit: 0.
num_arena_births: 264.
num_arena_deaths: 0.
num_vsnodes_births: 5.
num_vsnodes_deaths: 0.
num_space_committed: 434.
num_space_uncommitted: 0.
num_chunks_returned_to_freelist: 0.
num_chunks_taken_from_freelist: 725.
num_chunk_merges: 0.
num_chunk_splits: 465.
num_chunks_enlarged: 297.
num_purges: 0.
num_inconsistent_stats: 0.

CodeHeap 'non-profiled nmethods': size=119168Kb used=3196Kb max_used=3305Kb free=115971Kb
 bounds [0x000001315ac80000, 0x000001315afd0000, 0x00000131620e0000]
CodeHeap 'profiled nmethods': size=119104Kb used=6991Kb max_used=8864Kb free=112112Kb
 bounds [0x0000013153830000, 0x00000131540e0000, 0x000001315ac80000]
CodeHeap 'non-nmethods': size=7488Kb used=2037Kb max_used=3204Kb free=5450Kb
 bounds [0x00000131530e0000, 0x0000013153410000, 0x0000013153830000]
 total_blobs=5049 nmethods=4195 adapters=765
 compilation: enabled
              stopped_count=0, restarted_count=0
 full_count=0


Deoptimization events (20 events):
Event: 9.786 Thread 0x000001316ad61540 Uncommon trap: trap_request=0xffffff45 fr.pc=0x000001315ada62f4 relative=0x00000000000003f4
Event: 9.786 Thread 0x000001316ad61540 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000001315ada62f4 method=com.jme3.util.clone.Cloner.getCloneFunction(Ljava/lang/Class;)Lcom/jme3/util/clone/CloneFunction; @ 67 c2
Event: 9.786 Thread 0x000001316ad61540 DEOPT PACKING pc=0x000001315ada62f4 sp=0x00000007a9d0dac0
Event: 9.786 Thread 0x000001316ad61540 DEOPT UNPACKING pc=0x00000131531323a3 sp=0x00000007a9d0da88 mode 2
Event: 9.787 Thread 0x000001316ad61540 Uncommon trap: trap_request=0xffffffde fr.pc=0x000001315aead7bc relative=0x000000000000381c
Event: 9.787 Thread 0x000001316ad61540 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000001315aead7bc method=com.jme3.util.clone.ListCloneFunction.cloneObject(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)Ljava/lang/Object; @ 3 c2
Event: 9.787 Thread 0x000001316ad61540 DEOPT PACKING pc=0x000001315aead7bc sp=0x00000007a9d0e0d0
Event: 9.787 Thread 0x000001316ad61540 DEOPT UNPACKING pc=0x00000131531323a3 sp=0x00000007a9d0e078 mode 2
Event: 9.787 Thread 0x000001316ad61540 Uncommon trap: trap_request=0xffffffde fr.pc=0x000001315aead7bc relative=0x000000000000381c
Event: 9.787 Thread 0x000001316ad61540 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000001315aead7bc method=com.jme3.util.clone.ListCloneFunction.cloneObject(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)Ljava/lang/Object; @ 3 c2
Event: 9.787 Thread 0x000001316ad61540 DEOPT PACKING pc=0x000001315aead7bc sp=0x00000007a9d0e0d0
Event: 9.787 Thread 0x000001316ad61540 DEOPT UNPACKING pc=0x00000131531323a3 sp=0x00000007a9d0e078 mode 2
Event: 9.787 Thread 0x000001316ad61540 Uncommon trap: trap_request=0xffffffde fr.pc=0x000001315aead7bc relative=0x000000000000381c
Event: 9.787 Thread 0x000001316ad61540 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000001315aead7bc method=com.jme3.util.clone.ListCloneFunction.cloneObject(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)Ljava/lang/Object; @ 3 c2
Event: 9.787 Thread 0x000001316ad61540 DEOPT PACKING pc=0x000001315aead7bc sp=0x00000007a9d0e0d0
Event: 9.787 Thread 0x000001316ad61540 DEOPT UNPACKING pc=0x00000131531323a3 sp=0x00000007a9d0e078 mode 2
Event: 9.790 Thread 0x000001316ad61540 Uncommon trap: trap_request=0xffffffde fr.pc=0x000001315aead7bc relative=0x000000000000381c
Event: 9.790 Thread 0x000001316ad61540 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000001315aead7bc method=com.jme3.util.clone.ListCloneFunction.cloneObject(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)Ljava/lang/Object; @ 3 c2
Event: 9.790 Thread 0x000001316ad61540 DEOPT PACKING pc=0x000001315aead7bc sp=0x00000007a9d0de50
Event: 9.790 Thread 0x000001316ad61540 DEOPT UNPACKING pc=0x00000131531323a3 sp=0x00000007a9d0ddf8 mode 2

Classes unloaded (0 events):
No events

Classes redefined (0 events):
No events

Internal exceptions (20 events):
Event: 9.775 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ff9948}> (0x00000000c4ff9948) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.775 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ffa1a8}> (0x00000000c4ffa1a8) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.778 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4e47e18}> (0x00000000c4e47e18) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.778 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4e483d0}> (0x00000000c4e483d0) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ebec58}> (0x00000000c4ebec58) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ebf210}> (0x00000000c4ebf210) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ec1b08}> (0x00000000c4ec1b08) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ec20c0}> (0x00000000c4ec20c0) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ed2bc8}> (0x00000000c4ed2bc8) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ed3180}> (0x00000000c4ed3180) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ed5a68}> (0x00000000c4ed5a68) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4ed6020}> (0x00000000c4ed6020) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4edc9f8}> (0x00000000c4edc9f8) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.783 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4edcfb0}> (0x00000000c4edcfb0) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.784 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4edf8a8}> (0x00000000c4edf8a8) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.784 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4edfe60}> (0x00000000c4edfe60) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.795 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4cf50f0}> (0x00000000c4cf50f0) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.795 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4cf56a8}> (0x00000000c4cf56a8) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.796 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4cfc0b8}> (0x00000000c4cfc0b8) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]
Event: 9.796 Thread 0x000001316ad61540 Exception <a 'java/io/IOException'{0x00000000c4cfc670}> (0x00000000c4cfc670) 
thrown [s\src\hotspot\share\prims\jni.cpp, line 516]


dbghelp: loaded successfully - version: 4.0.5 - missing functions: none
symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;D:\Users\kevinba\Downloads\sajam-win;C:\Windows\SYSTEM32;D:\Users\kevinba\Downloads\sajam-win\jre\bin;D:\Users\kevinba\Downloads\sajam-win\jre\bin\server;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.3636_none_7931fb75243f97c8;C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445

VM Arguments:
jvm_args: -Xmx1G 
java_command: <unknown>
java_class_path (initial): <not set>
Launcher Type: generic

[Global flags]
     intx CICompilerCount                          = 12                                        {product} {ergonomic}
     uint ConcGCThreads                            = 5                                         {product} {ergonomic}
     uint G1ConcRefinementThreads                  = 18                                        {product} {ergonomic}
   size_t G1HeapRegionSize                         = 1048576                                   {product} {ergonomic}
    uintx GCDrainStackTargetSize                   = 64                                        {product} {ergonomic}
   size_t InitialHeapSize                          = 536870912                                 {product} {ergonomic}
   size_t MarkStackSize                            = 4194304                                   {product} {ergonomic}
   size_t MaxHeapSize                              = 1073741824                                {product} {command line}
   size_t MaxNewSize                               = 643825664                                 {product} {ergonomic}
   size_t MinHeapDeltaBytes                        = 1048576                                   {product} {ergonomic}
   size_t MinHeapSize                              = 8388608                                   {product} {ergonomic}
    uintx NonNMethodCodeHeapSize                   = 7602480                                {pd product} {ergonomic}
    uintx NonProfiledCodeHeapSize                  = 122027880                              {pd product} {ergonomic}
    uintx ProfiledCodeHeapSize                     = 122027880                              {pd product} {ergonomic}
    uintx ReservedCodeCacheSize                    = 251658240                              {pd product} {ergonomic}
     bool SegmentedCodeCache                       = true                                      {product} {ergonomic}
   size_t SoftMaxHeapSize                          = 1073741824                             {manageable} {ergonomic}
     bool UseCompressedClassPointers               = true                           {product lp64_product} {ergonomic}
     bool UseCompressedOops                        = true                           {product 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




---------------  S Y S T E M  ---------------

OS:
 Windows 10 , 64 bit Build 19041 (10.0.19041.3636)
OS uptime: 0 days 9:27 hours

CPU: total 24 (initial active 24) (24 cores per cpu, 2 threads per core) family 25 model 33 stepping 2 microcode 0x0, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt

Memory: 4k page, system-wide physical 32693M (22332M free)
TotalPageFile size 37557M (AvailPageFile size 23306M)
current process WorkingSet (physical memory assigned to process): 490M, peak: 492M
current process commit charge ("private bytes"): 796M, peak: 798M

vm_info: OpenJDK 64-Bit Server VM (17.0.5+8-adhoc..jdk17u) for windows-amd64 JRE (17.0.5+8-adhoc..jdk17u), built on Jun  8 2023 10:23:55 by "" with MS VC++ 16.10 / 16.11 (VS2019)

END.

Thanks you. I know of this issue.
I am still trying to figure out what could cause this.

1 Like

@sgold , could this error I am experiencing be something in the version of Minie I am using?

1 Like

It’s clearly physics-related. Which version of Minie do you use?

If you can reproduce the crash easily, try reproducing it with the corresponding “Minie-x.y.z+debug” library.

I’m going to split this discussion to a new thread.

Let me try that today. Maybe I can get to the problem using this debug method. Thanks.

1 Like

Hi, I just wanted to say that the problem still seems to exist in Minie 8.0.0 (and 7.8.1, which I quickly tested) - It crashes when I try to write a CompoundCollisionShape into a .j3o (same stack trace as for the OP).
However, my usecase was saving/loading a precomputed collision shape for a static scene chunk, so I anyways went to batching the stuff together and saved 1 MeshCollisionShape into the .j3o. This is more performant later on when running the physics and also worked in regards to de-/serialization. Maybe it helps someone else stumbling over this.

3 Likes

@destroflyer: I’d like to get to the bottom of this issue.
What happens if you try to reproduce it using the Minie-8.0.0+debug library?

Hi!

I just found that I’m having the exact same issue when loading some j3o files in my game. Apart from the regular data (geometry and so), my models hava a mesh shape and a vhacd shape stored as user data of the spatial to avoid calculating them in the game. I’ve found that only two j3o files fail when loading, all other (which have been created the same way) work flawlessly. This happens only on windows and I’ve tested both Minie-4.4.0 and Minie-7.7.0 with the same result.

If required, I could try latest minie, even the debug release you’re pointing. Or, if you prefer, send you the j3o files that fail, so you can try it by yourself.

Here’s my crash log just in case it would help, although I don’t think it will being almost the same:

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

Current thread (0x00000165b7647800):  JavaThread "Thread-11" [_thread_in_native, id=11940, stack(0x0000001c37a70000,0x0000001c37b70000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000000

Registers:
RAX=0x0000000000000000, RBX=0x00000165c15ed270, RCX=0x0000000000000000, RDX=0x0000000000000000
RSP=0x0000001c37b6dc20, RBP=0x0000000000000087, RSI=0x0000000000000087, RDI=0x00000165c151aac0
R8 =0x0000000000000010, R9 =0x0000000000000087, R10=0x00007ffc23e996f0, R11=0x00000165c15ed270
R12=0x0000000000000000, R13=0x00000165beceac00, R14=0x0000000000000001, R15=0x00000165c15ed370
RIP=0x00007ffc23e1d7ce, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x0000001c37b6dc20)
0x0000001c37b6dc20:   000000071d6a5dd8 000000005978f735
0x0000001c37b6dc30:   00000000000009b0 00007ffc23e4db7e
0x0000001c37b6dc40:   00000165b7647800 0000001c37b6dd48
0x0000001c37b6dc50:   0000000000000000 00000165b7647a60
0x0000001c37b6dc60:   00000000000009b0 00007ffc23dd0166
0x0000001c37b6dc70:   00000165c151aac0 00000165c151aac0
0x0000001c37b6dc80:   00000165c15ed270 00007ffc23e4db7e
0x0000001c37b6dc90:   0000000000000010 000001653f800000
0x0000001c37b6dca0:   00000007c0232228 00000165838b9c8e
0x0000001c37b6dcb0:   00000165beceac00 0000001c37b6dd20
0x0000001c37b6dcc0:   0000000000001760 00000165b7647800
0x0000001c37b6dcd0:   0000001c37b6dd88 0000000000000000
0x0000001c37b6dce0:   0000001c37b6dce0 0000000000000000
0x0000001c37b6dcf0:   0000001c37b6dd48 00000165beceadf0
0x0000001c37b6dd00:   0000000000000000 00000165beceac00
0x0000001c37b6dd10:   0000000000000000 0000001c37b6dd40 

Instructions: (pc=0x00007ffc23e1d7ce)
0x00007ffc23e1d7ae:   0f 8e d0 01 00 00 45 84 f6 0f 84 09 01 00 00 4d
0x00007ffc23e1d7be:   8b c4 4c 8b ce 48 8b 87 c0 00 00 00 4d 8d 40 10
0x00007ffc23e1d7ce:   41 0f b7 4c 00 f0 48 8b 83 c0 00 00 00 66 c1 c1
0x00007ffc23e1d7de:   08 66 41 89 4c 00 f0 48 8b 87 c0 00 00 00 41 0f 


Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x00000165c15ed270 is an unknown value
RCX=0x0000000000000000 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x0000001c37b6dc20 is pointing into the stack for thread: 0x00000165b7647800
RBP=0x0000000000000087 is an unknown value
RSI=0x0000000000000087 is an unknown value
RDI=0x00000165c151aac0 is an unknown value
R8 =0x0000000000000010 is an unknown value
R9 =0x0000000000000087 is an unknown value
R10=0x00007ffc23e996f0 is an unknown value
R11=0x00000165c15ed270 is an unknown value
R12=0x0000000000000000 is an unknown value
R13={method} {0x00000165beceac08} 'serialize' '(J)[B' in 'com/jme3/bullet/collision/shapes/infos/BoundingValueHierarchy'
R14=0x0000000000000001 is an unknown value
R15=0x00000165c15ed370 is an unknown value


Stack: [0x0000001c37a70000,0x0000001c37b70000],  sp=0x0000001c37b6dc20,  free space=1015k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [bulletjme.dll+0xfd7ce]
C  [bulletjme.dll+0xb0166]
C  0x00000165838b9c8e

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy.serialize(J)[B+0
j  com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy.serialize()[B+6
j  com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+6
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 3200 C1 com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;)Ljava/lang/Object; (7 bytes) @ 0x00000165841aa284 [0x00000165841aa200+0x84]
j  com.jme3.bullet.collision.shapes.MeshCollisionShape.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+27
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 4037 C1 com.jme3.bullet.collision.shapes.infos.ChildCollisionShape.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V (46 bytes) @ 0x000001658439c8fc [0x000001658439c7a0+0x15c]
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 3504 C1 com.jme3.util.clone.ListCloneFunction.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/util/List;Ljava/util/List;)V (42 bytes) @ 0x000001658424897c [0x00000165842487c0+0x1bc]
J 3503 C1 com.jme3.util.clone.ListCloneFunction.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;Ljava/lang/Object;)V (14 bytes) @ 0x0000016584256b44 [0x00000165842568c0+0x284]
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+238
J 3200 C1 com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;)Ljava/lang/Object; (7 bytes) @ 0x00000165841aa284 [0x00000165841aa200+0x84]
j  com.jme3.bullet.collision.shapes.CompoundCollisionShape.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+12
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 3759 C1 com.jme3.scene.Spatial.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V (227 bytes) @ 0x00000165842c348c [0x00000165842c1a80+0x1a0c]
j  com.jme3.scene.Node.cloneFields(Lcom/jme3/util/clone/Cloner;Ljava/lang/Object;)V+3
j  com.jme3.util.clone.Cloner.clone(Ljava/lang/Object;Z)Ljava/lang/Object;+433
J 3870 C1 com.jme3.scene.Spatial.clone(Z)Lcom/jme3/scene/Spatial; (70 bytes) @ 0x0000016584324ebc [0x00000165843248c0+0x5fc]
j  com.jme3.scene.Node.clone(Z)Lcom/jme3/scene/Node;+2
j  com.jme3.scene.Node.clone(Z)Lcom/jme3/scene/Spatial;+2
j  com.jme3.scene.Spatial.clone()Lcom/jme3/scene/Spatial;+2
j  com.jme3.scene.Spatial.clone()Ljava/lang/Object;+1
j  com.jme3.asset.CloneableAssetProcessor.createClone(Ljava/lang/Object;)Ljava/lang/Object;+6
j  com.jme3.asset.DesktopAssetManager.registerAndCloneSmartAsset(Lcom/jme3/asset/AssetKey;Ljava/lang/Object;Lcom/jme3/asset/AssetProcessor;Lcom/jme3/asset/cache/AssetCache;)Ljava/lang/Object;+16
J 3708 C1 com.jme3.asset.DesktopAssetManager.loadAsset(Lcom/jme3/asset/AssetKey;)Ljava/lang/Object; (220 bytes) @ 0x000001658429efcc [0x000001658429d500+0x1acc]
j  com.jme3.asset.DesktopAssetManager.loadModel(Lcom/jme3/asset/ModelKey;)Lcom/jme3/scene/Spatial;+2
j  com.jme3.asset.DesktopAssetManager.loadModel(Ljava/lang/String;)Lcom/jme3/scene/Spatial;+9
..........
2 Likes

@joliver82 :
Thank you for getting in touch. I may have been careless in maintaining J3O compatibility across platforms and Minie releases.

Could you re-generate the problematic J3O files on Windows using Minie-8.0.0+debug and then load the re-generated J3Os using Minie-8.0.0+debug?

I’ve been doing some tests with Minie8-debug using the two models that are failing for me:

  • Loading the failing models → fails same way as with the other minie releases
  • Generating them from linux (I have it all scripted) and trying loading them from windows → Works on linux, fails on windows
  • Generating them from windows and loading from windows → Fails to generate one of them and the other loads or fails randomly

This is the error output when generating (fails in the exact same native call):

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

Current thread (0x000001ca7ae75800):  JavaThread "jME3 Headless Main" [_thread_in_native, id=29624, stack(0x00000039d6e00000,0x00000039d6f00000)]

siginfo: ExceptionCode=0xc0000005, reading address 0xffffffffffffffff

Registers:
RAX=0xdddddddddddddddd, RBX=0x000001ca7b7c7328, RCX=0x000001ca7afefa80, RDX=0x000001ca7c832080
RSP=0x00000039d6efe290, RBP=0x00000039d6efe368, RSI=0x0000000000000008, RDI=0x00000000000002f0
R8 =0x0000000099999a70, R9 =0x000001ca7c832001, R10=0x00007ffc24050000, R11=0x0000000000000000
R12=0x0000000000000000, R13=0x000001ca7b7c7328, R14=0x00000039d6efe390, R15=0x000001ca7ae75800
RIP=0x00007ffc242cf671, EFLAGS=0x0000000000010206

Top of Stack: (sp=0x00000039d6efe290)
0x00000039d6efe290:   0000000099999a70 000001ca00000010
0x00000039d6efe2a0:   0000000715980c78 00000039d6efe300
0x00000039d6efe2b0:   00000039d6efe360 000001ca663b841c
0x00000039d6efe2c0:   99999a707ae75800 000001ca7afefa80
0x00000039d6efe2d0:   000001ca7c832080 00000000597a03ab
0x00000039d6efe2e0:   0000000000000080 000001ca660f9c8e
0x00000039d6efe2f0:   000001ca7ae75a60 00000039d6efe378
0x00000039d6efe300:   000001ca7afefa80 000001ca660e7b00
0x00000039d6efe310:   0000000000000008 0000000717384b68
0x00000039d6efe320:   00000039d6efe320 00000039d6efe328
0x00000039d6efe330:   0000000000000000 00000039d6efe390
0x00000039d6efe340:   000001ca7b7c7520 0000000000000000
0x00000039d6efe350:   000001ca7b7c7328 0000000000000000
0x00000039d6efe360:   00000039d6efe388 00000039d6efe3d8
0x00000039d6efe370:   000001ca660e7e40 00000007172d9630
0x00000039d6efe380:   000001ca660f2abb 000001ca7afefa80 

Instructions: (pc=0x00007ffc242cf671)
0x00007ffc242cf651:   ff 48 89 44 24 40 48 8b 44 24 38 48 8b 00 41 b1
0x00007ffc242cf661:   01 44 8b 44 24 34 48 8b 54 24 40 48 8b 4c 24 38
0x00007ffc242cf671:   ff 50 10 88 44 24 30 0f b6 44 24 30 85 c0 75 1c
0x00007ffc242cf681:   4c 8d 05 88 f9 35 00 48 8b 15 99 e7 43 00 48 8b 


Register to memory mapping:

RAX=0xdddddddddddddddd is an unknown value
RBX={method} {0x000001ca7b7c7330} 'serialize' '(J)[B' in 'com/jme3/bullet/collision/shapes/infos/BoundingValueHierarchy'
RCX=0x000001ca7afefa80 is an unknown value
RDX=0x000001ca7c832080 is an unknown value
RSP=0x00000039d6efe290 is pointing into the stack for thread: 0x000001ca7ae75800
RBP=0x00000039d6efe368 is pointing into the stack for thread: 0x000001ca7ae75800
RSI=0x0000000000000008 is an unknown value
RDI=0x00000000000002f0 is an unknown value
R8 =0x0000000099999a70 is an unknown value
R9 =0x000001ca7c832001 is an unknown value
R10=0x00007ffc24050000 is an unknown value
R11=0x0000000000000000 is an unknown value
R12=0x0000000000000000 is an unknown value
R13={method} {0x000001ca7b7c7330} 'serialize' '(J)[B' in 'com/jme3/bullet/collision/shapes/infos/BoundingValueHierarchy'
R14=0x00000039d6efe390 is pointing into the stack for thread: 0x000001ca7ae75800
R15=0x000001ca7ae75800 is a thread


Stack: [0x00000039d6e00000,0x00000039d6f00000],  sp=0x00000039d6efe290,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [bulletjme.dll+0x27f671]
C  0x000001ca660f9c8e

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy.serialize(J)[B+0
j  com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy.serialize()[B+6
j  com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy.write(Lcom/jme3/export/JmeExporter;)V+9
j  com.jme3.export.binary.BinaryExporter.processBinarySavable(Lcom/jme3/export/Savable;)I+106
j  com.jme3.export.binary.BinaryOutputCapsule.write(Lcom/jme3/export/Savable;)V+15
j  com.jme3.export.binary.BinaryOutputCapsule.write(Lcom/jme3/export/Savable;Ljava/lang/String;Lcom/jme3/export/Savable;)V+15
j  com.jme3.bullet.collision.shapes.MeshCollisionShape.write(Lcom/jme3/export/JmeExporter;)V+21
j  com.jme3.export.binary.BinaryExporter.processBinarySavable(Lcom/jme3/export/Savable;)I+106
j  com.jme3.export.binary.BinaryOutputCapsule.write(Lcom/jme3/export/Savable;)V+15
j  com.jme3.export.binary.BinaryOutputCapsule.write(Lcom/jme3/export/Savable;Ljava/lang/String;Lcom/jme3/export/Savable;)V+15
j  com.jme3.bullet.collision.shapes.infos.ChildCollisionShape.write(Lcom/jme3/export/JmeExporter;)V+42
j  com.jme3.export.binary.BinaryExporter.processBinarySavable(Lcom/jme3/export/Savable;)I+106
j  com.jme3.export.binary.BinaryOutputCapsule.write(Lcom/jme3/export/Savable;)V+15
j  com.jme3.export.binary.BinaryOutputCapsule.writeSavableArrayList(Ljava/util/ArrayList;)V+44
j  com.jme3.export.binary.BinaryOutputCapsule.writeSavableArrayList(Ljava/util/ArrayList;Ljava/lang/String;Ljava/util/ArrayList;)V+15
j  com.jme3.bullet.collision.shapes.CompoundCollisionShape.write(Lcom/jme3/export/JmeExporter;)V+22
j  com.jme3.export.binary.BinaryExporter.processBinarySavable(Lcom/jme3/export/Savable;)I+106
j  com.jme3.export.binary.BinaryOutputCapsule.write(Lcom/jme3/export/Savable;)V+15
j  com.jme3.export.binary.BinaryOutputCapsule.write([Lcom/jme3/export/Savable;)V+28
j  com.jme3.export.binary.BinaryOutputCapsule.writeStringSavableMap(Ljava/util/Map;)V+65
j  com.jme3.export.binary.BinaryOutputCapsule.writeStringSavableMap(Ljava/util/Map;Ljava/lang/String;Ljava/util/Map;)V+15
j  com.jme3.scene.Spatial.write(Lcom/jme3/export/JmeExporter;)V+181
j  com.jme3.scene.Node.write(Lcom/jme3/export/JmeExporter;)V+2
j  com.jme3.export.binary.BinaryExporter.processBinarySavable(Lcom/jme3/export/Savable;)I+106
j  com.jme3.export.binary.BinaryExporter.save(Lcom/jme3/export/Savable;Ljava/io/OutputStream;)V+57
j  com.jme3.export.binary.BinaryExporter.save(Lcom/jme3/export/Savable;Ljava/io/File;)V+46

I can send you the models (original and j3o) and also the code I’m using to generate the j3o files or try to debug it myself, but I will need some hints on debugging jni native code on windows+netbeans

1 Like

Thank you all for looking into this.

:star_struck:

2 Likes

Thank you for the two crash logs. While the code location of the crash is the same in both logs, the contexts seem to me very different.

The first log records a crash while loading a model containing a mesh collision shape that’s part of a compound shape. It occurred on Windows in a non-debug Minie library. The model was successfully loaded into the asset cache. The crash occurred while deep-cloning the cached model to create a copy for application use.

  • In order to clone the model, JME had to clone the bounding value hierarchy (BVH) of its mesh shape.
  • The cloning process involves serializing the BVH to a byte array and then de-serializing that array.
  • The crash occurred while serializing the BVH.

The second log records a crash while saving a similar model. It also occurred on Windows, but in a debug Minie library.

  • In order to save the model, JME had to save the bounding value hierarchy (BVH) of its mesh shape.
  • The save process involves serializing the BVH to a byte array and then writing that array to a stream.
  • The crash occurred while serializing the BVH.

Serializing a BVH is a frequent occurrence, one which gets automatically tested each time Minie is built from source. There’s a GitHub Actions job that tests each pushed commit on multiple platforms, including Windows.

However, loading a model saved on a different platform is rarely tested. Here’s what’s supposed to happen:

  1. When the MeshCollisionShape is saved, the value of JmeSystem.getPlatform() is written to the file along with the serialized BVH bytes.
  2. When the MeshCollisionShape is loaded, Minie compares the value of JmeSystem.getPlatform() with the value read from the file. If they match, it generates the BVH by de-serializing the bytes. If they don’t match, it re-generates the BVH from scratch.

It’s easy to imagine ways this scheme might break. For instance, if the BVH bytes for a particular mesh shape depend on something other than the platform. (The only reason Minie attempts BVH de-serialization is because generating BVH from scratch can be costly.)

It’s harder to imagine what might cause a crash while saving a model. I wonder, for instance, if the model is unusually large.

I think the next step would be for me to try to reproduce the model-generation crash on Windows. Please provide me with instructions for reproducing that crash.

2 Likes

Thanks for the details explanation. Clearly understood :wink: but what concerns me is that the model saved in windows also fails to load in windows randomly (3 out of 5 times) with similar crash log :confused:

I’m copying you the code I’m using to write the j3o file, attaching you the gltf and giving you instructions.

First of all the code. It’s just a quick jme3 app to load a model, generate tangents if they don’t exist and also generate the mesh shapes as stated in my previous post:

package mygame;

import com.jme3.app.SimpleApplication;
import com.jme3.asset.plugins.FileLocator;
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.control.GhostControl;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.bullet.util.CollisionShapeFactory;
import com.jme3.export.binary.BinaryExporter;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.VertexBuffer;
import com.jme3.scene.plugins.blender.BlenderLoader;
import com.jme3.system.JmeContext;
import com.jme3.util.TangentBinormalGenerator;
import com.jme3.util.mikktspace.MikktspaceTangentGenerator;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import vhacd.VHACDParameters;

/**
 * This is the Main Class of your Game. You should only do initialization here.
 * Move your Logic into AppStates or Controls
 * @author normenhansen
 */
public class Main extends SimpleApplication {

    public static String []publicArgs;
    
    public static void main(String[] args) {
        Main.publicArgs=args;
        Main app = new Main();
        app.setShowSettings(false);
        app.start(JmeContext.Type.Headless);
    }

    @Override
    public void simpleInitApp() {

        
        if(publicArgs.length<3)
        {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "Error: not enough parameters:");
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "\tPath to get the files from");
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "\tInput File");
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "\tOutput File");
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "\t--mesh to use the full mesh as base of the v-hacd shape instead of the collider");
            System.exit(-1);
        }
        
        assetManager.registerLocator(publicArgs[0], FileLocator.class);
        assetManager.registerLoader(BlenderLoader.class, "blend");

        Spatial geomPhy = assetManager.loadModel(publicArgs[1]);
        
        //Take the time to generate tangents in case the model doesn't have them
        if(!hasTangents(geomPhy))
        {
            System.out.println("Generating tangents");
            try
            {
                MikktspaceTangentGenerator.generate(geomPhy);
            }
            catch(Exception e)
            {
                System.out.println("Mikktspace failed, falling back to legacy tangents");
                TangentBinormalGenerator.generate(geomPhy);
            }
            System.out.println("Tangents generated");
        }
        else
        {
            System.out.println("Model already has tangents");
        }
        
        
        //Create the required physic stuff
        Spatial collider=null;
        ArrayList<Spatial> colliders=findSpatials(geomPhy, "collider");
        if(colliders!=null && ! colliders.isEmpty())
        {
            System.out.println("Model has a collider");
            collider=colliders.get(0);
            //Avoid collider to be rendered
            //colliders.get(0).removeFromParent();
        }
        else
        {
            System.out.println("Model doesn't have a collider");
            collider=geomPhy;
        }
        
        CollisionShape meshShape=CollisionShapeFactory.createMeshShape(collider);
        //New method using V-HACD instead of gimpact or mesh
        // TODO: fine tune this?
        VHACDParameters params=new VHACDParameters();
        CollisionShape vhacdShape;
        if(publicArgs.length>=4 && publicArgs[3].equals("--mesh"))
        {
            vhacdShape=CollisionShapeFactory.createVhacdShape(geomPhy, params, null);
        }
        else
        {
            vhacdShape=CollisionShapeFactory.createVhacdShape(collider, params, null);
        }

        geomPhy.setUserData("meshShape", meshShape);
        geomPhy.setUserData("vhacdShape", vhacdShape);
        
        // Don't create the controls, we're creating them from RR code using the saved shapes
        /*
        RigidBodyControl geomCtl=geomPhy.getControl(RigidBodyControl.class);
        if(geomCtl==null)
        {
            geomCtl=new RigidBodyControl(
                    meshShape,
                    0);
            geomPhy.addControl(geomCtl);
        }
        
        GhostControl gControl=geomPhy.getControl(GhostControl.class);
        // We want the assets to have the v-hacd ghost control already defined and saved in the j3o
        if(gControl==null)
        {
            gControl=new GhostControl(vhacdShape);
            geomPhy.addControl(gControl);
        }
        */
        
        System.out.println("Physic information generated");
        

        //Save file
        BinaryExporter exporter = BinaryExporter.getInstance();
        if(!publicArgs[2].endsWith(".j3o"))
        {
            publicArgs[2]=publicArgs[2]+".j3o";
        }
        File file = new File(publicArgs[0]+"/"+publicArgs[2]);
        try {
            exporter.save(geomPhy, file);
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "Error: Failed to save game!", ex);
            System.exit(1);
        }
        
        System.out.println("Model saved");
        System.exit(0);
    }

    @Override
    public void simpleUpdate(float tpf) {
        //TODO: add update code
    }

    @Override
    public void simpleRender(RenderManager rm) {
        //TODO: add render code
    }


    /**
     * Locates all spatials that contain the asked name
     * 
     * @param spatial
     * @param name
     * @return 
     */
    public static ArrayList<Spatial> findSpatials(Spatial spatial, String name){
        ArrayList<Spatial> spatials=new ArrayList<Spatial>();
        if (spatial.getName()!=null && spatial.getName().contains(name))
        {
            spatials.add(spatial);
            return spatials;
            
        }else if (spatial instanceof Node){
            Node node = (Node) spatial;
            for (int i = 0; i < node.getQuantity(); i++){
                Spatial child = node.getChild(i);
                spatials.addAll( findSpatials(child, name) );
            }
            return spatials;
        }
        return spatials;
    }
    
    public ArrayList<Geometry> findAllGeoms(Spatial spatial){
        ArrayList<Geometry> geoms=new ArrayList<Geometry>();
        if (spatial instanceof Node){
            Node node = (Node) spatial;
            for (int i = 0; i < node.getQuantity(); i++){
                Spatial child = node.getChild(i);
                geoms.addAll( findAllGeoms(child) );
            }
            return geoms;
        }else if (spatial instanceof Geometry){
            geoms.add((Geometry)spatial);
            return geoms;
        }
        return geoms;
    }

    public boolean hasTangents(Spatial s)
    {
        boolean ret=true;
        ArrayList<Geometry> geoms=findAllGeoms(s);
        
        for(int i=0; i<geoms.size() && ret ; ++i)
        {
            Mesh m = geoms.get(i).getMesh();
            if(m!=null && m.getBuffer(VertexBuffer.Type.Tangent)==null)
            {
                ret=false;
            }
        }
        
        return ret;
    }    
}

Don’t blame me for the code style, it’s just a quick&dirty internal tool for generating the final j3o’s for my game

The app gets 3 parameters: “path where the origin file is located” “name of the file to read” “name of the destination file”. The resulting file is stored in the path stated in the first argument

I’m sharing you a folder in GDrive so you can download the gltf files: sgold_minie_issue – Google Drive

There’s two of them. Both are similar and really simple and low poly. If I remember correctly, tv.gltf is the one that fails to save and pc-screen.gltf is the one that can be saved but fails to load randomly

I hope this helps you address the issue.

I forgot to mention… I’m using windows 10 and I’ve tested with multiple java 1.8 versions (from oracle and also from adoptium) with the same results.

If there’s anything else I can do to help with this just tell me

1 Like

Curious why this was done? Are you worried about byte ordering or something?

1 Like

Curious why this was done? Are you worried about byte ordering or something?

It was done (in Minie v0.7.2) in response to a post by @Empire_Phoenix:

I never investigated whether the incompatibility was due to byte ordering, C++ int widths, or something else.

EP’s reply was March 2019, and it reads as if their observations were old at that point. It wouldn’t surprise me if the incompatibility were a bug in Bullet that got solved at some point.

Honestly I don’t see why could be related to byte ordering while we’re in the same arch. Also as far as I know bullet supports videogame consoles (at least ps3 and xbx360), in which the archs are different and I assume developers are not creating the assets using the consoles :stuck_out_tongue:

Being that said, I’ve been reading a bit of bullet code and although not sure at all, I think the incompatibility among OS’s could be related to how the buffer is allocated in btAlignedAlloc:

Windows → uses _aligned_malloc → bullet3/src/LinearMath/btAlignedAllocator.cpp at e9c461b0ace140d5c73972760781d94b7b5eee53 · bulletphysics/bullet3 · GitHub
PS3 → uses memalign (which I assume is the equivalent of _aligned_malloc) → bullet3/src/LinearMath/btAlignedAllocator.cpp at e9c461b0ace140d5c73972760781d94b7b5eee53 · bulletphysics/bullet3 · GitHub
Other platforms → uses sAllocFunc, which ends up being a regular malloc + btAlignPointer → bullet3/src/LinearMath/btAlignedAllocator.cpp at e9c461b0ace140d5c73972760781d94b7b5eee53 · bulletphysics/bullet3 · GitHub

Probably for other platforms could/should be used aligned_alloc (aligned_alloc - cppreference.com) instead of the current malloc + btAAlignPointer

Also, although probably not that optimized, for compatibility, btAlignedAllocSetCustomAligned could be used to set functions equivalent to other platforms’s btAlignedAllocDefault and btAlignedFreeDefault (the one with malloc stuff) so the memory is allocated and ordered in the same way for all platforms. In fact, doing it this way, you could avoid having to rebuild the BVH when loading an asset from a different platform

Just my 2cents.

3 Likes

Dumping a raw buffer to disk and calling that “serialization” is such a C-programmer thing to do.

4 Likes

what concerns me is that the model saved in windows also fails to load in windows randomly (3 out of 5 times)

I agree that’s a concern, but the first step is to understand why serialization sometimes fails. Before debugging the load, I want some confidence that its input (the saved model) isn’t corrupted.

If I remember correctly, tv.gltf is the one that fails to save and pc-screen.gltf is the one that can be saved but fails to load randomly

Using “pc-screen.gltf” on Windows 11, I reproduced the access violation during save. “tv.gltf” is the model that can be saved successfully.

To narrow things down, I modified the test app to save meshShape instead of geomPhy, and (using “pc-screen.gltf”) that also crashed repeatably.

Since meshShape is actually a CompoundCollisionShape with 2 children, I tried saving each child one at a time; only the second child crashed. So the issue is specific to that shape. Then I extracted its BVH data and verified that simply invoking the serialize() method is sufficient to cause a crash.

I’ve developed a simpler test app and opened a new issue.

2 Likes

Thanks for the effort working in this issue. As said, if you need anything else from my side, just ask

1 Like

May I redistribute the test data via GitHub?
I’m thinking specifically about “pc-screen.gltf” …