protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

ILL_ILLOPC Android 64 bit sometimes crash when dlpoen

Open jiabailong opened this issue 3 years ago • 3 comments

What version of protobuf and what language are you using? Project: Protocol Buffers - Google's data interchange format Source code: https://github.com/protocolbuffers/protobuf Version: 3.19.1

Android system in opencv

Fatal signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x6688e1f1fc (*pc=00000000) x0 0000006689159c38 x1 0000006689156b58 x2 0000007ff9311198 x3 00000071dcc561c0 x4 000000714d770700 x5 000000714d7706ce x6 61642f617461642f x7 6a2e6d6f632f6174 x8 00000071dde615a0 x9 000000000000000d x10 000000000000001f x11 0000000000000028 x12 61637362696c2f73 x13 6f732e62696c2d6e x14 be41013c00000000 x15 617267696e6a6269 x16 0000000000000000 x17 00000071ddd82094 x18 000000668a04a000 x19 00000071dcc561c0 x20 00000071ddd4f7b2 x21 000000668911e0e0 x22 0000000000000000 x23 00000071ddd4ad83 x24 00000071ddd5469b x25 00000071dde61000 x26 00000071dde615a8 x27 0000000000000036 x28 0000006688946fac x29 000000668c9d97a0 sp 000000668c9d9750 lr 00000071ddd9abac pc 0000006688e1f1fc

caused by: SIGILL(ILL_ILLOPC) Illegal Opcode

backtrace: #00 pc 00000000005d21fc /data/data/com.scan.manager/app_libs/libscan-lib.so https://github.com/opencv/opencv/pull/1 pc 0000000000051ba8 /apex/com.android.runtime/bin/linker64 (_dl__ZL10call_arrayIPFviPPcS1_EEvPKcPT_mbS5+276) https://github.com/opencv/opencv/pull/2 pc 0000000000051dc4 /apex/com.android.runtime/bin/linker64 (__dl__ZN6soinfo17call_constructorsEv+376) https://github.com/opencv/opencv/pull/3 pc 000000000003d9a0 /apex/com.android.runtime/bin/linker64 (__dl__Z9do_dlopenPKciPK17android_dlextinfoPKv+2428) https://github.com/opencv/opencv/pull/4 pc 00000000000390dc /apex/com.android.runtime/bin/linker64 (__loader_android_dlopen_ext+72) https://github.com/opencv/opencv/pull/5 pc 00000000000010b8 /apex/com.android.runtime/lib64/bionic/libdl.so (android_dlopen_ext+12) https://github.com/opencv/opencv/pull/6 pc 0000000000007fa8 /apex/com.android.runtime/lib64/libnativeloader.so (OpenNativeLibraryInNamespace+128) https://github.com/opencv/opencv/pull/7 pc 0000000000007c80 /apex/com.android.runtime/lib64/libnativeloader.so (OpenNativeLibrary+280) https://github.com/opencv/opencv/pull/8 pc 0000000000396e9c /apex/com.android.runtime/lib64/libart.so (ZN3art9JavaVMExt17LoadNativeLibraryEP7_JNIEnvRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEP8_jobjectP7_jclassPS9+2436) https://github.com/opencv/opencv/pull/9 pc 0000000000005174 /apex/com.android.runtime/lib64/libopenjdkjvm.so (JVM_NativeLoad+552) https://github.com/opencv/opencv/pull/10 pc 00000000000efaf4 /system/framework/arm64/boot.oat (art_jni_trampoline+228) https://github.com/opencv/opencv/pull/11 pc 0000000000111ef0 /system/framework/arm64/boot.oat (java.lang.Runtime.load0+560) https://github.com/opencv/opencv/pull/12 pc 0000000000117a90 /system/framework/arm64/boot.oat (java.lang.System.load+96) https://github.com/opencv/opencv/pull/13 pc 00000000001475b8 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) https://github.com/opencv/opencv/pull/14 pc 00000000001561d4 /apex/com.android.runtime/lib64/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+284) https://github.com/opencv/opencv/pull/15 pc 00000000002fd900 /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_11ShadowFrameEtPNS_6JValueE+384) https://github.com/opencv/opencv/pull/16 pc 00000000002f8bd0 /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+912) https://github.com/opencv/opencv/pull/17 pc 00000000005ce11c /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+368) https://github.com/opencv/opencv/pull/18 pc 0000000000141994 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) https://github.com/opencv/opencv/pull/19 pc 00000000005ce41c /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136) https://github.com/opencv/opencv/pull/20 pc 0000000000141994 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) https://github.com/opencv/opencv/pull/21 pc 00000000005ce41c /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136) https://github.com/opencv/opencv/pull/22 pc 0000000000141994 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) https://github.com/opencv/opencv/pull/23 pc 00000000002ce22c /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1772238600391939451+320) https://github.com/opencv/opencv/pull/24 pc 00000000005bc0a4 /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1012) https://github.com/opencv/opencv/pull/25 pc 0000000000150468 /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) https://github.com/opencv/opencv/pull/26 pc 00000000003d8d08 /system/framework/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+984) https://github.com/opencv/opencv/pull/27 pc 00000000003d5880 /system/framework/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+64) https://github.com/opencv/opencv/pull/28 pc 0000000000217fc8 /system/framework/arm64/boot.oat (java.lang.Thread.run+72) https://github.com/opencv/opencv/pull/29 pc 0000000000147334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) https://github.com/opencv/opencv/pull/30 pc 00000000001561b4 /apex/com.android.runtime/lib64/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+252) https://github.com/opencv/opencv/pull/31 pc 00000000004d8834 /apex/com.android.runtime/lib64/libart.so (_ZN3art12_GLOBAL__N_118InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS0_8ArgArrayEPNS_6JValueEPKc+104) https://github.com/opencv/opencv/pull/32 pc 00000000004d98c8 /apex/com.android.runtime/lib64/libart.so (_ZN3art35InvokeVirtualOrInterfaceWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDPK6jvalue+416) https://github.com/opencv/opencv/pull/33 pc 000000000051caa0 /apex/com.android.runtime/lib64/libart.so (_ZN3art6Thread14CreateCallbackEPv+1232) https://github.com/opencv/opencv/pull/34 pc 00000000000cf7c0 /apex/com.android.runtime/lib64/bionic/libc.so (_ZL15__pthread_startPv+36) https://github.com/opencv/opencv/pull/35 pc 00000000000721a8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

Java Stack: ⇢ pool-25-thread-1 (215032) RUNNABLE java.lang.Runtime.nativeLoad(Native Method) java.lang.Runtime.nativeLoad(Runtime.java:1115) java.lang.Runtime.load0(Runtime.java:936) java.lang.System.load(System.java:1632)

*it show error at the line aarch64-linux-android-addr2line -e libscan-lib.so -s -f -C 00000000005d21fc google::protobuf::Reflection::GetUInt64(google::protobuf::Message const&, google::protobuf::FieldDescriptor const) const generated_message_reflection.cc:1580

aarch64-linux-android-addr2line -e libscan-lib.so -s -f -C 00000000005d2284 google::protobuf::internal::ReflectionSchema::InRealOneof(google::protobuf::FieldDescriptor const*) const generated_message_reflection.h:125**

jiabailong avatar Sep 02 '22 02:09 jiabailong

Can you provide a few more details here? What runtime/compiler are you using? Can you provide us a reproduction case?

deannagarcia avatar Sep 07 '22 21:09 deannagarcia

provide us a reproduction case

cross compile system=Linux ls 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux android-ndk-r21e

this is cmake script mkdir my_build_dir_arm64 cd my_build_dir_arm64 rm ../CMakeCache.txt

export ANDROID_NDK=/root/android-ndk-r21e

cmake .. -D CMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -D ANDROID_STL=c++_shared -D CMAKE_ANDROID_NDK=$ANDROID_NDK -D ANDROID_NATIVE_API_LEVEL=19 -D BUILD_ANDROID_PROJECTS=OFF -D BUILD_ANDROID_EXAMPLES=OFF -D CMAKE_BUILD_TYPE=Release -D BUILD_JAVA=OFF -D ANDROID_ABI=arm64-v8a -D CMAKE_INSTALL_PREFIX=/root/jiatmparm64 -D BUILD_ANDROID_PROJECTS=OFF -D BUILD_SHARED_LIBS=OFF -D BUILD_opencv_java_bindings_generator=OFF -D BUILD_opencv_ts=OFF -D BUILD_opencv_video=OFF -D BUILD_opencv_videoio=OFF -D BUILD_opencv_videostab=OFF -D BUILD_opencv_world=OFF -D BUILD_opencv_shape=OFF -D BUILD_opencv_stitching=OFF -D BUILD_opencv_superres=OFF -D BUILD_opencv_photo=OFF -D BUILD_opencv_highgui=OFF -D BUILD_opencv_ml=OFF -D BUILD_opencv_calib3d=OFF -D BUILD_opencv_flann=OFF -D BUILD_opencv_features2d=OFF -D BUILD_opencv_objdetect=OFF -D BUILD_TIFF=OFF -D WITH_TIFF=OFF -D BUILD_JASPER=OFF -D WITH_JASPER=OFF -D BUILD_WEBP=OFF -D WITH_WEBP=OFF -D BUILD_OPENEXR=OFF -D WITH_OPENEXR=OFF -D WITH_IMGCODEC_HDR=OFF -D WITH_IMGCODEC_SUNRASTER=OFF -D WITH_IMGCODEC_PXM=OFF -D CV_TRACE=OFF -D BUILD_opencv_gapi=OFF -D BUILD_ZLIB:BOOL=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.5.5/modules/wechat_qrcode
make -j$(nproc) make install

on android device 1,000 crashes per million pv. some user crash when android execute function dlope,they start deivce will still crash at dlopen,but the problem is that I can‘t find the reproduction case.

jiabailong avatar Sep 08 '22 02:09 jiabailong

Can you provide a few more details here? What runtime/compiler are you using? Can you provide us a reproduction case?

arm-linux-androideabi-addr2line -e libscan-lib.so -s -f -C 002fa3d8 unsigned char google::protobuf::io::EpsCopyOutputStream::UnsafeVarint(unsigned int, unsigned char) coded_stream.h:937** **

- [ ] it is crash at line 937 what is "0x80" mean

**

template <typename T> PROTOBUF_ALWAYS_INLINE static uint8_t* UnsafeVarint(T value, uint8_t* ptr) { static_assert(std::is_unsigned<T>::value, "Varint serialization must be unsigned"); ptr[0] = static_cast<uint8_t>(value); if (value < 0x80) { return ptr + 1; } // Turn on continuation bit in the byte we just wrote. ptr[0] |= static_cast<uint8_t>(0x80); value >>= 7; ptr[1] = static_cast<uint8_t>(value); if (value < 0x80) { return ptr + 2; } ptr += 2; do { // Turn on continuation bit in the byte we just wrote. ptr[-1] |= static_cast<uint8_t>(0x80); value >>= 7; *ptr = static_cast<uint8_t>(value); ++ptr; } while (value >= 0x80); return ptr; }

jiabailong avatar Sep 09 '22 08:09 jiabailong

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] avatar Jan 01 '24 10:01 github-actions[bot]

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

github-actions[bot] avatar Jan 17 '24 10:01 github-actions[bot]