chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
839 stars 133 forks source link

Unreadable library issue: libc++_shared.so causing runtime errors #1284

Closed 32192442sangho closed 4 days ago

32192442sangho commented 5 days ago

Chaquopy version

classpath "com.chaquo.python:gradle:16.0.0"

Devices or emulators where the issue happens

S22+

Relevant parts of your code

Float32List datafrompy = await callKotlinFunction(outputFilePath);

 final inputShape = Int64List.fromList([1, 1, 40]);
 Tensor inputTensor = Tensor.fromBlobFloat32(datafrompy, inputShape);

 Tensor outputTensor = await FlutterPytorchLite.forward(inputTensor);`

Although this code has nothing to do with chaquopy, an error always occurred when the last line of code was reached.

Describe your issue

https://github.com/chaquo/chaquopy/issues/1171

If my understanding is correct, it seems to be the same problem as above. The issue states that it will be fixed in Chaquopy 16 and should work in Python 3.13 or higher. Accordingly, I changed Python to 3.13 and Chaquopy was also changed to 16.0.0. But the error below still occurs.

`F/libc    (28601): Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x779e568000 in tid 28631 (flutter-worker-), pid 28601 (le.cap_practice)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/g0qksx/g0q:14/UP1A.231005.007/S906NKSS5EXJ3:user/release-keys'
Revision: '16'
ABI: 'arm64'
Processor: '6'
Timestamp: 2024-11-02 18:53:42.387652215+0900
Process uptime: 27s
Cmdline: com.example.cap_practice
pid: 28601, tid: 28631, name: flutter-worker-  >>> com.example.cap_practice <<<
uid: 10324
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x000000779e568000
    x0  000000779e562cf0  x1  000000779e562038  x2  0000000000000001  x3  b4000079a5372490
    x4  000000779e562cf0  x5  00000075f34c3128  x6  fefeff54534c9b0a  x7  7f7f7f7f7f7fff7f
    x8  000000779e568000  x9  0000000000006fd7  x10 0000000000006fd7  x11 000000782d6550b0
    x12 0000000000000001  x13 0000000000000001  x14 0000000000000000  x15 0000000000000000
    x16 0000007830344b60  x17 0000007b51a66080  x18 000000000000006e  x19 000000779e562038
    x20 0000000000000001  x21 0000000000000002  x22 0000000000000002  x23 000000779e562cf0
    x24 0000000000000000  x25 b4000078b55aa470  x26 000000779e568000  x27 00000000000000a0
    x28 000000779e568000  x29 000000779e562010
    lr  00000075f3536cc8  sp  000000779e562010  pc  000000779e568000  pst 0000000000001800
100 total frames
backtrace:
  NOTE: Function names and BuildId information is missing for some frames due
  NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
  NOTE: found under the lib/ directory are readable.
  NOTE: On this device, run setenforce 0 to make the libraries readable.
  NOTE: Unreadable libraries:
  NOTE:   /data/data/com.example.cap_practice/files/chaquopy/AssetFinder/requirements/chaquopy/lib/libc++_shared.so
      #00 pc 0000000000104000  [anon:stack_and_tls:28631]
      #01 pc 000000000012ecc4  /data/data/com.example.cap_practice/files/chaquopy/AssetFinder/requirements/chaquopy/lib/libc++_shared.so
      #02 pc 000000000012e9b8  /data/data/com.example.cap_practice/files/chaquopy/AssetFinder/requirements/chaquopy/lib/libc++_shared.so
      #03 pc 00000000000bb3c4  /data/data/com.example.cap_practice/files/chaquopy/AssetFinder/requirements/chaquopy/lib/libc++_shared.so
      #04 pc 00000000000bb1f0  /data/data/com.example.cap_practice/files/chaquopy/AssetFinder/requirements/chaquopy/lib/libc++_shared.so
      #05 pc 00000000021e1a48  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #06 pc 00000000021e1f50  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #07 pc 000000000205c8a0  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (c10::detail::torchCheckFail(char const*, char const*, unsi
gned int, char const*)+280) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #08 pc 000000000041d9cc  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #09 pc 0000000001a38660  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (at::native::resize_(at::Tensor const&, c10::ArrayRef<long>
, c10::optional<c10::MemoryFormat>)+168) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #10 pc 000000000095f7fc  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #11 pc 00000000008f66a0  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #12 pc 00000000008af448  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (at::_ops::resize_::call(at::Tensor const&, c10::ArrayRef<l
ong>, c10::optional<c10::MemoryFormat>)+76) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #13 pc 0000000001c65268  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #14 pc 0000000001c65604  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #15 pc 0000000001c68c5c  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #16 pc 0000000001c85ec8  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #17 pc 0000000001c85d10  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #18 pc 0000000001c85c9c  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #19 pc 00000000014e7934  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)        
      #20 pc 0000000001e75a24  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (torch::jit::mobile::InterpreterState::run(std::__ndk1::vec
tor<c10::IValue, std::__ndk1::allocator<c10::IValue> >&)+8124) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #21 pc 0000000001e627a4  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (torch::jit::mobile::Function::run(std::__ndk1::vector<c10:
:IValue, std::__ndk1::allocator<c10::IValue> >&)+160) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #22 pc 0000000001e79da4  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (torch::jit::mobile::Method::run(std::__ndk1::vector<c10::I
Value, std::__ndk1::allocator<c10::IValue> >&) const+788) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #23 pc 0000000001e7b1e0  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (torch::jit::mobile::Method::operator()(std::__ndk1::vector
<c10::IValue, std::__ndk1::allocator<c10::IValue> >) const+20) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #24 pc 00000000003f911c  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (torch::jit::mobile::Module::forward(std::__ndk1::vector<c1
0::IValue, std::__ndk1::allocator<c10::IValue> >)+120) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #25 pc 00000000003f89f4  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (pytorch_jni::PytorchJni::forward(facebook::jni::alias_ref<
facebook::jni::detail::JTypeFor<facebook::jni::JArrayClass<facebook::jni::detail::JTypeFor<pytorch_jni::JIValue, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::detail::JTypeArray, void>::_javaobject*>)::'lambda'():
:operator()() const+88) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #26 pc 00000000003f8074  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (pytorch_jni::PytorchJni::forward(facebook::jni::alias_ref<
facebook::jni::detail::JTypeFor<facebook::jni::JArrayClass<facebook::jni::detail::JTypeFor<pytorch_jni::JIValue, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::detail::JTypeArray, void>::_javaobject*>)+992) (BuildI
d: 52d4535993887cc970266090b73d60109f28dbce)
      #27 pc 00000000003f875c  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (facebook::jni::detail::MethodWrapper<facebook::jni::basic_
strong_ref<pytorch_jni::JIValue, facebook::jni::LocalReferenceAllocator> (pytorch_jni::PytorchJni::*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::JArrayClass<facebook::jni::detail::JTypeFor<pytorch_jn
i::JIValue, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::detail::JTypeArray, void>::_javaobject*>), &(pytorch_jni::PytorchJni::forward(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::JArra
yClass<facebook::jni::detail::JTypeFor<pytorch_jni::JIValue, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::detail::JTypeArray, void>::_javaobject*>)), pytorch_jni::PytorchJni, facebook::jni::basic_strong_ref<pytor
ch_jni::JIValue, facebook::jni::LocalReferenceAllocator>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::JArrayClass<facebook::jni::detail::JTypeFor<pytorch_jni::JIValue, facebook::jni::JObject, void>::_
javaobject*>, facebook::jni::detail::JTypeArray, void>::_javaobject*> >::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<pytorch_jni::PytorchJni, facebook::jni::detail::BaseHybridClas
s>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::JArrayClass<facebook::jni::detail::JTypeFor<pytorch_jni::JIValue, facebook::jni::JObject, void>:
:_javaobject*>, facebook::jni::detail::JTypeArray, void>::_javaobject*>&&)+60) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #28 pc 00000000003f86ac  /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!libpytorch_jni_lite.so (offset 0x4cc4000) (facebook::jni::detail::FunctionWrapper<facebook::jni::basi
c_strong_ref<pytorch_jni::JIValue, facebook::jni::LocalReferenceAllocator> (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<pytorch_jni::PytorchJni, facebook::jni::detail::BaseHybridClass>:
:JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::JArrayClass<facebook::jni::detail::JTypeFor<pytorch_jni::JIValue, facebook::jni::JObject, void>::_j
avaobject*>, facebook::jni::detail::JTypeArray, void>::_javaobject*>&&), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<pytorch_jni::PytorchJni, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObje
ct, void>::_javaobject*, facebook::jni::basic_strong_ref<pytorch_jni::JIValue, facebook::jni::LocalReferenceAllocator>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::JArrayClass<facebook::jni::detail::J
TypeFor<pytorch_jni::JIValue, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::detail::JTypeArray, void>::_javaobject*> >::call(_JNIEnv*, _jobject*, facebook::jni::detail::JTypeFor<facebook::jni::JArrayClass<facebook
::jni::detail::JTypeFor<pytorch_jni::JIValue, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::detail::JTypeArray, void>::_javaobject*, facebook::jni::basic_strong_ref<pytorch_jni::JIValue, facebook::jni::LocalRefere
nceAllocator> (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<pytorch_jni::PytorchJni, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, face
book::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::JArrayClass<facebook::jni::detail::JTypeFor<pytorch_jni::JIValue, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::detail::JTypeArray, void>::_javao
bject*>&&))+72) (BuildId: 52d4535993887cc970266090b73d60109f28dbce)
      #29 pc 0000000000351230  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #30 pc 000000000033a7a4  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #31 pc 0000000000510988  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+1976) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #32 pc 0000000000491340  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4772) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #33 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #34 pc 000000000047d0a4  [anon:dalvik-classes.dex extracted in memory from /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk] (org.pytorch.Module.forward+0)
      #35 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #36 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #37 pc 0000000000490490  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1012) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #38 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #39 pc 0000000000011680  [anon:dalvik-classes4.dex extracted in memory from /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk!classes4.dex] (io.github.winfordguo.flutter_pytorc
h_lite.FlutterPytorchLitePlugin.onMethodCall+0)
      #40 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #41 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #42 pc 0000000000491340  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4772) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #43 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #44 pc 0000000000264a14  [anon:dalvik-classes.dex extracted in memory from /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk] (io.flutter.plugin.common.MethodChannel$IncomingMe
thodCallHandler.onMessage+0)
      #45 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #46 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #47 pc 0000000000491340  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4772) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #48 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #49 pc 000000000025694c  [anon:dalvik-classes.dex extracted in memory from /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk] (io.flutter.embedding.engine.dart.DartMessenger.in
vokeHandler+0)
      #50 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #51 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #52 pc 00000000004908c8  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+2092) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #53 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #54 pc 00000000002569d0  [anon:dalvik-classes.dex extracted in memory from /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk] (io.flutter.embedding.engine.dart.DartMessenger.la
mbda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger+0)
      #55 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #56 pc 0000000000377da4  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+100) (BuildId: 5b1e3dce5a
bfbdc410d71d256d308227)
      #57 pc 00000000003777d4  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+1860) (Buil
dId: 5b1e3dce5abfbdc410d71d256d308227)
      #58 pc 0000000000492c08  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+11116) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #59 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #60 pc 0000000000256180  [anon:dalvik-classes.dex extracted in memory from /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk] (io.flutter.embedding.engine.dart.DartMessenger$$E
xternalSyntheticLambda0.run+0)
      #61 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #62 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #63 pc 0000000000491340  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4772) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #64 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #65 pc 0000000000256400  [anon:dalvik-classes.dex extracted in memory from /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk] (io.flutter.embedding.engine.dart.DartMessenger$Se
rialTaskQueue.flush+0)
      #66 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #67 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #68 pc 00000000004908c8  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+2092) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #69 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #70 pc 00000000002564b0  [anon:dalvik-classes.dex extracted in memory from /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk] (io.flutter.embedding.engine.dart.DartMessenger$Se
rialTaskQueue.lambda$dispatch$0$io-flutter-embedding-engine-dart-DartMessenger$SerialTaskQueue+0)
      #71 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #72 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #73 pc 0000000000490490  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1012) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #74 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #75 pc 0000000000256378  [anon:dalvik-classes.dex extracted in memory from /data/app/~~Pu3UmnUycPOs1NMT1iI9wQ==/com.example.cap_practice-LXSGsNEfmSFHJCPk5G9KNQ==/base.apk] (io.flutter.embedding.engine.dart.DartMessenger$Se
rialTaskQueue$$ExternalSyntheticLambda1.run+0)
      #76 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #77 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #78 pc 0000000000491340  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4772) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #79 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #80 pc 00000000002474e4  /apex/com.android.art/javalib/core-oj.jar (java.util.concurrent.ThreadPoolExecutor.runWorker+0)
      #81 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #82 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #83 pc 0000000000490490  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1012) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #84 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #85 pc 0000000000246380  /apex/com.android.art/javalib/core-oj.jar (java.util.concurrent.ThreadPoolExecutor$Worker.run+0)
      #86 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #87 pc 0000000000511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (Bui
ldId: 5b1e3dce5abfbdc410d71d256d308227)
      #88 pc 0000000000491340  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4772) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #89 pc 00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #90 pc 000000000010eaf0  /apex/com.android.art/javalib/core-oj.jar (java.lang.Thread.run+0)
      #91 pc 000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.1124354180117519167928197559567
32575238.llvm.18012138979834229341)+232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #92 pc 000000000036d3e4  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+964) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #93 pc 0000000000351368  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #94 pc 000000000033a7a4  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #95 pc 000000000023a01c  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+144) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #96 pc 0000000000539054  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1600) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #97 pc 0000000000538a04  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallbackWithUffdGc(void*)+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
      #98 pc 00000000000c3914  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
      #99 pc 000000000005d084  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
32192442sangho commented 4 days ago

sorry it wasn't chaquopy problem

mhsmith commented 3 days ago

It looks like what's happened here is a non-Chaquopy library was linked against libc++_shared.so, and at runtime it's found the Chaquopy copy of that library. This should be safe as long as the library's runtime version is newer than the compile-time version, though as I found in #1171, there are exceptions.

As long as your app's minSdk is at least 24, your app's build log should indicate that you're using chaquopy_libcxx version 180000, which we packaged recently from the current version of the NDK. There should be no need to change your Chaquopy version or Python version.

If that doesn't work, try using a different version (either newer or older) or the package that provides libpytorch_jni_lite.so.