gpt4 book ai didi

android - 如何理解 android ndk (c++) 中的崩溃原因

转载 作者:行者123 更新时间:2023-11-28 02:52:29 25 4
gpt4 key购买 nike

我如何理解 android ndk 程序崩溃的原因?我尝试使用 addr2line 和 ndk-stack 工具,但来自 c++ 应用程序的崩溃日志没有意义。以下是崩溃日志示例。我怎样才能像在java程序中那样获得崩溃日志?提前致谢。

03-29 12:11:07.890      146-146/? I/DEBUG﹕ r0 0000000c  r1 00000000  r2 00000001  r3 00000004
03-29 12:11:07.890 146-146/? I/DEBUG﹕ r4 0000000c r5 00000000 r6 00000000 r7 51625fa0
03-29 12:11:07.890 146-146/? I/DEBUG﹕ r8 54b71c58 r9 51625f98 sl 51773118 fp 54b71c0c
03-29 12:11:07.890 146-146/? I/DEBUG﹕ ip 4f0c0fa4 sp 54b71bc0 lr 40263c1b pc 4025c310 cpsr 20000010
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d0 5374726174536e4f d1 61542f6f696c6c63
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d2 6964654d2f736b61 d3 72656e6e6163536e
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d4 4c5481d04c548198 d5 4c5482404c548208
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d6 4c5482b04c548278 d7 4c5483204c5482e8
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d8 0000000000000000 d9 0000000000000000
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d10 0000000000000000 d11 0000000000000000
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d12 0000000000000000 d13 0000000000000000
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d14 0000000000000000 d15 0000000000000000
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d16 4c5483904c548358 d17 4c712f784c548400
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d18 4c712fe84c712fb0 d19 4c72ece04c713020
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d20 4c72e9604c72e928 d21 4c72e9d04c72e998
03-29 12:11:07.890 146-146/? I/DEBUG﹕ d22 4c72eab04c72ea78 d23 4c72ec384c72ec00
03-29 12:11:07.900 146-146/? I/DEBUG﹕ d24 3ff0000000000000 d25 0000000000000000
03-29 12:11:07.900 146-146/? I/DEBUG﹕ d26 4040000000000000 d27 0000000000000000
03-29 12:11:07.900 146-146/? I/DEBUG﹕ d28 001e001d001c001b d29 0020001f001e001c
03-29 12:11:07.900 146-146/? I/DEBUG﹕ d30 003a003a003a003a d31 0000000000000000
03-29 12:11:07.900 146-146/? I/DEBUG﹕ scr 28000011
03-29 12:11:07.910 146-146/? I/DEBUG﹕ backtrace:
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #00 pc 00012310 /system/lib/libc.so
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #01 pc 00019c17 /system/lib/libc.so (readdir+10)
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #02 pc 00003278 /data/data/com.perm.Stellio/lib/libtaglib.so (iterateDir+172)
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #03 pc 00003248 /data/data/com.perm.Stellio/lib/libtaglib.so (iterateDir+124)
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #04 pc 000031a0 /data/data/com.perm.Stellio/lib/libtaglib.so (Java_com_perm_Stellio_Tasks_MediaScanner_scanNdk+104)
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #05 pc 0001f470 /system/lib/libdvm.so (dvmPlatformInvoke+112)
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #06 pc 0004e1b9 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+360)
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #07 pc 0004ff03 /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+174)
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #08 pc 00028920 /system/lib/libdvm.so
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #09 pc 0002d0e8 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
03-29 12:11:07.910 146-146/? I/DEBUG﹕ #10 pc 0005f841 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ #11 pc 0005f86b /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ #12 pc 00054c27 /system/lib/libdvm.so
03-29 12:11:07.920 146-146/? I/DEBUG﹕ #13 pc 00012ff0 /system/lib/libc.so (__thread_entry+48)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ #14 pc 00012748 /system/lib/libc.so (pthread_create+172)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ stack:
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71b80 c0000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71b84 00001078
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71b88 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71b8c 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71b90 00001080
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71b94 4025f69b /system/lib/libc.so (dlmalloc+5326)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71b98 00001000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71b9c 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71ba0 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71ba4 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71ba8 51625fa0
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bac 4025f9b1 /system/lib/libc.so (dlfree+56)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bb0 4025f979 /system/lib/libc.so (dlfree)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bb4 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bb8 df0027ad
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bbc 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ #00 54b71bc0 00000004
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bc4 0000000c
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bc8 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bcc 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bd0 51625fa0
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bd4 40263c1b /system/lib/libc.so (readdir+14)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ #01 54b71bd8 00000004
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bdc 4c755c88 /dev/ashmem/dalvik-LinearAlloc (deleted)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71be0 51773108
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71be4 4f0bb27c /data/data/com.perm.Stellio/lib/libtaglib.so (iterateDir+176)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ #02 54b71be8 51625f98
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bec 5174b548
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bf0 54b71c34 [stack:3321]
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bf4 40261171 /system/lib/libc.so (malloc+12)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bf8 00000000
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71bfc 4f0bb369 /data/data/com.perm.Stellio/lib/libtaglib.so (operator new(unsigned int)+20)
03-29 12:11:07.920 146-146/? I/DEBUG﹕ 54b71c00 4c755c88 /dev/ashmem/dalvik-LinearAlloc (deleted)
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 54b71c04 4f0bb3c7 /data/data/com.perm.Stellio/lib/libtaglib.so (operator new[](unsigned int)+6)
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 54b71c08 54b71c34 [stack:3321]
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 54b71c0c 4f0bb24c /data/data/com.perm.Stellio/lib/libtaglib.so (iterateDir+128)
03-29 12:11:07.930 146-146/? I/DEBUG﹕ memory near r7:
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 51625f80 424e13b8 51625fb0 5333debc 4c755c88 ..NB._bQ..3S.\uL
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 51625f90 00000000 00000000 1d400005 51625fe0 ..........@.._bQ
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 51625fa0 5330559a 4c755cc8 5333debc 00000000 .U0S.\uL..3S....
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 51625fb0 0d1b58ee 00000145 424ccf50 00000001 .X..E...P.LB....
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 51625fc0 00000000 424e1288 42440710 51626000 ......NB..DB.`bQ
03-29 12:11:07.930 146-146/? I/DEBUG﹕ memory near r8:
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 54b71c38 00000000 1d400005 1d500001 5179d3c8 ......@...P...yQ
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 54b71c48 50274728 5013f898 54b71c6c 40c3c474 (G'P...Pl..Tt..@
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 54b71c58 51625f98 00000001 4245d268 53388257 ._bQ....h.EBW.8S
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 54b71c68 00000000 40c6b1bd 51625f98 53388255 .......@._bQU.8S
03-29 12:11:07.930 146-146/? I/DEBUG﹕ 54b71c78 4f0bb138 51773118 1d500001 00000000 8..O.1wQ..P.....
03-29 12:11:07.940 146-146/? I/DEBUG﹕ memory near r9:
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 51625f78 53353f66 424ccb88 424e13b8 51625fb0 f?5S..LB..NB._bQ
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 51625f88 5333debc 4c755c88 00000000 00000000 ..3S.\uL........
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 51625f98 1d400005 51625fe0 5330559a 4c755cc8 ..@.._bQ.U0S.\uL
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 51625fa8 5333debc 00000000 0d1b58ee 00000145 ..3S.....X..E...
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 51625fb8 424ccf50 00000001 00000000 424e1288 P.LB..........NB
03-29 12:11:07.940 146-146/? I/DEBUG﹕ memory near sl:
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 517730f8 21cd6b00 0000b397 00000038 00000453 .k.!....8...S...
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 51773108 4d65d188 51625f98 4c755cc8 5007d000 ..eM._bQ.\uL...P
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 51773118 0d1b58ee 00000145 54b71da8 00000000 .X..E......T....
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 51773128 54b71ddc 00000011 00000000 40c3c600 ...T...........@
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 51773138 00000000 00000000 40a87b70 51622300 ........p{.@.#bQ
03-29 12:11:07.940 146-146/? I/DEBUG﹕ memory near fp:
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71bec 5174b548 54b71c34 40261171 00000000 H.tQ4..Tq.&@....
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71bfc 4f0bb369 4c755c88 4f0bb3c7 54b71c34 i..O.\uL...O4..T
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71c0c 4f0bb24c 51625f98 5013f898 54b71c54 L..O._bQ...PT..T
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71c1c 04261171 502459e0 502459f0 50245a03 q.&..Y$P.Y$P.Z$P
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71c2c 5174b548 54b71c54 4f0bb1a4 00000000 H.tQT..T...O....
03-29 12:11:07.940 146-146/? I/DEBUG﹕ memory near ip:
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4f0c0f84 4026926d 40269385 40258760 4021739d m.&@..&@`.%@.s!@
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4f0c0f94 40258668 40261179 40263ba9 4026cc41 h.%@y.&@.;&@A.&@
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4f0c0fa4 40263c0d 40263c95 40261165 40257e00 .<&@.<&@e.&@.~%@
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4f0c0fb4 4025c4b0 4025c8b0 40256ca8 4025cc30 ..%@..%@.l%@0.%@
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4f0c0fc4 4025d2e4 4025d4c0 402584c8 4025d414 ..%@..%@..%@..%@
03-29 12:11:07.940 146-146/? I/DEBUG﹕ memory near sp:
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71ba0 00000000 00000000 51625fa0 4025f9b1 ........._bQ..%@
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71bb0 4025f979 00000000 df0027ad 00000000 y.%@.....'......
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71bc0 00000004 0000000c 00000000 00000000 ................
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71bd0 51625fa0 40263c1b 00000004 4c755c88 ._bQ.<&@.....\uL
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 54b71be0 51773108 4f0bb27c 51625f98 5174b548 .1wQ|..O._bQH.tQ
03-29 12:11:07.940 146-146/? I/DEBUG﹕ code around pc:
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4025c2f0 e3a00000 e12fff1e e3822901 eafffffa ....../..)......
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4025c300 e92d40f8 e2504000 03a00016 08bd80f8 .@-..@P.........
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4025c310 e5942000 e2126903 e2025a02 1a000017 . ...i...Z......
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4025c320 e3853001 e1942f9f e3a01000 e1320005 .0.../........2.
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 4025c330 01841f93 e3510000 1afffff9 e1550002 ......Q.......U.
03-29 12:11:07.940 146-146/? I/DEBUG﹕ code around lr:
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 40263bf8 60052100 60816041 000cf100 eb4af7f8 .!.`A`.`......J.
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 40263c08 bd384620 f100b538 4605040c f7f84620 F8.8......F F..
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 40263c18 4628ec4c ff9af7ff 46204605 ee44f7f8 L.(F.....F F..D.
03-29 12:11:07.940 146-146/? I/DEBUG﹕ 40263c28 bd384628 43f8e92d 460e4690 f7f94604 (F8.-..C.F.F.F..
03-29 12:11:07.950 146-146/? I/DEBUG﹕ 40263c38 2500ff8f 9000f8d0 5000f8c8 ff88f7f9 ...%.......P....

最佳答案

您尝试过 Valgrind 吗?它主要检测与内存相关的错误,但也可以扩展到其他目标段。 http://valgrind.org/downloads/

关于android - 如何理解 android ndk (c++) 中的崩溃原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22729164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com