chaquo / chaquopy

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

Fatal signal on starting application #1156

Closed pax0r closed 3 weeks ago

pax0r commented 1 month ago

Chaquopy version

15.0.1

Devices or emulators where the issue happens

Zebra VC8300 Android 11 Problem DOES not occur on Android 8.1 devices

Describe your issue

On my Zebra device I got random SEGV_MAPERR crashes. There is no java / python stacktraces only some native ones.

The crash happens on app startup, but not every time. One in few runs app starts and works without any problems.

05-14 13:06:07.087 10257 25343 25343 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc112a008 in tid 25343 (stabilis.indigo), pid 25343 (stabilis.indigo)
05-14 13:06:07.163  1000  1376  1404 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
05-14 13:06:07.163  1000  1376  1404 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
05-14 13:06:07.188 10257 25347 25347 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
05-14 13:06:07.190  1058  1069  1069 I tombstoned: received crash request for pid 25343
05-14 13:06:07.194 10257 25347 25347 I crash_dump32: performing dump of process 25343 (target tid = 25343)
05-14 13:06:07.213  1000  1376  1385 I system_server: Background concurrent copying GC freed 5750(306KB) AllocSpace objects, 93(14MB) LOS objects, 23% free, 77MB/101MB, paused 162us total 217.939ms
05-14 13:06:07.215 10257 25347 25347 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-14 13:06:07.215 10257 25347 25347 F DEBUG   : Build fingerprint: 'Zebra/VC8300/VC8310:11/11-20-18.00-RG-U00-STD-HEL-04/82:user/release-keys'
05-14 13:06:07.215 10257 25347 25347 F DEBUG   : Revision: '0'
05-14 13:06:07.215 10257 25347 25347 F DEBUG   : ABI: 'arm'
05-14 13:06:07.215 10257 25347 25347 F DEBUG   : Timestamp: 2024-05-14 13:06:07+0200
05-14 13:06:07.215 10257 25347 25347 F DEBUG   : pid: 25343, tid: 25343, name: stabilis.indigo  >>> io.stabilis.indigo <<<
05-14 13:06:07.215 10257 25347 25347 F DEBUG   : uid: 10257
05-14 13:06:07.215 10257 25347 25347 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc112a008
05-14 13:06:07.215 10257 25347 25347 F DEBUG   :     r0  0000001f  r1  00000014  r2  04000480  r3  00000000
05-14 13:06:07.215 10257 25347 25347 F DEBUG   :     r4  e19c3810  r5  ea3c6b78  r6  ffe75c18  r7  7103ad3c
05-14 13:06:07.215 10257 25347 25347 F DEBUG   :     r8  00000014  r9  7103ad3c  r10 00000018  r11 c112a008
05-14 13:06:07.215 10257 25347 25347 F DEBUG   :     ip  00000000  sp  ffe75b68  lr  e9c31a83  pc  e9b68274
05-14 13:06:07.235  1000   497   497 E SELinux : avc:  denied  { find } for pid=5568 uid=10249 name=tethering scontext=u:r:permissioncontroller_app:s0:c249,c256,c512,c768 tcontext=u:object_r:tethering_service:s0 tclass=service_manager permissive=0
05-14 13:06:07.403 10257 25347 25347 F DEBUG   : backtrace:
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :     NOTE: Function names and BuildId information is missing for some frames due
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :     NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :     NOTE: found under the lib/ directory are readable.
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #00 pc 00190274  /apex/com.android.art/lib/libart.so (mspace_malloc+28) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #01 pc 00259a7f  /apex/com.android.art/lib/libart.so (art::jit::JitMemoryRegion::AllocateData(unsigned int)+8) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #02 pc 002558b5  /apex/com.android.art/lib/libart.so (art::jit::JitCodeCache::AddProfilingInfoInternal(art::Thread*, art::ArtMethod*, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> > const&)+96) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #03 pc 00255807  /apex/com.android.art/lib/libart.so (art::jit::JitCodeCache::AddProfilingInfo(art::Thread*, art::ArtMethod*, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> > const&, bool)+74) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #04 pc 00259c3b  /apex/com.android.art/lib/libart.so (art::ProfilingInfo::Create(art::Thread*, art::ArtMethod*, bool)+238) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #05 pc 0024c4e7  /apex/com.android.art/lib/libart.so (art::jit::Jit::MaybeCompileMethod(art::Thread*, art::ArtMethod*, unsigned int, unsigned int, bool)+598) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #06 pc 00230e23  /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+386) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #07 pc 0022c52d  /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+724) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #08 pc 004ac0eb  /apex/com.android.art/lib/libart.so (MterpInvokeStatic+518) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.403 10257 25347 25347 F DEBUG   :       #09 pc 000ce594  /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+20) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #10 pc 00237eea  /system/framework/framework.jar (offset 0x11ee000) (android.util.Log.println+2)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #11 pc 0022598f  /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8830228473239471456)+254) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #12 pc 0022bccd  /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+120) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #13 pc 0049ae8d  /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+712) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #14 pc 000d8561  /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+32) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #15 pc 000d39d5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #16 pc 004b5d83  /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+290) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #17 pc 00122643  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+166) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #18 pc 003db5bb  /apex/com.android.art/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+54) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #19 pc 003dbfed  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+340) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #20 pc 003dc23b  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+42) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #21 pc 0030b379  /apex/com.android.art/lib/libart.so (art::JNI<true>::CallStaticIntMethodA(_JNIEnv*, _jclass*, _jmethodID*, jvalue const*)+500) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #22 pc 00278a8d  /apex/com.android.art/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodA(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, jvalue const*, art::Primitive::Type, art::InvokeType)+1396) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #23 pc 0026a721  /apex/com.android.art/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticIntMethodA(_JNIEnv*, _jclass*, _jmethodID*, jvalue const*)+40) (BuildId: 0584bb3e887a9f8dc44a052d4cece9a1)
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #24 pc 00038f41  /data/data/io.stabilis.indigo/files/chaquopy/bootstrap-native/armeabi-v7a/java/chaquopy.so
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #25 pc 00042541  /data/data/io.stabilis.indigo/files/chaquopy/bootstrap-native/armeabi-v7a/java/chaquopy.so
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #26 pc 0004b037  /data/data/io.stabilis.indigo/files/chaquopy/bootstrap-native/armeabi-v7a/java/chaquopy.so
05-14 13:06:07.404 10257 25347 25347 F DEBUG   :       #27 pc 000e9b71  /data/app/~~BKPxhsG8-loEE7BFP0fN5g==/io.stabilis.indigo-_mfPiVYe5Wnm0bRq_Y7_0g==/base.apk (offset 0x795000) (_PyObject_MakeTpCall+216) (BuildId: 0ea6acc6507eb0eda8251f9ee166f94693618679)

App is designed as Python backend and Webview which uses that backend. I have found out that before failed run the log is spammed with:

 E chromium: [0514/133256.147880:ERROR:elf_dynamic_array_reader.h(64)] tag not found

but the webview DOES not closes. App is designed in such a way that if Python backend crashes it will restart it self, so app can sometimes (after like 10-20 failed atempts) run without user inference.

EDIT: there is also a SELinux complaint about "somehting": 05-14 14:20:56.255 12432 12432 W linker : type=1400 audit(0.0:28570): avc: denied { search } for name="/" dev="mmcblk0p37" ino=2 scontext=u:r:untrusted_app:s0:c2,c257,c512,c768 tcontext=u:object_r:factory_file:s0 tclass=dir permissive=0 app=io.stabilis.indigo

mhsmith commented 1 month ago

Devices or emulators where the issue happens

Zebra VC8300 Android 11 Problem DOES not occur on Android 8.1 devices

Which Android 8.1 devices specifically? And does the problem happen on an Android 11 emulator?

Can you reduce your app to a minimal example which still shows the problem, and upload its source code to GitHub?

mhsmith commented 3 weeks ago

If this is still a problem, please post the requested information, and I'll reopen the issue.