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

jsb.fileUtils.getWritablePath cannot be run over times, which will cause crash on Android #12458

Closed
timlyeee opened this issue Aug 18, 2022 · 1 comment
Assignees
Labels
Bug Env: Android Env: Native General issue on all native platforms including iOS, Android, MacOS, Windows P1 Must be finished in the milestone
Milestone

Comments

@timlyeee
Copy link
Contributor

Cocos Creator version

3.5.1+

System information

Android

Issue description

Re: https://forum.cocos.org/t/topic/138444

[3.5.1 Abort message: ‘art/runtime/indirect_reference_table.cc:115] JNI ERROR (app bug): local reference table overflow (max=512)’](https://forum.cocos.org/t/topic/138444)

2022-08-03 18:14:29.155 2633-2633/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-08-03 18:14:29.155 2633-2633/? A/DEBUG: Build fingerprint: 'Meizu/meizu_PRO6Plus/PRO6Plus:6.0.1/MMB29T/m96.Flyme_5.1.1488162804:user/release-keys'
2022-08-03 18:14:29.155 2633-2633/? A/DEBUG: Revision: '0'
2022-08-03 18:14:29.155 2633-2633/? A/DEBUG: ABI: 'arm64'
2022-08-03 18:14:29.155 2633-2633/? A/DEBUG: pid: 7313, tid: 7537, name: Thread-849 >>> com.joyparty.art <<<
2022-08-03 18:14:29.155 2633-2633/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2022-08-03 18:14:29.218 2633-2633/? A/DEBUG: Abort message: 'art/runtime/indirect_reference_table.cc:115] JNI ERROR (app bug): local reference table overflow (max=512)'
2022-08-03 18:14:29.219 2633-2633/? A/DEBUG: x0 0000000000000000 x1 0000000000001d71 x2 0000000000000006 x3 0000000000000000
2022-08-03 18:14:29.219 2633-2633/? A/DEBUG: x4 0000000000000000 x5 0000000000000001 x6 0000000000000000 x7 0000000000000000
2022-08-03 18:14:29.219 2633-2633/? A/DEBUG: x8 0000000000000083 x9 0000000000006c40 x10 000000003087c358 x11 000000003087c498
2022-08-03 18:14:29.219 2633-2633/? A/DEBUG: x12 0000000000000000 x13 0000007f8dc14000 x14 0000000000000000 x15 0000000000000000
2022-08-03 18:14:29.219 2633-2633/? A/DEBUG: x16 0000007f8dc06568 x17 0000007f8db994a8 x18 0000007f8dc17f50 x19 0000007f6797f500
2022-08-03 18:14:29.219 2633-2633/? A/DEBUG: x20 0000007f6797f440 x21 0000000000000002 x22 0000000000000006 x23 0000007f8a6b9000
2022-08-03 18:14:29.219 2633-2633/? A/DEBUG: x24 0000007f0a186c40 x25 0000007f679e7800 x26 0000007f8a6c5a40 x27 0000007f8a5db000
2022-08-03 18:14:29.219 2633-2633/? A/DEBUG: x28 0000007f0a186600 x29 0000007f6797d8e0 x30 0000007f8db96c44
2022-08-03 18:14:29.219 2633-2633/? A/DEBUG: sp 0000007f6797d8e0 pc 0000007f8db994b0 pstate 0000000020000000
2022-08-03 18:14:29.235 2633-2633/? A/DEBUG: backtrace:
2022-08-03 18:14:29.235 2633-2633/? A/DEBUG: #00 pc 00000000000694b0 /system/lib64/libc.so (tgkill+8)
2022-08-03 18:14:29.235 2633-2633/? A/DEBUG: #1 pc 0000000000066c40 /system/lib64/libc.so (pthread_kill+68)
2022-08-03 18:14:29.235 2633-2633/? A/DEBUG: #2 pc 0000000000023af0 /system/lib64/libc.so (raise+28)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #3 pc 000000000001e290 /system/lib64/libc.so (abort+60)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #4 pc 00000000004320a0 /system/lib64/libart.so (art::Runtime::Abort()+324)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #5 pc 00000000001361e4 /system/lib64/libart.so (art::LogMessage::~LogMessage()+3136)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #6 pc 0000000000130c88 /system/lib64/libart.so (art::Barrier::~Barrier()+296)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #7 pc 0000000000466c84 /system/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&)+212)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #8 pc 0000000000432188 /system/lib64/libart.so (art::Runtime::Abort()+556)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #9 pc 00000000001361e4 /system/lib64/libart.so (art::LogMessage::~LogMessage()+3136)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #10 pc 00000000002718b8 /system/lib64/libart.so (art::IndirectReferenceTable::Add(unsigned int, art::mirror::Object*)+372)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #11 pc 000000000032f318 /system/lib64/libart.so (art::JNI::CallStaticObjectMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+468)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #12 pc 000000000015c240 /system/lib64/libart.so (art::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+2716)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #13 pc 000000000015d1dc /system/lib64/libart.so (art::CheckJNI::CallStaticObjectMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+68)
2022-08-03 18:14:29.236 2633-2633/? A/DEBUG: #14 pc 00000000008617c8 /data/app/com.joyparty.art-1/lib/arm64/libcocos2djs.so (_JNIEnv::CallStaticObjectMethod(_jclass*, _jmethodID*, ...)+116)
2022-08-03 18:14:29.237 2633-2633/? A/DEBUG: #15 pc 0000000000861438 /data/app/com.joyparty.art-1/lib/arm64/libcocos2djs.so (std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > cc::JniHelper::callStaticStringMethod<>(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&)+276)
2022-08-03 18:14:29.237 2633-2633/? A/DEBUG: #16 pc 00000000008d9138 /data/app/com.joyparty.art-1/lib/arm64/libcocos2djs.so (cc::FileUtilsAndroid::getWritablePath() const+152)
2022-08-03 18:14:29.237 2633-2633/? A/DEBUG: #17 pc 000000000094f5e4 /data/app/com.joyparty.art-1/lib/arm64/libcocos2djs.so (js_engine_FileUtils_getWritablePathRegistry(v8::FunctionCallbackInfov8::Value const&)+400)
2022-08-03 18:14:29.237 2633-2633/? A/DEBUG: #18 pc 00000000014775f8 /data/app/com.joyparty.art-1/lib/arm64/libcocos2djs.so (v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo)+548)
2022-08-03 18:14:29.237 2633-2633/? A/DEBUG: #19 pc 0000000001476c54 /data/app/com.joyparty.art-1/lib/arm64/libcocos2djs.so
2022-08-03 18:14:29.237 2633-2633/? A/DEBUG: #20 pc 00000000014763e4 /data/app/com.joyparty.art-1/lib/arm64/libcocos2djs.so
2022-08-03 18:14:29.237 2633-2633/? A/DEBUG: #21 pc 000000000138b308 /data/app/com.joyparty.art-1/lib/arm64/libcocos2djs.so

Relevant error log output

No response

Steps to reproduce

A script to call getWritablePath over 100 times

Minimal reproduction project

No response

@timlyeee timlyeee added Bug Needs Triage Needs to be assigned by the team labels Aug 18, 2022
@timlyeee timlyeee self-assigned this Aug 18, 2022
@timlyeee timlyeee added this to the V3.6.1 milestone Aug 18, 2022
@dumganhar dumganhar added P1 Must be finished in the milestone Env: Native General issue on all native platforms including iOS, Android, MacOS, Windows Env: Android and removed Needs Triage Needs to be assigned by the team labels Aug 29, 2022
@timlyeee
Copy link
Contributor Author

timlyeee commented Aug 29, 2022

Test on v3.6.1, getWritablePath each frame, the error does not reproduce. I guess it's fixed somehow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Env: Android Env: Native General issue on all native platforms including iOS, Android, MacOS, Windows P1 Must be finished in the milestone
Projects
None yet
Development

No branches or pull requests

2 participants