caoccao/Javet

Abort message: 'JNI ERROR (app bug): local reference table overflow (max=8388608)

Closed this issue · 3 comments

05-17 02:11:04.003  9271  9955 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 9955 (Thread-10), pid 9271 (op.deeke.script)
05-17 02:11:04.351 20883 20883 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-17 02:11:04.351 20883 20883 F DEBUG   : Build fingerprint: 'HONOR/LRA-AL00/HWLRA-H:10/HONORLRA-AL00/103.0.0.168C00:user/release-keys'
05-17 02:11:04.351 20883 20883 F DEBUG   : Revision: '0'
05-17 02:11:04.351 20883 20883 F DEBUG   : ABI: 'arm64'
05-17 02:11:04.356 20883 20883 F DEBUG   : SYSVMTYPE: Maple
05-17 02:11:04.356 20883 20883 F DEBUG   : APPVMTYPE: Art
05-17 02:11:04.357 20883 20883 F DEBUG   : Timestamp: 2024-05-17 02:11:04+0800
05-17 02:11:04.357 20883 20883 F DEBUG   : pid: 9271, tid: 9955, name: Thread-10  >>> top.deeke.script <<<
05-17 02:11:04.357 20883 20883 F DEBUG   : uid: 10497
05-17 02:11:04.357 20883 20883 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
05-17 02:11:04.357 20883 20883 F DEBUG   : Abort message: 'JNI ERROR (app bug): local reference table overflow (max=8388608)
05-17 02:11:04.357 20883 20883 F DEBUG   : local reference table dump:
05-17 02:11:04.357 20883 20883 F DEBUG   :   Last 10 entries (of 8388608):
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388607: 0x12c566b0 com.caoccao.javet.values.reference.V8ValueProxy
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388606: 0x12c56670 com.caoccao.javet.values.reference.V8ValueArray
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388605: 0x12c56628 com.caoccao.javet.values.reference.V8ValueFunction
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388604: 0x12c50a38 com.caoccao.javet.values.primitive.V8ValueString
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388603: 0x12c50a48 com.caoccao.javet.values.reference.V8ValueProxy
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388602: 0x12c509e0 com.caoccao.javet.values.reference.V8ValueObject
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388601: 0x13604dc8 com.caoccao.javet.values.primitive.V8ValueBoolean
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388600: 0x12c4fcc0 com.caoccao.javet.values.primitive.V8ValueString
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388599: 0x12c4fcd0 com.caoccao.javet.values.reference.V8ValueProxy
05-17 02:11:04.357 20883 20883 F DEBUG   :     8388598: 0x12c4fc60 com.caoccao.javet.values.reference.V8ValueObject
05-17 02:11:04.357 20883 20883 F DEBUG   :   Summary:
05-17 02:11:04.357 20883 20883 F DEBUG   :     2321793 of com.caoccao.javet.values.primitive.V8ValueString (2321793 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :     2296827 of com.caoccao.javet.values.reference.V8ValueProxy (2296827 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :     1897471 of com.caoccao.javet.values.reference.V8ValueObject (1897471 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :     748790 of com.caoccao.javet.values.primitive.V8ValueBoolean (1 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :     698871 of com.caoccao.javet.values.reference.V8ValueFunction (698871 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :     399356 of com.caoccao.javet.values.reference.V8ValueArray (399356 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :     24959 of com.caoccao.javet.values.primitive.V8ValueInteger (24959 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :       523 of com.caoccao.javet.values.reference.V8ValueArguments (523 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :        10 of com.caoccao.javet.values.reference.V8Module (10 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :         5 of java.lang.String (5 unique instances)
05-17 02:11:04.357 20883 20883 F DEBUG   :         1 of com.caoccao.javet.interop.callback.JavetCallbackContext
05-17 02:11:04.357 20883 20883 F DEBUG   :         1 of com.caoccao.javet.values.V8Value[] (3 elements)
05-17 02:11:04.357 20883 20883 F DEBUG   :         1 of java.lang.Thread
05-17 02:11:04.357 20883 20883 F DEBUG   :  Resizing failed: Requested size exceeds maximum: 16777216'
05-17 02:11:04.357 20883 20883 F DEBUG   :     x0  0000000000000000  x1  00000000000026e3  x2  0000000000000006  x3  0000006f43a62d30
05-17 02:11:04.357 20883 20883 F DEBUG   :     x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  7f7f7f7f7f7f7f7f
05-17 02:11:04.357 20883 20883 F DEBUG   :     x8  00000000000000f0  x9  2d3405246ba1839e  x10 0000000000000001  x11 0000000000000000
05-17 02:11:04.357 20883 20883 F DEBUG   :     x12 fffffff0fffffbdf  x13 ffffffffffffffff  x14 0000000000000004  x15 ffffffffffffffff
05-17 02:11:04.357 20883 20883 F DEBUG   :     x16 0000007031ff4a08  x17 0000007031fd47c0  x18 0000006f003bc000  x19 0000000000002437
05-17 02:11:04.357 20883 20883 F DEBUG   :     x20 00000000000026e3  x21 00000000ffffffff  x22 0000006f42089800  x23 0000006fad1dd000
05-17 02:11:04.357 20883 20883 F DEBUG   :     x24 0000006facc6f119  x25 0000006fad1df000  x26 00000070328b9258  x27 0000006fad1df000
05-17 02:11:04.357 20883 20883 F DEBUG   :     x28 000000000000006e  x29 0000006f43a62dd0
05-17 02:11:04.357 20883 20883 F DEBUG   :     sp  0000006f43a62d10  lr  0000007031f89640  pc  0000007031f8966c
05-17 02:11:04.548 20883 20883 F DEBUG   : 
05-17 02:11:04.548 20883 20883 F DEBUG   : backtrace:
05-17 02:11:04.548 20883 20883 F DEBUG   :       #00 pc 000000000007066c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: b91c775ccc9b0556e91bc575a2511cd0)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #01 pc 00000000004e1a4c  /apex/com.android.runtime/lib64/libart.so (art::Runtime::Abort(char const*)+2512) (BuildId: 73a2145672853571ef40097e4441d44e)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #02 pc 000000000000c600  /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+684) (BuildId: 7e6f8e823512d07994e0f2250d7d708b)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #03 pc 0000000000198fbc  /apex/com.android.runtime/lib64/libart.so (_jobject* art::JNIEnvExt::AddLocalReference<_jobject*>(art::ObjPtr<art::mirror::Object>)+212) (BuildId: 73a2145672853571ef40097e4441d44e)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #04 pc 0000000000459968  /apex/com.android.runtime/lib64/libart.so (art::Constructor_newInstance0(_JNIEnv*, _jobject*, _jobjectArray*)+492) (BuildId: 73a2145672853571ef40097e4441d44e)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #05 pc 00000000000f6b98  /system/framework/arm64/boot.oat (art_jni_trampoline+152) (BuildId: be0636a8794e8476014dfe666990f9ea4ca89df2)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #06 pc 000000000212b300  /memfd:/jit-cache (deleted) (java.lang.reflect.Constructor.newInstance+64)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #07 pc 00000000021195cc  /memfd:/jit-cache (deleted) (com.caoccao.javet.interop.proxy.ScoredExecutable.execute+1036)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #08 pc 000000000211357c  /memfd:/jit-cache (deleted) (com.caoccao.javet.interop.proxy.BaseJavetReflectionProxyHandler.execute+732)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #09 pc 0000000002149458  /memfd:/jit-cache (deleted) (com.caoccao.javet.interop.proxy.JavetReflectionProxyClassHandler.construct+392)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #10 pc 0000000002155f9c  /memfd:/jit-cache (deleted) (com.caoccao.javet.interop.proxy.JavetReflectionProxyClassHandler.lambda$getCallbackContexts$128462ef$1+156)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #11 pc 0000000002157fa0  /memfd:/jit-cache (deleted) (com.caoccao.javet.interop.proxy.JavetReflectionProxyClassHandler.$r8$lambda$KzGPdCyZQ2s_v2sQ57H1yR_ab3o+48)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #12 pc 0000000002154a2c  /memfd:/jit-cache (deleted) (com.caoccao.javet.interop.proxy.JavetReflectionProxyClassHandler$$ExternalSyntheticLambda0.call+60)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #13 pc 0000000002120bec  /memfd:/jit-cache (deleted) (com.caoccao.javet.interop.callback.V8FunctionCallback.receiveCallback+2220)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #14 pc 00000000001485b8  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 73a2145672853571ef40097e4441d44e)
05-17 02:11:04.548 20883 20883 F DEBUG   :       #15 pc 00000000001571d4  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+284) (BuildId: 73a2145672853571ef40097e4441d44e)
05-17 02:11:04.549 20883 20883 F DEBUG   :       #16 pc 00000000004d9510  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: 73a2145672853571ef40097e4441d44e)
05-17 02:11:04.549 20883 20883 F DEBUG   :       #17 pc 00000000004d917c  /apex/com.android.runtime/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+408) (BuildId: 73a2145672853571ef40097e4441d44e)
05-17 02:11:04.549 20883 20883 F DEBUG   :       #18 pc 00000000003cbc70  /apex/com.android.runtime/lib64/libart.so (art::JNI::CallStaticObjectMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+652) (BuildId: 73a2145672853571ef40097e4441d44e)
05-17 02:11:04.549 20883 20883 F DEBUG   :       #19 pc 000000000108f450  /data/app/top.deeke.script-qA4ZDsa2cSl9tGMFLlfGTg==/lib/arm64/libjavet-v8-android.v.3.1.0.so (JNIEnv_::CallStaticObjectMethod(_jclass*, _jmethodID*, ...)+116) (BuildId: 5ab32078193a3516dc9e625c6e63be29a9b6ef8c)
05-17 02:11:04.549 20883 20883 F DEBUG   :       #20 pc 000000000108db64  /data/app/top.deeke.script-qA4ZDsa2cSl9tGMFLlfGTg==/lib/arm64/libjavet-v8-android.v.3.1.0.so (Javet::Callback::JavetCallbackContextReference::CallFunction(v8::FunctionCallbackInfo<v8::Value> const&)+504) (BuildId: 5ab32078193a3516dc9e625c6e63be29a9b6ef8c)
05-17 02:11:04.549 20883 20883 F DEBUG   :       #21 pc 000000000210ae68  /data/app/top.deeke.script-qA4ZDsa2cSl9tGMFLlfGTg==/lib/arm64/libjavet-v8-android.v.3.1.0.so (BuildId: 5ab32078193a3516dc9e625c6e63be29a9b6ef8c)

I suspect the app doesn't close V8Values promptly. Could you leave a repo with the reproduceable code?

Thank you very much for your reminder. It seems that I have found a V8value that has not been closed. "V8Value v8Value=this.filterFunc.call(null, iAccessibilityNodeInfo);" Let me observe again. Can the document provide some scenarios where v8value needs to be turned off? For beginners, I would consider it to be an automatic shutdown.

Please review this section.