A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 25427 (pool-1-thread-2)

本文介绍了一种解决Android应用程序偶发性崩溃的方法。当遇到只有一行致命信号信息(SIGSEGV)的崩溃时,可以通过使用NDK提供的ndk-stack工具定位错误。文中提供了两种实用方法:直接抓取日志进行分析以及先抓取日志再利用ndk-stack工具进行解析。

开发的Android工程偶发性的crash掉,还没有任何可以捕获的log信息。

琢磨了一小会儿,才发现关键的crash信息是这个。


A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 25427 (pool-1-thread-2)


只有这么一行,其他没有。

搜索了下,这个问题往往出在使用的so库里面。

需要用ndk-stack工具来定位错误。


使用方法1:

直接抓log分析 adb logcat | $NDK/ndk-stack -sym $PROJECT_PATH/obj/local/armeabi ;

但对于偶发性的崩溃,直接抓log很崩溃。。。


所以使用方法2:

adb logcat >crash.txt  抓出log;

$NDK/ndk-stack -sym $PROJECT_PATH/obj/local/armeabi -dumpcrash.txt  获取错误信息;

解析这个crash Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 25453 (binder:2538 Process name is /vendor/bin/hw/camerahalserver, uid is 1047, not key_process keyProcess: 0 *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'OPPO/OPD2503/OP6573L1:16/BP2A.250605.015/V.R4T2.4ebdc49-2f98630-2f986 Revision: '0' ABI: 'arm64' Timestamp: 2025-01-03 16:21:15.924121799+0800 Process uptime: 0s Cmdline: /vendor/bin/hw/camerahalserver pid: 25381, tid: 25453, name: binder:25381_2 >>> /vendor/bin/hw/camerahalserver <<< uid: 1047 tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE) signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000 Cause: null pointer dereference x0 0000000000000000 x1 00000071800a6c5e x2 0000000000000001 x3 000000000000007 x4 0000000000000072 x5 00000070883e5242 x6 0000000000000031 x7 7f7f7f7f7f7f7f7 x8 000000718013f6e0 x9 000000000000000a x10 00000070883e56d8 x11 00000071800a2b2 x12 0000000000000016 x13 0000000000000001 x14 00000000ffffffff x15 00000000ffffffa x16 000000714a4fb528 x17 000000717bb66140 x18 0000007087788000 x19 000000000000000 x20 0000000000000001 x21 000000714dfe15f1 x22 0000007122d73c20 x23 000000714dff400 x24 0000007122d73c20 x25 000000714dff47d0 x26 0000000000000000 x27 00000070883e6e4 x28 0000000000000000 x29 00000070883e5b40 lr 00000071800ffef4 sp 00000070883e5b30 pc 00000071800fff8c pst 000000004000100 14 total frames backtrace: #00 pc 0000000000084f8c /vendor/lib64/mt6878/libmtkcam_hal_core_device.so (Preconf #01 pc 000000000000c460 /vendor/lib64/libcamera_sendextdata.so (PreOpenProc::proce #02 pc 000000000000e26c /vendor/lib64/libcamera_sendextdata.so (SendExtCamData::pr #03 pc 0000000000007d50 /vendor/lib64/hw/vendor.oplus.hardware.sendextcamcmd-V1-se #04 pc 00000000000046ac /odm/lib64/vendor.oplus.hardware.sendextcamcmd-V2-ndk_plat #05 pc 00000000000142cc /system/lib64/libbinder_ndk.so (ABBinder::onTransact(unsig #06 pc 000000000004d910 /system/lib64/libbinder.so (android::BBinder::transact(uns #07 pc 000000000004e0b0 /system/lib64/libbinder.so (android::IPCThreadState::execu #08 pc 0000000000075f44 /system/lib64/libbinder.so (android::IPCThreadState::joinT #09 pc 0000000000075ae0 /system/lib64/libbinder.so (android::PoolThread::threadLoo #10 pc 0000000000019368 /system/lib64/libutils.so (android::Thread::_threadLoop(vo #11 pc 000000000001bac4 /system/lib64/libutils.so (libutil_thread_trampoline(void* #12 pc 00000000000984f8 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_ #13 pc 000000000008aa50 /apex/com.android.runtime/lib64/bionic/libc.so (__start_th mtk-brm-commit-id:dd4929e6a71bd0be06b2d18234833692e8dec44f mtk-brm-change-id:I4260c971d731b542818aac96725266c809617407 mtk-brm-merge-id:none mtk-brm-commit-id:8d52b75ecea4b0c2129c05428261104d5b4c7e6f mtk-brm-change-id:Idfe06ff5198c0d6cc7248bb4a94299f37013c3e3 mtk-brm-merge-id:none mtk-brm-commit-id:75cae65534b8c9848b9772485188383d28b67130 mtk-brm-change-id:I18c004bf864f9dbfe4d108f467564e40aaa8d160 mtk-brm-merge-id:none ft: mtk-brm-commit-id:49cd5f52861803b5de11ec9fdbf488b2e38f2aa1 ft: mtk-brm-change-id:Ie39aea11d551f45b01d90bc4ee5702aa6025f0f3 ft: mtk-brm-merge-id:none Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 25807 (Binder:came Process name is /vendor/bin/hw/camerahalserver, uid is 1047, not key_process keyProcess: 0 *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'OPPO/OPD2503/OP6573L1:16/BP2A.250605.015/V.R4T2.4ebdc49-2f98630-2f986 Revision: '0' ABI: 'arm64' Timestamp: 2025-01-03 16:23:06.019434652+0800 Process uptime: 0s Cmdline: /vendor/bin/hw/camerahalserver pid: 25807, tid: 25807, name: Binder:cameraha >>> /vendor/bin/hw/camerahalserver <<< uid: 1047 tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE) signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000 Cause: null pointer dereference x0 0000000000000000 x1 000000746aad4c5e x2 0000000000000001 x3 000000000000007 x4 0000000000000072 x5 0000007fcc0dc6d2 x6 0000000000000031 x7 7f7f7f7f7f7f7f7 x8 000000746ab6d6e0 x9 000000000000000a x10 0000007fcc0dcb68 x11 000000746aad0b2 x12 0000000000000016 x13 0000000000000001 x14 00000000ffffffff x15 00000000ffffffa x16 00000073f04b0528 x17 00000074411cc140 x18 b40000733e56e608 x19 000000000000000 x20 0000000000000001 x21 00000073f04575f1 x22 000000746c04fc20 x23 00000073f046a00 x24 000000746c04fc20 x25 00000073f046a7d0 x26 0000000000000000 x27 0000007478bc9e4 x28 0000000000000000 x29 0000007fcc0dcfd0 lr 000000746ab2def4 sp 0000007fcc0dcfc0 pc 000000746ab2df8c pst 000000004000100 11 total frames backtrace: #00 pc 0000000000084f8c /vendor/lib64/mt6878/libmtkcam_hal_core_device.so (Preconf #01 pc 000000000000c460 /vendor/lib64/libcamera_sendextdata.so (PreOpenProc::proce #02 pc 000000000000e26c /vendor/lib64/libcamera_sendextdata.so (SendExtCamData::pr #03 pc 0000000000007d50 /vendor/lib64/hw/vendor.oplus.hardware.sendextcamcmd-V1-se #04 pc 00000000000046ac /odm/lib64/vendor.oplus.hardware.sendextcamcmd-V2-ndk_plat #05 pc 00000000000142cc /system/lib64/libbinder_ndk.so (ABBinder::onTransact(unsig #06 pc 000000000004d910 /system/lib64/libbinder.so (android::BBinder::transact(uns #07 pc 000000000004e0b0 /system/lib64/libbinder.so (android::IPCThreadState::execu #08 pc 0000000000075f44 /system/lib64/libbinder.so (android::IPCThreadState::joinT #09 pc 00000000000075c8 /vendor/bin/hw/mt6878/camerahalserver (main+3128) (BuildId #10 pc 0000000000080468 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_ini mtk-brm-commit-id:dd4929e6a71bd0be06b2d18234833692e8dec44f mtk-brm-change-id:I4260c971d731b542818aac96725266c809617407 mtk-brm-merge-id:none mtk-brm-commit-id:8d52b75ecea4b0c2129c05428261104d5b4c7e6f mtk-brm-change-id:Idfe06ff5198c0d6cc7248bb4a94299f37013c3e3 mtk-brm-merge-id:none mtk-brm-commit-id:75cae65534b8c9848b9772485188383d28b67130 mtk-brm-change-id:I18c004bf864f9dbfe4d108f467564e40aaa8d160 mtk-brm-merge-id:none ft: mtk-brm-commit-id:49cd5f52861803b5de11ec9fdbf488b2e38f2aa1 ft: mtk-brm-change-id:Ie39aea11d551f45b01d90bc4ee5702aa6025f0f3 ft: mtk-brm-merge-id:none
08-14
Process name is com.oplus.camera, uid is 10158, not key_process keyProcess: 0 *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: realme/RMP2502IN/RE6453L1:16/BP2A.250605.015/B.R4T1.47a0950-26d089e-26d0a14:user/release-keys Revision: 0 ABI: arm64 Timestamp: 2025-11-11 23:44:48.477685001+0800 Process uptime: 450s Cmdline: com.oplus.camera pid: 5867, tid: 5870, name: Jit thread pool >>> com.oplus.camera <<< uid: 10158 tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE) signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x00d28606563d752f x0 0000007447291d58 x1 0000007250c01010 x2 000000000000000d x3 0000000000000010 x4 0000000000000000 x5 00000000000001f1 x6 0000000000ffff5a x7 0000000000ff09b0 x8 0000007241a01010 x9 0000007250c01010 x10 d5d28606563d752f x11 00000071bf401010 x12 0000000000000007 x13 0000000000000009 x14 0000000000000009 x15 0000000000000001 x16 0000000000000001 x17 00000074d02e0750 x18 00000073adc3c000 x19 0000007250c00000 x20 000000744728fb40 x21 0000000000000010 x22 000000000000000d x23 00000000000001f1 x24 0000000000000000 x25 00000074d035e000 x26 0000007250c00078 x27 00000000000001f1 x28 00000000003e3ff0 x29 000000740b06c820 lr 00000074d02aa940 sp 000000740b06c820 pc 00000074d02aac54 pst 0000000060001000 19 total frames backtrace: #00 pc 0000000000068c54 /apex/com.android.runtime/lib64/bionic/libc.so (arena_run_heap_remove+52) (BuildId: 65b0c8857610bf85fb81a624be775cc4) #01 pc 000000000006893c /apex/com.android.runtime/lib64/bionic/libc.so (arena_run_split_remove+76) (BuildId: 65b0c8857610bf85fb81a624be775cc4) #02 pc 00000000000686a0 /apex/com.android.runtime/lib64/bionic/libc.so (arena_run_split_large_helper+224) (BuildId: 65b0c8857610bf85fb81a624be775cc4) #03 pc 0000000000062648 /apex/com.android.runtime/lib64/bionic/libc.so (arena_purge_to_limit+360) (BuildId: 65b0c8857610bf85fb81a624be775cc4) #04 pc 0000000000062304 /apex/com.android.runtime/lib64/bionic/libc.so (je_arena_maybe_purge+836) (BuildId: 65b0c8857610bf85fb81a624be775cc4) #05 pc 0000000000064ad4 /apex/com.android.runtime/lib64/bionic/libc.so (arena_dalloc_bin_locked_impl+516) (BuildId: 65b0c8857610bf85fb81a624be775cc4) #06 pc 0000000000064be4 /apex/com.android.runtime/lib64/bionic/libc.so (je_arena_dalloc_small+132) (BuildId: 65b0c8857610bf85fb81a624be775cc4) #07 pc 0000000000076a44 /apex/com.android.runtime/lib64/bionic/libc.so (je_free+132) (BuildId: 65b0c8857610bf85fb81a624be775cc4) #08 pc 0000000000366538 /apex/com.android.art/lib64/libart.so (std::__1::deque<elf64_sym, std::__1::allocator<elf64_sym>>::~deque[abi:nn200000]()+124) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1) #09 pc 000000000036604c /apex/com.android.art/lib64/libart.so (art::ElfBuilder<art::ElfTypes64>::~ElfBuilder()+256) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1) #10 pc 0000000000366f6c /apex/com.android.art/lib64/libart.so (art::debug::MakeElfFileForJIT(art::InstructionSet, art::InstructionSetFeatures const*, bool, art::debug::MethodDebugInfo const&)+292) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1) #11 pc 00000000004bc4cc /apex/com.android.art/lib64/libart.so (art::OptimizingCompiler::JitCompile(art::Thread*, art::jit::JitCodeCache*, art::jit::JitMemoryRegion*, art::ArtMethod*, art::CompilationKind, art::jit::JitLogger*)+1144) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1) #12 pc 000000000060d490 /apex/com.android.art/lib64/libart.so (art::jit::JitCompiler::CompileMethod(art::Thread*, art::jit::JitMemoryRegion*, art::ArtMethod*, art::CompilationKind)+1388) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1) #13 pc 0000000000493780 /apex/com.android.art/lib64/libart.so (art::jit::Jit::CompileMethodInternal(art::ArtMethod*, art::Thread*, art::CompilationKind, bool)+368) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
最新发布
11-13
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值