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

ResourceLoader crash loading CompressedTexture2D on Android #99719

Open
Gromph opened this issue Nov 26, 2024 · 0 comments
Open

ResourceLoader crash loading CompressedTexture2D on Android #99719

Gromph opened this issue Nov 26, 2024 · 0 comments

Comments

@Gromph
Copy link
Contributor

Gromph commented Nov 26, 2024

Tested versions

This crash is reported to us via sentry.io from a released Godot 4.3 game. The crash only happens on android devices, it does not happen on windows or ios.
We haven't been able to reproduce on our android devices though

System information

Android (12,13,14,15) - Godot 4.3 - Compatibility

Issue description


Application Specific Information:
Segfault

Thread 0 Crashed:
0   libc.so                         0x725c11ccf8        <unknown> + 491170942200
1   libutils.so                     0x72609255f8        android::FileMap::~FileMap
2   libandroidfw.so                 0x72612acdb0        android::incfs::IncFsFileMap::~IncFsFileMap
3   libandroidfw.so                 0x726125dcb0        android::_FileAsset::~_FileAsset
4   libandroidfw.so                 0x726125dd40        android::_FileAsset::~_FileAsset
5   libandroid.so                   0x71a6426424        AAsset_close
6   split_config.arm64_v8a.apk      0x70728fe1a4        [inlined] FileAccessAndroid::_close (file_access_android.cpp:77)
7   split_config.arm64_v8a.apk      0x70728fe1a4        FileAccessAndroid::~FileAccessAndroid (file_access_android.cpp:262)
8   split_config.arm64_v8a.apk      0x7073e6b9bc        [inlined] memdelete<T> (memory.h:116)
9   split_config.arm64_v8a.apk      0x7073e6b9bc        [inlined] Ref<T>::unref (ref_counted.h:210)
10  split_config.arm64_v8a.apk      0x7073e6b9bc        [inlined] Ref<T>::~Ref (ref_counted.h:223)
11  split_config.arm64_v8a.apk      0x7073e6b9bc        CompressedTexture2D::_load_data (compressed_texture.cpp:89)
12  split_config.arm64_v8a.apk      0x7073e6c8c4        CompressedTexture2D::load (compressed_texture.cpp:138)
13  split_config.arm64_v8a.apk      0x7073e6d630        ResourceFormatLoaderCompressedTexture2D::load (compressed_texture.cpp:472)
14  split_config.arm64_v8a.apk      0x7074cd0e48        ResourceLoader::_load (resource_loader.cpp:269)
15  split_config.arm64_v8a.apk      0x7074cc93b0        ResourceFormatImporter::load (resource_importer.cpp:151)
16  split_config.arm64_v8a.apk      0x7074cd0e48        ResourceLoader::_load (resource_loader.cpp:269)
17  split_config.arm64_v8a.apk      0x7074cd1748        ResourceLoader::_thread_load_function (resource_loader.cpp:323)
18  split_config.arm64_v8a.apk      0x7074cd2c6c        ResourceLoader::_load_start (resource_loader.cpp:543)
19  split_config.arm64_v8a.apk      0x7074cb5b48        ResourceLoaderBinary::load (resource_format_binary.cpp:701)
20  split_config.arm64_v8a.apk      0x7074cba238        ResourceFormatLoaderBinary::load (resource_format_binary.cpp:1240)
21  split_config.arm64_v8a.apk      0x7074cd0e48        ResourceLoader::_load (resource_loader.cpp:269)
22  split_config.arm64_v8a.apk      0x7074cd1748        ResourceLoader::_thread_load_function (resource_loader.cpp:323)
23  split_config.arm64_v8a.apk      0x707503f7d8        WorkerThreadPool::_process_task (worker_thread_pool.cpp:140)
24  split_config.arm64_v8a.apk      0x70750404e8        WorkerThreadPool::_thread_function (worker_thread_pool.cpp:205)
25  split_config.arm64_v8a.apk      0x7074aed1c8        Thread::callback (thread.cpp:64)
26  split_config.arm64_v8a.apk      0x7074aed4f8        [inlined] std::__ndk1::__invoke<T> (type_traits:3874)
27  split_config.arm64_v8a.apk      0x7074aed4f8        [inlined] std::__ndk1::__thread_execute<T> (thread:273)
28  split_config.arm64_v8a.apk      0x7074aed4f8        std::__ndk1::__thread_proxy<T> (thread:284)
29  libc.so                         0x725c1c8d5c        <unknown> + 491171646812
30  libc.so                         0x725c15cbc0        <unknown> + 491171204032

Steps to reproduce

In C++ we call ResourceLoader::load_threaded_request() 5 times in a row to pre-load some simple scenes that contains a few Sprite2D and CPUParticles2D. I haven't been able to reproduce though. I'm assuming it has something to do with the timing of the worker threads calling AAssetManager_open and AAsset_close. I'm hoping maybe it just needs some checks or a mutex to prevent.

Minimal reproduction project (MRP)

Sorry I couldn't come up with a repro project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant