MizunagiKB / gd_cubism

Unofficial Live2D Player for Godot Engine
https://mizunagikb.github.io/gd_cubism/
Other
111 stars 17 forks source link

Godot/live2d crash when loading models other than samples.. #75

Closed pillowtrucker closed 2 months ago

pillowtrucker commented 3 months ago

Hi! I've been trying to load https://github.com/n0099/TouhouCannonBall-Live2d-Models/tree/main/Rinnosuke and/or https://github.com/andatoshiki/toshiki-live2d/tree/master/%E4%B8%BA%E7%BE%8E%E5%A5%BD%E7%9A%84%E4%B8%96%E7%95%8C%E7%8C%AE%E4%B8%8A%E7%A5%9D%E7%A6%8F%EF%BC%81Fantastic%20Days/1399100 on linux. When I load the asset to attach it to the Model node, godot crashes with free(): corrupted unsorted chunks or

Fatal glibc error: malloc.c:2594 (sysmalloc): assertion failed: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)

I'm not able to get any more information from gdb because godot exits instead of propagating the error...

When I try the same thing with the Niziiro Mao model, everything works fine... I'm running godot 4.2.1-stable. I've tried building with llvm and with gcc, but there was no difference. Any idea what I'm doing wrong ?

pillowtrucker commented 3 months ago

I figured out how to get more useful debug info:

 ❯ gdb --args ./result/bin/godot4 -e --path ~/if_your_happy_and_you_know_it/ext/gd_cubism/demo                                                                                    [21:48:28]
GNU gdb (GDB) 14.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./result/bin/godot4...
(No debugging symbols found in ./result/bin/godot4)
(gdb) r
Starting program: /nix/store/jc93qvp6dw9blm3mx2p74mpmzk913xkj-godot-4.2.1-stable/bin/godot4 -e --path /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo
[Thread debugging using libthread_db enabled]                                                                                                                                                
Using host libthread_db library "/nix/store/mwc1xw8q08l1jgc1zralfvcrdi5f5dzj-glibc-2.38-44/lib/libthread_db.so.1".
[Detaching after vfork from child process 2197476]
[New Thread 0x7ffff6c006c0 (LWP 2197478)]
[New Thread 0x7ffff62006c0 (LWP 2197479)]
[New Thread 0x7ffff58006c0 (LWP 2197480)]
[New Thread 0x7ffff4e006c0 (LWP 2197481)]
[New Thread 0x7ffff44006c0 (LWP 2197482)]
[New Thread 0x7ffff3a006c0 (LWP 2197483)]
[New Thread 0x7ffff30006c0 (LWP 2197484)]
[New Thread 0x7ffff26006c0 (LWP 2197485)]
[New Thread 0x7ffff1c006c0 (LWP 2197486)]
[New Thread 0x7ffff12006c0 (LWP 2197487)]
[New Thread 0x7ffff08006c0 (LWP 2197488)]
[New Thread 0x7fffefe006c0 (LWP 2197489)]
[New Thread 0x7fffef4006c0 (LWP 2197490)]
[New Thread 0x7fffeea006c0 (LWP 2197491)]
[New Thread 0x7fffee0006c0 (LWP 2197492)]
[New Thread 0x7fffed6006c0 (LWP 2197493)]
[New Thread 0x7fffecc006c0 (LWP 2197494)]
Godot Engine v4.2.1.stable.nixpkgs.b09f793f5 - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
Xshape 1.1 detected.
Xinerama 1.1 detected.
Xrandr 1.6 detected.
Xrender 0.11 detected.
Xinput 2.2 detected.
XInput: Refreshing devices.
XInput: No touch devices found.
Downloading separate debug info for /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_intel_hasvk.so
Downloading separate debug info for /nix/store/0myzwg6fkfkzsnnqqmr5hdkggdiyrhbj-wayland-1.22.0/lib/libwayland-client.so.0                                                                    
Downloading separate debug info for /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_nouveau.so                                                                 
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts                                                                                                                  
of file /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_nouveau.so.
Use `info auto-load python-scripts [REGEXP]' to list them.
Downloading separate debug info for /nix/store/39cxficb10k402w87f14r85r26rddh87-nvidia-x11-550.67-6.7.11/lib/libGLX_nvidia.so.0
Downloading separate debug info for /nix/store/39cxficb10k402w87f14r85r26rddh87-nvidia-x11-550.67-6.7.11/lib/libnvidia-glsi.so.550.67                                                        
Downloading separate debug info for /nix/store/39cxficb10k402w87f14r85r26rddh87-nvidia-x11-550.67-6.7.11/lib/libnvidia-tls.so.550.67                                                         
Downloading separate debug info for /nix/store/39cxficb10k402w87f14r85r26rddh87-nvidia-x11-550.67-6.7.11/lib/libnvidia-glcore.so.550.67                                                      
Downloading separate debug info for /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/librt.so.1                                                                                 
Downloading separate debug info for /nix/store/39cxficb10k402w87f14r85r26rddh87-nvidia-x11-550.67-6.7.11/lib/libnvidia-gpucomp.so.550.67                                                     
Downloading separate debug info for /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_dzn.so                                                                     
Downloading separate debug info for /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_virtio.so                                                                  
Downloading separate debug info for /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_lvp.so                                                                     
Downloading separate debug info for /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_intel.so                                                                   
Downloading separate debug info for /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_radeon.so                                                                  
Downloading separate debug info for /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libVkLayer_MESA_device_select.so                                                     
Downloading separate debug info for /nix/store/z3yqjm7g9ig1nlpifz4xgwl77k2ysf1y-dbus-1.14.10-lib/lib/libdbus-1.so.3                                                                          
Downloading separate debug info for /nix/store/39cxficb10k402w87f14r85r26rddh87-nvidia-x11-550.67-6.7.11/lib/libnvidia-glvkspirv.so.550.67                                                   
WARNING: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message                                                                                                                    
        terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_dzn.so. Skipping this driver.
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 93825123321216
     at: _debug_messenger_callback (drivers/vulkan/vulkan_context.cpp:264)
WARNING: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
        terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /nix/store/1xsws423bz2la0zn88y81b0dp5yls2k0-mesa-24.0.3-drivers/lib/libvulkan_virtio.so. Skipping this driver.
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 93825123321216
     at: _debug_messenger_callback (drivers/vulkan/vulkan_context.cpp:264)
[New Thread 0x7fffd8a006c0 (LWP 2197629)]
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
ERROR: GENERAL - Message Id Number: 0 | Message Id Name: ../src/nouveau/vulkan/nvk_physical_device.c:935
        VK_ERROR_INCOMPATIBLE_DRIVER
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 93825122187648
   at: _debug_messenger_callback (drivers/vulkan/vulkan_context.cpp:267)
Vulkan devices:
  #0: AMD AMD Radeon Graphics (RADV RENOIR) - Supported, Integrated
  #1: NVIDIA NVIDIA GeForce RTX 3080 Laptop GPU - Supported, Discrete
  #2: Unknown llvmpipe (LLVM 17.0.6, 256 bits) - Supported, CPU
Vulkan API 1.3.277 - Forward+ - Using Vulkan Device #1: NVIDIA - NVIDIA GeForce RTX 3080 Laptop GPU
Optional extension VK_KHR_incremental_present not found
Optional extension VK_GOOGLE_display_timing not found
- Vulkan Variable Rate Shading supported:
  Pipeline fragment shading rate
  Primitive fragment shading rate
  Attachment fragment shading rate, min texel size: (16, 16), max texel size: (16, 16)
- Vulkan multiview supported:
  max view count: 32
  max instances: 134217727
- Vulkan subgroup:
  size: 32
  min size: 32
  max size: 32
  stages: STAGE_VERTEX, STAGE_TESSELLATION_CONTROL, STAGE_TESSELLATION_EVALUATION, STAGE_GEOMETRY, STAGE_FRAGMENT, STAGE_COMPUTE, STAGE_RAYGEN_KHR, STAGE_ANY_HIT_KHR, STAGE_CLOSEST_HIT_KHR, STAGE_MISS_KHR, STAGE_INTERSECTION_KHR, STAGE_CALLABLE_KHR, STAGE_TASK_NV, STAGE_MESH_NV
  supported ops: FEATURE_BASIC, FEATURE_VOTE, FEATURE_ARITHMETIC, FEATURE_BALLOT, FEATURE_SHUFFLE, FEATURE_SHUFFLE_RELATIVE, FEATURE_CLUSTERED, FEATURE_QUAD, FEATURE_PARTITIONED_NV
  quad operations in all stages
[New Thread 0x7fffd3c006c0 (LWP 2197631)]
[New Thread 0x7fffd32006c0 (LWP 2197632)]
[New Thread 0x7fffd28006c0 (LWP 2197633)]
[New Thread 0x7fffd1e006c0 (LWP 2197635)]
[New Thread 0x7fffd14006c0 (LWP 2197637)]
Startup PSO cache (3.6 MiB)
[New Thread 0x7fffc92006c0 (LWP 2197641)]
ScreenSaver: DBus 1.14.10 detected.
PortalDesktop: DBus 1.14.10 detected.
[New Thread 0x7fffbfe006c0 (LWP 2197642)]
Using "default" pen tablet driver...
Creating VMA small objects pool for memory type index 1
Shader 'CanvasSdfShaderRD' (group 0) SHA256: ccda596da71a96af6897be3bc63633145694ec79105c5674ee719a025f168249
Shader 'SkeletonShaderRD' (group 0) SHA256: db547e2a7abfceddca6daece649af33b18189dc08eaa37cef9dc5860862b91ee
Shader 'SortShaderRD' (group 0) SHA256: 0635218ab1b23b93c0e100ad9a6fe7be993089593c96fb6f498e0f9d047ce9f4
Shader 'ParticlesShaderRD' (group 0) SHA256: bfea0e55dd78696fd416c3513873f5a94bc956c2a61b8292eb5d078690e41591
Shader 'ParticlesCopyShaderRD' (group 0) SHA256: b640b70d21ec3903c8e257f1d54ef3c64236018b36feffb7a955f8cbf2b977c4
Shader 'CanvasShaderRD' (group 0) SHA256: f2af9ca0e26c0e8049ed431865d8fd5d14faf79f1ba8dade11df8dbd611652c3
Shader 'CanvasOcclusionShaderRD' (group 0) SHA256: 6e1f14f7d04af941e1d2300431ef37d7e2742684dce4fbe7495def98a3b1cb4d
Shader 'ClusterRenderShaderRD' (group 0) SHA256: 2135e66bae082ab8c6b6d9b8513777bd4aae70f47ed40a170cc241c0696d57dd
Shader 'ClusterStoreShaderRD' (group 0) SHA256: e7c19c07bf7cf7209e469a9fbb06d30b27bf29d7ad91bc47e74e0631765b2d86
Shader 'ClusterDebugShaderRD' (group 0) SHA256: 96afdc9dc3999abd6dc9e98643b3d58644ec856e4fa4ea20f9f69e1b225d6af8
Shader 'SceneForwardClusteredShaderRD' (group 0) SHA256: d5ded1b6d087f9d205de57ed54272037445fd80bbbab48e31e53a3fe33da0710
Shader 'SceneForwardClusteredShaderRD' (group 1) SHA256: 48092b10c0c4dd4c2e716f8fc6f699428872bad85dd07c65b7903c8732acba2a
Shader 'SceneForwardClusteredShaderRD' (group 2) SHA256: 5878195f2ab9a62223312633ac117c7b61974128c353968d1e66c80efb298e03
Shader 'SceneForwardClusteredShaderRD' (group 3) SHA256: 13816f69baf68044a6820cb07e9d2c069d84975407c2560320b8a551545e42cb
Shader 'ResolveShaderRD' (group 0) SHA256: bbae2281243fdb9a2fc1e014df1debab098cfa3fcafe9ee75283d37df2d1fddf
Shader 'TaaResolveShaderRD' (group 0) SHA256: 75850220cf4a882155831df3c46894bb18d5c770308ec844ff00d09520802a9b
Shader 'Fsr2DepthClipPassShaderRD' (group 0) SHA256: 2830090de5d5209b66e51f2bab8566480a2115c0f1b50534f9a18ac00b9be4bd
Shader 'Fsr2ReconstructPreviousDepthPassShaderRD' (group 0) SHA256: 50cb1c922c840f610233f20009f23a81457ee61a0e4986a85e5c08a63ef7c6cf
Shader 'Fsr2LockPassShaderRD' (group 0) SHA256: d6dbbf3057a3df42cf35700040550925b590fa22b318da4e9dde695a9c9601bd
Shader 'Fsr2AccumulatePassShaderRD' (group 0) SHA256: 22be82431e6f4ca678118ab070b427f8ab2bac9cf229056893e06dbcf9b88115
Shader 'Fsr2RcasPassShaderRD' (group 0) SHA256: 618153e882d42170c18f28a260da6d5c589acded5900975af70585065a59e085
Shader 'Fsr2ComputeLuminancePyramidPassShaderRD' (group 0) SHA256: 9dcae72fdad619f6b0b4df518e764e82400773504dc6dc42dee94342522a2cb6
Shader 'Fsr2AutogenReactivePassShaderRD' (group 0) SHA256: 309b444059a2b40ba093bf12cc4b01b327ea377105f38fd3c9b62395b068c3e0
Shader 'Fsr2TcrAutogenPassShaderRD' (group 0) SHA256: c0cd163bbfd61c6a3eb0b3dd9ce53a8191ed96d9c49f766122816258c829426a
Shader 'SsEffectsDownsampleShaderRD' (group 0) SHA256: 33191663db775b3239324c8e7c70b322003c7ba4f3bf509584e1cdc8ce90ca14
Shader 'SsilShaderRD' (group 0) SHA256: 7fd8e5f50a5704489ee2a7c2a433125ad7fa0d3a259d399af638bce1edcb8450
Shader 'SsilImportanceMapShaderRD' (group 0) SHA256: 673bf3ed83df4540ff07c5b6592d8117847d322f44fc54c541a41052868672ad
Shader 'SsilBlurShaderRD' (group 0) SHA256: c4823d0e827d0dd34f66eeeb04a52753c801e7a782e63057003523827a7ebfac
Shader 'SsilInterleaveShaderRD' (group 0) SHA256: 18f771bd553cb304db576babd51d4c4cc63df20ac2052fb0e4133f9fbdf5aa3e
Shader 'SsaoShaderRD' (group 0) SHA256: 21e4ef08ca2c349ce5ab040c40233a23516ece7c756639d914d6617b909985b7
Shader 'SsaoImportanceMapShaderRD' (group 0) SHA256: fc0834566ddf20cc312e6a1eafc6e4ead6ebc5874b1beec4f8b7100879adf9b9
Shader 'SsaoBlurShaderRD' (group 0) SHA256: 6649d2399f3866ffbde70be4eae7644fbfe70907923fd36a10552342f768b48d
Shader 'SsaoInterleaveShaderRD' (group 0) SHA256: 1420d433267675277657dbe4a189eb1a8ee79b1dfbd47038e6acf926e1b3b91b
Shader 'ScreenSpaceReflectionScaleShaderRD' (group 0) SHA256: c17a8a99b2bfaf1a0e3fdeaf2afc912e685a8f581ca9ad3208b2637c78d43699
Shader 'ScreenSpaceReflectionShaderRD' (group 0) SHA256: b5d41ffd66ed21e4cb5bb10d7d6c9f1b2575907979e8577ecaadc91765c64733
Shader 'ScreenSpaceReflectionFilterShaderRD' (group 0) SHA256: 60f8b0befc8ae01c09adc3d4b34f7900bc1430b089054913d923605e7a0ca9c4
Shader 'SubsurfaceScatteringShaderRD' (group 0) SHA256: 91e1ac945dad61f48411d0a1244e6636634e9785333c014ac318fcee04b72741
Shader 'SkyShaderRD' (group 0) SHA256: c773b40a48cb349a2f34006aace7b0ef1aaa8fad530160990a9634fcf019aebe
Shader 'VoxelGiShaderRD' (group 0) SHA256: 26adaa157a0dbc77aaeb10cd9840a3cfeddb4699002202c4069ea0aca1b684eb
Shader 'VoxelGiDebugShaderRD' (group 0) SHA256: 10e6f56ab62c32c6283301052f7f3efd8733a2dd8c54b5c8e8875b4019be3530
Shader 'SdfgiPreprocessShaderRD' (group 0) SHA256: 5d3bf192407ce0131d8d17e264d302c13eb17f8284e643e96071c3c2f09b45a8
Shader 'SdfgiDirectLightShaderRD' (group 0) SHA256: 2d9e0cdb42a45dcec8d6fa71bc0e820405887a0f06b540f9cfb9a3d5b0d05c53
Shader 'SdfgiIntegrateShaderRD' (group 0) SHA256: 15a2e64db17d8aafc8f3d8d2a528747c64d294e8034e7b9e4e86e5ee994d66c2
Shader 'GiShaderRD' (group 0) SHA256: fc70dbaf4b894ea97a0300ec38724bb52936be2bd53a8e3d056f28d9938a1c87
Shader 'SdfgiDebugShaderRD' (group 0) SHA256: 1d7fbd21ccb6e9825acc51d893c06bb4030178286b008b840821fd317fc5302b
Shader 'SdfgiDebugProbesShaderRD' (group 0) SHA256: 90121919d39f8150a9149d5e7eca75d0f2b06d679f544f696bdb941a6cf51810
Shader 'VolumetricFogShaderRD' (group 0) SHA256: c6ff2f4ac52f1179cd0f6c29737304d12ed6b90feae4187f34b38d5228ae1765
Shader 'VolumetricFogProcessShaderRD' (group 0) SHA256: 8d17101913be2888afe1d04fa9287ce1137a8385e86202f4b2a3c6946d3d8982
Shader 'BokehDofShaderRD' (group 0) SHA256: c8b02e9d9aed942a821d35f533288d4fd0a2faaf2c7b58b53c8a92c6c3544feb
Shader 'CopyShaderRD' (group 0) SHA256: b3d9672c50ef509a18599d840e170b4531f88fdffb8f3b73d085bf572599743d
Shader 'CopyToFbShaderRD' (group 0) SHA256: 100799ce54eea0950d2a761842afbdb825c4274cd7ae712042a99dd1738b306b
Shader 'CubeToDpShaderRD' (group 0) SHA256: 660d8fbdedf9d936fc5b9136a097854da9e921113edfdd404a556bcd4fad6f8a
Shader 'CubemapDownsamplerShaderRD' (group 0) SHA256: 7fa47c7b9bdb49d907907d1270a1c655307ed89c6d440c039a74c00a0f65519e
Shader 'CubemapFilterShaderRD' (group 0) SHA256: 1f5612e43bd985ba7545d1f652d72bb4a8251a8320475ebca00f62518d75f98b
Shader 'CubemapRoughnessShaderRD' (group 0) SHA256: 10ad3612c713073a9477ce1395ccb37e510a332370ed0c0a810e1a066533c13a
Shader 'SpecularMergeShaderRD' (group 0) SHA256: fee8ef8ea7ed18eeeebcfa2a626d54c6a503d5b75a9d775d7fb17a7e2dddc698
Shader 'ShadowFrustumShaderRD' (group 0) SHA256: 12fb0f35abe27d7c2578b5bdeaf4517d45f710f9b66ab66f57794d77f90c2fd5
Shader 'MotionVectorsShaderRD' (group 0) SHA256: ca45f570f7b085fd508662270a09a17e42436227dd37e8f5a22034bbb70d8a94
Shader 'LuminanceReduceShaderRD' (group 0) SHA256: ad94b0824e25b988f4792cd9be4cb80f042918016d83b4d9683034bbeffdd811
Shader 'TonemapShaderRD' (group 0) SHA256: 886811888c9b1fc45eecfdd383f8c7087ea62f74178fadb6ff561a568aade71b
Shader 'VrsShaderRD' (group 0) SHA256: b747acdb722b2faf724266877a5336a0141453c1632b280cdff87b47c108f7c9
Shader 'FsrUpscaleShaderRD' (group 0) SHA256: 5d97f0e27e6b49e530b561b06452e04bbf6b4763e0b831ea8650c098644f446a
Shader 'BlitShaderRD' (group 0) SHA256: 72c6e59fbd6bdca88a055003cd3614ebdbc4b9fed5efefb796128c188d379986
JoypadLinux: udev enabled and loaded successfully.
[New Thread 0x7fffbf4006c0 (LWP 2197643)]
[New Thread 0x7fffbea006c0 (LWP 2197644)]
BFD: error: /home/wrath/.cache/debuginfod_client/04b46bdc62fd251345a7fdb41ed8e1d54ddea6c8/debuginfo(.debug_info) is too large (0x16054d bytes)                                               
warning: Can't read data for section '.debug_info' in file '/home/wrath/.cache/debuginfod_client/04b46bdc62fd251345a7fdb41ed8e1d54ddea6c8/debuginfo'
warning: Section .debug_aranges in /home/wrath/.cache/debuginfod_client/04b46bdc62fd251345a7fdb41ed8e1d54ddea6c8/debuginfo entry at offset 0 debug_info_offset 0 does not exists, ignoring .debug_aranges.
PulseAudio 17.0.0 detected.
PulseAudio: context other
PulseAudio: context other
PulseAudio: context other
PulseAudio: context ready
PulseAudio: Detecting channels for device: alsa_output.pci-0000_05_00.6.analog-stereo
PulseAudio: detected 2 output channels
PulseAudio: audio buffer frames: 512 calculated output latency: 11ms
[New Thread 0x7fffbe0006c0 (LWP 2197645)]

TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
[New Thread 0x7fffbd6006c0 (LWP 2197646)]
WARNING: [CSM][I]Live2D Cubism Core version: 05.00.0000 (83886080)

     at: output (src/register_types.cpp:38)
WARNING: [CSM][I]CubismFramework::StartUp() is complete.

     at: output (src/register_types.cpp:38)
WARNING: [CSM][I]CubismFramework::Initialize() is complete.

     at: output (src/register_types.cpp:38)
CORE API HASH: 915626997
EDITOR API HASH: 1313472085
EditorSettings: Load OK!
[New Thread 0x7fffbcc006c0 (LWP 2197647)]
[New Thread 0x7fffa6c006c0 (LWP 2197648)]
[New Thread 0x7fffa62006c0 (LWP 2197649)]
WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:63)
[New Thread 0x7fffa58006c0 (LWP 2197650)]
Loaded system CA certificates
[Thread 0x7fffa58006c0 (LWP 2197650) exited]
Creating VMA small objects pool for memory type index 4
EditorSettings: Save OK!
[New Thread 0x7fffa58006c0 (LWP 2197651)]
[Thread 0x7fffa58006c0 (LWP 2197651) exited]
Live2D Cubism SDK Core Version 5.0.0
[New Thread 0x7fffa58006c0 (LWP 2197652)]
[New Thread 0x7fffa4e006c0 (LWP 2197654)]
[Thread 0x7fffa4e006c0 (LWP 2197654) exited]
[New Thread 0x7fffa4e006c0 (LWP 2197655)]
[Thread 0x7fffa4e006c0 (LWP 2197655) exited]

[New Thread 0x7fffa4e006c0 (LWP 2197659)]
[Thread 0x7fffa4e006c0 (LWP 2197659) exited]
Live2D Cubism SDK Core Version 5.0.0
free(): corrupted unsorted chunks

Thread 1 "godot4" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
Downloading source file /build/glibc-2.38/nptl/pthread_kill.c
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;                                                                                                      
(gdb) 
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff7d780e3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff7d28e06 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff7d118f5 in __GI_abort () at abort.c:79
#4  0x00007ffff7d127a1 in __libc_message (fmt=fmt@entry=0x7ffff7e8a559 "%s\n") at ../sysdeps/posix/libc_fatal.c:150
#5  0x00007ffff7d81d55 in malloc_printerr (str=str@entry=0x7ffff7e8d650 "free(): corrupted unsorted chunks") at malloc.c:5765
#6  0x00007ffff7d828ec in _int_free_create_chunk (av=av@entry=0x7ffff7ec5ac0 <main_arena>, p=p@entry=0x55556ffe2050, size=<optimized out>, size@entry=144, 
    nextchunk=nextchunk@entry=0x55556ffe20e0, nextsize=nextsize@entry=160) at malloc.c:4728
#7  0x00007ffff7d83c18 in _int_free_merge_chunk (av=av@entry=0x7ffff7ec5ac0 <main_arena>, p=0x55556ffe2050, size=144) at malloc.c:4693
#8  0x00007ffff7d83f89 in _int_free (av=0x7ffff7ec5ac0 <main_arena>, p=<optimized out>, have_lock=<optimized out>, have_lock@entry=0) at malloc.c:4639
#9  0x00007ffff7d86753 in __GI___libc_free (mem=<optimized out>) at malloc.c:3391
#10 0x00007fffec09ebd1 in Live2D::Cubism::Framework::Utils::Map::~Map() ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#11 0x00007fffec09ebc9 in Live2D::Cubism::Framework::Utils::Map::~Map() ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#12 0x00007fffec09dd12 in Live2D::Cubism::Framework::Utils::CubismJson::Delete(Live2D::Cubism::Framework::Utils::CubismJson*) ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#13 0x00007fffec096cab in Live2D::Cubism::Framework::CubismMotionJson::~CubismMotionJson() ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#14 0x00007fffec095a03 in Live2D::Cubism::Framework::CubismMotion::Parse(unsigned char const*, unsigned int) ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#15 0x00007fffec095fe4 in Live2D::Cubism::Framework::CubismMotion::Create(unsigned char const*, unsigned int, void (*)(Live2D::Cubism::Framework::ACubismMotion*)) ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#16 0x00007fffec0877f6 in InternalCubismUserModel::motion_load() ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#17 0x00007fffec088578 in InternalCubismUserModel::model_load(godot::String const&) ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#18 0x00007fffec07100d in GDCubismUserModel::set_assets(godot::String) ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#19 0x00007fffec0589be in godot::MethodBindT<godot::String>::call(void*, void const* const*, long, GDExtensionCallError&) const ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#20 0x00007fffec0ab792 in godot::MethodBind::bind_call(void*, void*, void const* const*, long, void*, GDExtensionCallError*) ()
   from /home/wrath/if_your_happy_and_you_know_it/ext/gd_cubism/demo/addons/gd_cubism/bin/libgd_cubism.linux.debug.x86_64.so
#21 0x000055555c357443 in ?? ()
#22 0x000055555c3abf8a in ?? ()
#23 0x000055555c3ba8e6 in ?? ()
#24 0x000055555c40e477 in ?? ()
#25 0x000055555c40e16a in ?? ()
#26 0x000055555c412611 in ?? ()
#27 0x0000555558cf29d2 in ?? ()
#28 0x00005555589bdaf2 in ?? ()
#29 0x00005555589b743c in ?? ()
#30 0x00005555589bfbad in ?? ()
#31 0x000055555c03951a in ?? ()
#32 0x000055555c3c2d47 in ?? ()
#33 0x000055555897d160 in ?? ()
--Type <RET> for more, q to quit, c to continue without paging--c
#34 0x0000555558b885d3 in ?? ()
#35 0x0000555558b89182 in ?? ()
#36 0x000055555c3c2d47 in ?? ()
#37 0x00005555592e5609 in ?? ()
#38 0x000055555c3c2d47 in ?? ()
#39 0x000055555a0eec9c in ?? ()
#40 0x000055555c3c2d47 in ?? ()
#41 0x0000555559ff5cc7 in ?? ()
#42 0x0000555559ff599d in ?? ()
#43 0x0000555559ff5604 in ?? ()
#44 0x000055555a0acc5f in ?? ()
#45 0x0000555559f5ddfa in ?? ()
#46 0x0000555559f5f35c in ?? ()
#47 0x0000555559f67a61 in ?? ()
#48 0x0000555559fb12a4 in ?? ()
#49 0x0000555559fb22de in ?? ()
#50 0x000055555780de8c in ?? ()
#51 0x000055555780dbf2 in ?? ()
#52 0x000055555bfbc7be in ?? ()
#53 0x000055555bfbb4a3 in ?? ()
#54 0x0000555557812252 in ?? ()
#55 0x00005555577d2c3f in ?? ()
#56 0x00007ffff7d130ce in __libc_start_call_main (main=main@entry=0x5555577d1f00, argc=argc@entry=4, argv=argv@entry=0x7fffffff2028) at ../sysdeps/nptl/libc_start_call_main.h:58
#57 0x00007ffff7d13189 in __libc_start_main_impl (main=0x5555577d1f00, argc=4, argv=0x7fffffff2028, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffffff2018) at ../csu/libc-start.c:360
#58 0x0000555557720825 in ?? ()

it seems that it's failing to parse the motions and/or trying to free some memory that it didn't actually allocate

pillowtrucker commented 3 months ago

The crash happens immediately upon trying to parse the first motion - if I try to step beyond that I immediately get the crash. I don't know if even the path to the motion is correct, but I'm assuming it's not simply that.

There are some difference in the json schema of the motions from the working model and the ones that crash, for example the "UserData": [] array is present in the crashing models, not in the working sample. There are also some differences in the headers: broken:

 ❯ head -n20 ~/if_your_happy_and_you_know_it/addons/gd_cubism/example/res/live2d/discord_mod/motions/00_Anger_01.motion3.json                                                     [22:21:18]
{
  "Version": 3,
  "Meta": {
    "Duration": 2.83,
    "Fps": 30.0,
    "Loop": true,
    "AreBeziersRestricted": true,
    "CurveCount": 113,
    "TotalSegmentCount": 247,
    "TotalPointCount": 289,
    "UserDataCount": 0,
    "TotalUserDataSize": 0
  },

working:

 ❯ head -n20 ~/if_your_happy_and_you_know_it/addons/gd_cubism/example/res/live2d/mao_pro_en/runtime/motions/mtn_01.motion3.json                                                   [22:21:08]
{
        "Version": 3,
        "Meta": {
                "Duration": 5.57,
                "Fps": 30.0,
                "FadeInTime": 1.0,
                "FadeOutTime": 1.0,
                "Loop": true,
                "AreBeziersRestricted": true,
                "CurveCount": 132,
                "TotalSegmentCount": 209,
                "TotalPointCount": 535,
                "UserDataCount": 0,
                "TotalUserDataSize": 0
        },

I don't know if this is relevant or important.

MizunagiKB commented 3 months ago

According to the information you provided, you are able to load the sample data (map_pro) provided by Live2D Inc., but the application crashes when you try to load a specific model. This is also apparent from the error logs.

In such cases, it is recommended to investigate using the loading options in GDCubism.

fig1

This feature has been implemented since version 0.4 and can be specified with the following options under Assets:

Firstly, before loading the Live2D model into Assets, try unchecking these options to see if it can be loaded.

Each of these options allows you to exclude the loading of Expressions and Motions when loading the Live2D model.

If you can load the model with these options unchecked, it is highly likely that the Live2D model you are trying to load does not have the correct structure.

pillowtrucker commented 3 months ago

Disabling motions in Godot stops the crash, but the display is just some background color. I'm not convinced the model is the problem though, as it works with every other viewer, including the official one from Cubism.. Here is my godot: Screenshot_20240406_104154 Here is Live2d official viewer: Screenshot_20240406_104309 Here is the web viewer https://guansss.github.io/live2d-viewer-web/ : Screenshot_20240406_104425 The model I'm trying to use is https://github.com/Eikanya/Live2d-model/tree/master/为美好的世界献上祝福!Fantastic Days/1399100

MizunagiKB commented 3 months ago

Regarding the Load Failure

Thank you for verifying with the Load Motions checkbox unchecked. If the checkbox is unchecked, it seems that it does not crash, which suggests that the *.motion3.json used in the target Live2D model has an unexpected data structure.

GDCubism is responsible only for rendering in GodotEngine, and the data itself is directly using the CubismNativeFramework provided by Live2D Inc.

While it would be better not to crash even with an incorrect structure, any bugs occurring in CubismNativeFramework are outside of GDCubism.

There's no choice but to handle data-side issues individually, but a similar situation has been discussed in a previous Issue, which might serve as a reference. https://github.com/MizunagiKB/gd_cubism/issues/52

Regarding the Issue of Live2D Model Not Displaying Correctly

This issue was due to the ppunit value specified in the Cubism Editor not being handled appropriately. I have made a correction for this bug. https://github.com/MizunagiKB/gd_cubism/commit/a1868c830f31755eab388e6494b639b0ae41da78

https://github.com/MizunagiKB/gd_cubism/tree/bugfix_calc_ppunit

With this change, if you build with the 0.6 branch, it should display correctly.

https://github.com/MizunagiKB/gd_cubism/tree/0.6

pillowtrucker commented 2 months ago

Thank you. I'm still trying to debug the motion issue. I think the problem is that the .moc3 files are for version 3.3 of Live2D SDK, and this is version 5. I can replicate the crash with the native samples https://github.com/Live2D/CubismNativeSamples and it gives slightly better debugging information:

GNU gdb (GDB) 14.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./build/bin/Demo/Demo...
(gdb) r
Starting program: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Demo 
Downloading separate debug info for system-supplied DSO at 0x7ffff7fc7000                                                                                                                    
[Thread debugging using libthread_db enabled]                                                                                                                                                
Using host libthread_db library "/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5/lib/libthread_db.so.1".
START                                                                                                                                                                                        
Downloading separate debug info for /nix/store/7ggc5q0q6y5ajazd3b3wka1c15c694bc-llvm-17.0.6-lib/lib/libLLVM-17.so                                                                            
Downloading separate debug info for /nix/store/ips4sr7319z9pdgxq8zciwz5fgp1m0cv-elfutils-0.190/lib/libelf.so.1                                                                               
[New Thread 0x7fffebe006c0 (LWP 522266)]                                                                                                                                                     
[New Thread 0x7fffeb4006c0 (LWP 522267)]
[New Thread 0x7fffeaa006c0 (LWP 522268)]
[New Thread 0x7fffea0006c0 (LWP 522269)]
[New Thread 0x7fffe92006c0 (LWP 522270)]
[New Thread 0x7fffe3e006c0 (LWP 522271)]
[New Thread 0x7fffe34006c0 (LWP 522272)]
[New Thread 0x7fffe2a006c0 (LWP 522273)]
[New Thread 0x7fffe20006c0 (LWP 522274)]
[CSM][I]Live2D Cubism Core version: 05.00.0000 (83886080)
[CSM][I]CubismFramework::StartUp() is complete.
[CSM][I]CubismFramework::Initialize() is complete.
[APP]model index: 0
[APP]_modelDir: 1399100
[APP]load model setting: 1399100.model3.json
[APP]create buffer: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/1399100.model3.json 
[APP]delete buffer: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/1399100.model3.json
[APP]create model: 1399100.moc3
[APP]create buffer: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/1399100.moc3 
Live2D Cubism SDK Core Version 5.0.0
[APP]delete buffer: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/1399100.moc3
[APP]create buffer: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/.physics3.json 
[APP]delete buffer: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/.physics3.json
[APP]load motion: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/motions/00_Excite_01.motion3.json => [_0] 
[APP]create buffer: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/motions/00_Excite_01.motion3.json 
[APP]delete buffer: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/motions/00_Excite_01.motion3.json
[APP]load motion: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/motions/00_Happy_02.motion3.json => [_1] 
[APP]create buffer: /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/build/bin/Demo/Resources/1399100/motions/00_Happy_02.motion3.json 
free(): corrupted unsorted chunks

Thread 1 "Demo" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;                                                                                                      
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff791af63 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff78cae86 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff78b3935 in __GI_abort () at abort.c:79
#4  0x00007ffff78b47e6 in __libc_message_impl (fmt=fmt@entry=0x7ffff7a2d2e6 "%s\n") at ../sysdeps/posix/libc_fatal.c:132
#5  0x00007ffff7924bd5 in malloc_printerr (str=str@entry=0x7ffff7a306d0 "free(): corrupted unsorted chunks") at malloc.c:5772
#6  0x00007ffff792576c in _int_free_create_chunk (av=av@entry=0x7ffff7a69ac0 <main_arena>, p=p@entry=0x555555a986b0, size=<optimized out>, size@entry=1136, 
    nextchunk=nextchunk@entry=0x555555a98b20, nextsize=nextsize@entry=112) at malloc.c:4735
#7  0x00007ffff7926ad8 in _int_free_merge_chunk (av=av@entry=0x7ffff7a69ac0 <main_arena>, p=0x555555a986b0, size=1136) at malloc.c:4700
#8  0x00007ffff7926e49 in _int_free (av=0x7ffff7a69ac0 <main_arena>, p=<optimized out>, have_lock=<optimized out>, have_lock@entry=0) at malloc.c:4646
#9  0x00007ffff7929613 in __GI___libc_free (mem=<optimized out>) at malloc.c:3398
#10 0x00005555555a17c9 in Live2D::Cubism::Framework::csmMap<Live2D::Cubism::Framework::csmString, Live2D::Cubism::Framework::Utils::Value*>::Clear (this=0x555555a95e18)
    at /home/wrath/CubismNativeSamples/Framework/src/Type/csmMap.hpp:597
#11 Live2D::Cubism::Framework::csmMap<Live2D::Cubism::Framework::csmString, Live2D::Cubism::Framework::Utils::Value*>::~csmMap (this=0x555555a95e18)
    at /home/wrath/CubismNativeSamples/Framework/src/Type/csmMap.hpp:550
#12 Live2D::Cubism::Framework::Utils::Map::~Map (this=0x555555a95db0) at /home/wrath/CubismNativeSamples/Framework/src/Utils/CubismJson.cpp:497
#13 0x00005555555a1747 in CsmDelete<Live2D::Cubism::Framework::Utils::Value> (address=0x555555a95db0) at /home/wrath/CubismNativeSamples/Framework/src/CubismFramework.hpp:100
#14 Live2D::Cubism::Framework::Utils::Map::~Map (this=0x555555aa46a0) at /home/wrath/CubismNativeSamples/Framework/src/Utils/CubismJson.cpp:488
#15 0x00005555555a0a7c in CsmDelete<Live2D::Cubism::Framework::Utils::Value> (address=0x555555aa46a0) at /home/wrath/CubismNativeSamples/Framework/src/CubismFramework.hpp:100
#16 Live2D::Cubism::Framework::Utils::CubismJson::~CubismJson (this=0x555555a98ca0) at /home/wrath/CubismNativeSamples/Framework/src/Utils/CubismJson.cpp:69
#17 0x00005555555a0ace in Live2D::Cubism::Framework::Utils::CubismJson::Delete (instance=0x7f7f1) at /home/wrath/CubismNativeSamples/Framework/src/Utils/CubismJson.cpp:77
#18 0x000055555559421b in Live2D::Cubism::Framework::CubismJsonHolder::DeleteCubismJson (this=0x555555a57a00) at /home/wrath/CubismNativeSamples/Framework/src/CubismJsonHolder.hpp:67
#19 Live2D::Cubism::Framework::CubismMotionJson::~CubismMotionJson (this=0x555555a57a00) at /home/wrath/CubismNativeSamples/Framework/src/Motion/CubismMotionJson.cpp:44
#20 0x0000555555592776 in CsmDelete<Live2D::Cubism::Framework::CubismMotionJson> (address=0x555555a57a00) at /home/wrath/CubismNativeSamples/Framework/src/CubismFramework.hpp:100
#21 Live2D::Cubism::Framework::CubismMotion::Parse (this=this@entry=0x555555ab0ef0, 
    motionJson=motionJson@entry=0x555555aa7310 "{\n  \"Version\": 3,\n  \"Meta\": {\n    \"Duration\": 2.83,\n    \"Fps\": 30.0,\n    \"Loop\": true,\n    \"AreBeziersRestricted\": true,\n    \"CurveCount\": 113,\n    \"TotalSegmentCount\": 261,\n    \"TotalPointCount\": 293"..., size=size@entry=25228)
    at /home/wrath/CubismNativeSamples/Framework/src/Motion/CubismMotion.cpp:707
#22 0x0000555555591c21 in Live2D::Cubism::Framework::CubismMotion::Create (
    buffer=0x555555aa7310 "{\n  \"Version\": 3,\n  \"Meta\": {\n    \"Duration\": 2.83,\n    \"Fps\": 30.0,\n    \"Loop\": true,\n    \"AreBeziersRestricted\": true,\n    \"CurveCount\": 113,\n    \"TotalSegmentCount\": 261,\n    \"TotalPointCount\": 293"..., size=25228, onFinishedMotionHandler=0x0) at /home/wrath/CubismNativeSamples/Framework/src/Motion/CubismMotion.cpp:251
#23 0x000055555557757d in LAppModel::PreloadMotionGroup (this=this@entry=0x555555906b90, group=0x55555574ba5c "")
    at /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/src/LAppModel.cpp:279
#24 0x0000555555576fae in LAppModel::SetupModel (this=this@entry=0x555555906b90, setting=setting@entry=0x555555a3a420)
    at /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/src/LAppModel.cpp:251
#25 0x0000555555575d08 in LAppModel::LoadAssets (this=0x555555906b90, dir=<optimized out>, fileName=<optimized out>)
    at /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/src/LAppModel.cpp:97
#26 0x000055555557472e in LAppLive2DManager::ChangeScene (this=this@entry=0x555555a55a90, index=<optimized out>)
    at /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/src/LAppLive2DManager.cpp:265
#27 0x000055555557407a in LAppLive2DManager::LAppLive2DManager (this=0x555555a55a90) at /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/src/LAppLive2DManager.cpp:71
#28 0x0000555555573fa5 in LAppLive2DManager::GetInstance () at /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/src/LAppLive2DManager.cpp:48
#29 0x0000555555572dcf in LAppDelegate::Initialize (this=0x5555556aef20) at /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/src/LAppDelegate.cpp:119
#30 0x000055555558479e in main (argc=<optimized out>, argv=<optimized out>) at /home/wrath/CubismNativeSamples/Samples/OpenGL/Demo/proj.linux.cmake/src/main.cpp:13
(gdb) q
A debugging session is active.

        Inferior 1 [process 522225] will be killed.

Quit anyway? (y or n) y
>>> elapsed time 5m15s                                                                                                                                                                       

It still gives the confusing errors about memory corruption during JSON parsing and it doesn't really hint at the fact that it's actually the moc3 files that are incompatible, but I've tested different configurations of working and broken JSON and png files. The crash is in different places then, but it always happens when it's trying to refer to the moc3, even if I make the JSON and png files identical to a working model.

It's disappointing that the way Cubism chose to handle this is with a weird crash, especially since their official viewer opens them correctly, but it's not your fault :+1:
Their viewer is also in java, so maybe they use some other library and give the users a different one.. Or maybe they have several different versions active to handle the incompatibilities..

pillowtrucker commented 2 months ago

I'm a dunce. I spent hours looking for something in the framework code to figure out if the moc3 version is used anywhere. I finally just tried your script from https://github.com/MizunagiKB/gd_cubism/issues/52 and that fixes the motion files and loads the model. But I still don't know what they've done in CubismViewer that this is not necessary there.

pillowtrucker commented 2 months ago

I'm reopening this as there are several options for backwards compatibility that I think might be worth trying. https://docs.live2d.com/en/cubism-sdk-manual/compatibility-with-cubism-5/#facemotion-fix I will try this first

MizunagiKB commented 2 months ago

The content of the transition destination describes the method to support compatibility with Expression behavior.

The content describes the operation of Expression, and the method is to replace the Expression processing, which is currently performed by a dedicated class, with the Motion class implemented in the past SDK.

As for the method of support, it is not an adjustment with arguments or properties, but a method of rewriting the code that each person has downloaded. Therefore, it cannot be supported on the GDCubism side.

On the other hand, if we try to incorporate the CubismNativeFramework itself to support it, different license conditions will mix, so we are not considering incorporating the code on the Live2D side.

Even if there is no problem with the license, it is not good to incorporate it from the point of maintenance.

However, I think there are people who need such changes and differences in operation. People who use GDCubism will probably work while reading BUILD.en.adoc, so if you add it as additional information in the document, the opportunity for people who need it to notice may increase.

I will add it as additional information in the document.

pillowtrucker commented 2 months ago

I've ported your python script to the framework now and opened a PR with Cubism. The expression logic is a different issue, I think. It's kind of weird how they've done it and not very convenient, but it doesn't seem to be related to the crashes. Thank you for your time and work on this!