Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpotLight3d with shadow crashes app on Android 9 #72098

Closed
norrath-hero-cn opened this issue Jan 26, 2023 · 5 comments
Closed

SpotLight3d with shadow crashes app on Android 9 #72098

norrath-hero-cn opened this issue Jan 26, 2023 · 5 comments

Comments

@norrath-hero-cn
Copy link

norrath-hero-cn commented Jan 26, 2023

Godot version

Godot Engine v4.0.beta.custom_build.de8a412d1 - https://godotengine.org

Updates 2023-07-09: still reproducible with the latest stable version, Godot Engine v4.1.stable.official

System information

VIVO Z3, Android 9, Snapdragon 710AIE, Vulkan API 1.1.0 - Using Vulkan Device #0: Qualcomm - Adreno (TM) 616

Issue description

Related to #67430

Use the version from #72068 Checks

The demo project crashes on Android, backtrace shows it's calling "vkCmdClearAttachments".

full logs with "verbose stdout" enabled:
godot.log

Steps to reproduce

Please use minimal reproduction project

Minimal reproduction project

demo.zip

@norrath-hero-cn
Copy link
Author

norrath-hero-cn commented Jan 26, 2023

I'm syncing with the upstream master branch, using the debug template from the github workflow https://github.com/norrath-hero-cn/godot/actions/runs/4015908895, but still can't get symbol names, but this time more logs are being captured

ndk-stack -sym godot\build -dump adb\godot.log:

********** Crash dump: **********
Build fingerprint: 'vivo/PD1813D/PD1813D:9/PKQ1.181030.001/compiler07221602:user/release-keys'
#00 0x00000000000747c4 /vendor/lib64/hw/vulkan.sdm710.so (QglCommandBuffer::WriteAttachmentClears(QglAttachmentsClearInfo const*)+780)
#01 0x0000000000058c28 /vendor/lib64/hw/vulkan.sdm710.so (qglinternal::vkCmdClearAttachments(VkCommandBuffer_T*, unsigned int, VkClearAttachment const*, unsigned int, VkClearRect const*)+1344)
#02 0x000000000154dad8 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#03 0x000000000154e0e0 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#04 0x0000000002a74728 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#05 0x0000000002a72c68 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#06 0x0000000002a75860 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#07 0x00000000029bc514 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#08 0x000000000291e1f8 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#09 0x0000000002918d1c /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#10 0x00000000028e3a3c /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#11 0x00000000028e3e4c /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#12 0x00000000028e62cc /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#13 0x0000000002897688 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#14 0x0000000000b7a890 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#15 0x0000000000b39ce4 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#16 0x0000000000b4d5f0 /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/lib/arm64/libgodot_android.so (offset 0xb38000)
                                                                                                              ??
                                                                                                              ??:0:0
#17 0x000000000055f7e0 /system/lib64/libart.so (art_quick_generic_jni_trampoline+144)
#18 0x0000000000556a4c /system/lib64/libart.so (art_quick_invoke_static_stub+604)
#19 0x00000000000cf6e8 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
#20 0x000000000027fdd0 /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
#21 0x0000000000279dd8 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968)
#22 0x0000000000527350 /system/lib64/libart.so (MterpInvokeStatic+204)
#23 0x0000000000548f94 /system/lib64/libart.so (ExecuteMterpImpl+14612)
#24 0x0000000000023efc /dev/ashmem/dalvik-classes2.dex extracted in memory from /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/base.apk!classes2.dex (deleted) (org.godotengine.godot.vulkan.VkRenderer.onVkDrawFrame)
#25 0x0000000000253adc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2317285332+488)
#26 0x00000000002595d0 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
#27 0x0000000000279dbc /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
#28 0x0000000000525e4c /system/lib64/libart.so (MterpInvokeVirtual+588)
#29 0x0000000000548e14 /system/lib64/libart.so (ExecuteMterpImpl+14228)
#30 0x00000000000247d4 /dev/ashmem/dalvik-classes2.dex extracted in memory from /data/app/org.godotengine.demo-Rfp3UxIvNauFJvp_aF_b6A==/base.apk!classes2.dex (deleted) (org.godotengine.godot.vulkan.VkThread.run+300)
#31 0x0000000000253adc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2317285332+488)
#32 0x00000000005166e0 /system/lib64/libart.so (artQuickToInterpreterBridge+1020)
#33 0x000000000055f8fc /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
#34 0x0000000000556788 /system/lib64/libart.so (art_quick_invoke_stub+584)
#35 0x00000000000cf6c8 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
#36 0x000000000045dbd4 /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
#37 0x000000000045ec90 /system/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+424)
#38 0x0000000000489b30 /system/lib64/libart.so (art::Thread::CreateCallback(void*)+1120)
#39 0x0000000000092744 /system/lib64/libc.so (__pthread_start(void*)+36)
#40 0x0000000000023c78 /system/lib64/libc.so (__start_thread+68)
Crash dump is completed

adb logcat *:E adb -s "godot":
godot.log

adb logcat -s "godot":
godot2.log

If there is anything I can do to help, please ask!
@clayjohn

@norrath-hero-cn
Copy link
Author

norrath-hero-cn commented Jul 9, 2023

More (maybe useful) info about the crash

07-09 22:55:43.691 10080 10080 F DEBUG   : backtrace:
07-09 22:55:43.691 10080 10080 F DEBUG   :     #00 pc 00000000000747c4  /vendor/lib64/hw/vulkan.sdm710.so (QglCommandBuffer::WriteAttachmentClears(QglAttachmentsClearInfo const*)+780)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #01 pc 0000000000058c28  /vendor/lib64/hw/vulkan.sdm710.so (qglinternal::vkCmdClearAttachments(VkCommandBuffer_T*, unsigned int, VkClearAttachment const*, unsigned int, VkClearRect const*)+1344)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #02 pc 00000000015c6960  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #03 pc 00000000015c6f68  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #04 pc 0000000002c03400  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #05 pc 0000000002c01930  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #06 pc 0000000002c045a4  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #07 pc 0000000002b48708  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #08 pc 0000000002aaabdc  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #09 pc 0000000002aa57b8  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #10 pc 0000000002a7156c  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #11 pc 0000000002a71a20  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #12 pc 0000000002a73f44  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #13 pc 0000000002a253dc  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #14 pc 0000000000c39fa4  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #15 pc 0000000000bf8c9c  /data/app/org.godotengine.demo-aC_UEJiuSvBfEY9uxDX67g==/lib/arm64/libgodot_android.so (offset 0xbf6000)
07-09 22:55:43.691 10080 10080 F DEBUG   :     #16 pc 0000000000c0cbdc  Java_org_godotengine_godot_GodotLib_initialize

---------------------------------------------------
#04 pc 0000000002c03400

The disassembly shows that pc is somewhere after the call to shadow_atlas_get_quadrant_shadow_size and before the call to shadow_atlas_get_fb. in this area of code something triggered the call to vkCmdClearAttachments to crash. or something corrupted some data structure to trigger vkCmdClearAttachments to crash.

image

image

image

After some searching I believe it is the RenderForwardMobile::_render_shadow_pass function crashed.

@norrath-hero-cn
Copy link
Author

With the above analysis, I try to disable/enable light shadows one by one, only the SpotLight3d shadow crashes the app.

double checked 100% sure!

@clayjohn

@norrath-hero-cn norrath-hero-cn changed the title App exported by Godot 4.0 crashes on Android 9 SpotLight3d with shadow crashes app on Android 9 Jul 9, 2023
@Calinou
Copy link
Member

Calinou commented Jul 9, 2023

@norrath-hero-cn Please surround large blocks of text with triple backticks like this:

```
text here
```

This prevents them from taking too much space and also makes sure issue references aren't accidentally created. I edited your comment, but remember to do this next time 🙂

@norrath-hero-cn
Copy link
Author

Recent events on Cybereality and my experience makes me feel that keep the hope for Godot, provide detailed technical analysis, keep track of some bugs that will never be fixed is meaningless, so close it to reduce the number of issues for Godot.

@clayjohn clayjohn removed this from the 4.x milestone Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants