Android:JNI崩溃

时间:2013-12-10 17:14:56

标签: java crash java-native-interface clang

我正在开发通过C API(libclang)为ARM使用Clang的Android应用程序。 我已经为invoke clang_..()函数编写了包装器,并在Java< - >本机代码之间映射数据。所以应用程序工作了几次然后崩溃。它与来自java后台线程的本机代码进行交互(如果有帮助)。

我对错误的看法是:

  1. 我正在尝试删除已删除的指针
  2. 我的代码/ clang中存在内存泄漏,并且堆已完全分配
  3. 并发问题
  4. 高度赞赏任何想法:

    12-10 23:03:55.382: ASSERT/libc(2763): Fatal signal 11 (SIGSEGV) at 0x00000acb (code=0), thread 3690 (Thread-545)
    
    // ...
    
    12-10 23:03:55.883: INFO/DEBUG(167): backtrace:
    12-10 23:03:55.883: INFO/DEBUG(167): #00  pc 0017b198  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::cxdiag::lazyCreateDiags(CXTranslationUnitImpl*, bool)+200)
    12-10 23:03:55.883: INFO/DEBUG(167): #01  pc 00009028  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so (Java_name_antonsmirnov_clang_clang_1wrapper_getDiagnostics+72)
    12-10 23:03:55.883: INFO/DEBUG(167): #02  pc 0001fb70  /system/lib/libdvm.so (dvmPlatformInvoke+112)
    12-10 23:03:55.883: INFO/DEBUG(167): #03  pc 0004e8b9  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+360)
    12-10 23:03:55.883: INFO/DEBUG(167): #04  pc 00029020  /system/lib/libdvm.so
    12-10 23:03:55.883: INFO/DEBUG(167): #05  pc 0002d7e8  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
    12-10 23:03:55.883: INFO/DEBUG(167): #06  pc 0005fed5  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
    12-10 23:03:55.883: INFO/DEBUG(167): #07  pc 0005feff  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
    12-10 23:03:55.883: INFO/DEBUG(167): #08  pc 00055327  /system/lib/libdvm.so
    12-10 23:03:55.883: INFO/DEBUG(167): #09  pc 00012e70  /system/lib/libc.so (__thread_entry+48)
    12-10 23:03:55.883: INFO/DEBUG(167): #10  pc 000125c8  /system/lib/libc.so (pthread_create+172)
    12-10 23:03:55.883: INFO/DEBUG(167): stack:
    12-10 23:03:55.883: INFO/DEBUG(167): 76475be0  00000004
    12-10 23:03:55.883: INFO/DEBUG(167): 76475be4  1d300005
    12-10 23:03:55.883: INFO/DEBUG(167): 76475be8  76475c04  [stack:3690]
    12-10 23:03:55.883: INFO/DEBUG(167): 76475bec  735086e0
    12-10 23:03:55.883: INFO/DEBUG(167): 76475bf0  731a51c8
    12-10 23:03:55.883: INFO/DEBUG(167): 76475bf4  00000000
    12-10 23:03:55.883: INFO/DEBUG(167): 76475bf8  731a3f48
    12-10 23:03:55.883: INFO/DEBUG(167): 76475bfc  76475c80  [stack:3690]
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c00  7373df30
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c04  7160ca88
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c08  76475c7c  [stack:3690]
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c0c  40137ff1  /system/lib/libc.so (malloc+12)
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c10  75fcda38  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c14  402028ff  /system/lib/libstdc++.so (operator new[](unsigned int)+6)
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c18  df0027ad
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c1c  00000000
    12-10 23:03:55.883: INFO/DEBUG(167): #00  76475c20  1d300005
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c24  7308de78
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c28  76475c54  [stack:3690]
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c2c  715ebdb0  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so (unmapTranslationUnit+56)
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c30  7308de78
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c34  715f1620  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c38  1d200005
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c3c  0008de78
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c40  1d300005
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c44  6da271c0  /dev/ashmem/dalvik-LinearAlloc (deleted)
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c48  7160ca78
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c4c  00000004
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c50  7373df38
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c54  715ef02c  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so (Java_name_antonsmirnov_clang_clang_1wrapper_getDiagnostics+76)
    12-10 23:03:55.883: INFO/DEBUG(167): #01  76475c58  6d707560  /dev/ashmem/dalvik-LinearAlloc (deleted)
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c5c  1d300005
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c60  1d300001
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c64  7308de78
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c68  42802618  /dev/ashmem/dalvik-heap (deleted)
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c6c  731a51c8
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c70  7160ca78
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c74  7160cb20
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c78  76475c94  [stack:3690]
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c7c  41463b74  /system/lib/libdvm.so (dvmPlatformInvoke+116)
    12-10 23:03:55.883: INFO/DEBUG(167): #02  76475c80  7373df2c
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c84  00000001
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c88  427fe0c8  /dev/ashmem/dalvik-heap (deleted)
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c8c  741b6c52  /data/dalvik-cache/data@app@name.antonsmirnov.android.arduinodroid-1.apk@classes.dex
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c90  00000000
    12-10 23:03:55.883: INFO/DEBUG(167): 76475c94  414928bd  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+364)
    12-10 23:03:55.893: INFO/DEBUG(167): memory near r0:
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c00 7373df30 7160ca88 76475c7c 40137ff1  0.ss..`q|\Gv...@
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c10 75fcda38 402028ff df0027ad 00000000  8..u.( @.'......
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c20 1d300005 7308de78 76475c54 715ebdb0  ..0.x..sT\Gv..^q
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c30 7308de78 715f1620 1d200005 0008de78  x..s ._q.. .x...
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c40 1d300005 6da271c0 7160ca78 00000004  ..0..q.mx.`q....
    12-10 23:03:55.893: INFO/DEBUG(167): memory near r2:
    12-10 23:03:55.893: INFO/DEBUG(167): 73265708 00000002 7326f158 72d26e70 7324d350  ....X.&spn.rP.$s
    12-10 23:03:55.893: INFO/DEBUG(167): 73265718 0000006a 00000000 00000050 00000043  j.......P...C...
    12-10 23:03:55.893: INFO/DEBUG(167): 73265728 00000001 401000f0 00000000 00000006  .......@........
    12-10 23:03:55.893: INFO/DEBUG(167): 73265738 0000000a 0000000a 00000008 00000000  ................
    12-10 23:03:55.893: INFO/DEBUG(167): 73265748 00000e60 749a3930 749a3930 00000000  `...09.t09.t....
    12-10 23:03:55.893: INFO/DEBUG(167): memory near r4:
    12-10 23:03:55.893: INFO/DEBUG(167): 735086c0 00790063 00750066 00760079 00000076  c.y.f.u.y.v.v...
    12-10 23:03:55.893: INFO/DEBUG(167): 735086d0 006a0020 00670062 00000068 0000001b   .j.b.g.h.......
    12-10 23:03:55.893: INFO/DEBUG(167): 735086e0 75fcda38 00000000 00000000 00000000  8..u............
    12-10 23:03:55.893: INFO/DEBUG(167): 735086f0 00000000 0000001b 00000001 00000001  ................
    12-10 23:03:55.893: INFO/DEBUG(167): 73508700 72cfb378 00000000 00000018 000000bb  x..r............
    12-10 23:03:55.893: INFO/DEBUG(167): memory near r5:
    12-10 23:03:55.893: INFO/DEBUG(167): 731a51a8 749a3930 749a3930 749a3930 00000000  09.t09.t09.t....
    12-10 23:03:55.893: INFO/DEBUG(167): 731a51b8 00000000 00000000 00000000 00000023  ............#...
    12-10 23:03:55.893: INFO/DEBUG(167): 731a51c8 715a1dc0 731a3f48 72dbafc0 735086e0  ..ZqH?.s...r..Ps
    12-10 23:03:55.893: INFO/DEBUG(167): 731a51d8 73121220 00000000 00000000 0000001b   ..s............
    12-10 23:03:55.893: INFO/DEBUG(167): 731a51e8 00000005 00000005 00000000 6e616c63  ............clan
    12-10 23:03:55.893: INFO/DEBUG(167): memory near r6:
    12-10 23:03:55.893: INFO/DEBUG(167): 73265708 00000002 7326f158 72d26e70 7324d350  ....X.&spn.rP.$s
    12-10 23:03:55.893: INFO/DEBUG(167): 73265718 0000006a 00000000 00000050 00000043  j.......P...C...
    12-10 23:03:55.893: INFO/DEBUG(167): 73265728 00000001 401000f0 00000000 00000006  .......@........
    12-10 23:03:55.893: INFO/DEBUG(167): 73265738 0000000a 0000000a 00000008 00000000  ................
    12-10 23:03:55.893: INFO/DEBUG(167): 73265748 00000e60 749a3930 749a3930 00000000  `...09.t09.t....
    12-10 23:03:55.893: INFO/DEBUG(167): memory near r7:
    12-10 23:03:55.893: INFO/DEBUG(167): 731a3f28 00000001 00000001 70a57cd8 00000000  .........|.p....
    12-10 23:03:55.893: INFO/DEBUG(167): 731a3f38 732657a8 70a32c28 00000020 000003b3  .W&s(,.p .......
    12-10 23:03:55.893: INFO/DEBUG(167): 731a3f48 75fcdfc8 731225f0 72d8ddd8 733af500  ...u.%.s...r..:s
    12-10 23:03:55.893: INFO/DEBUG(167): 731a3f58 715b2ac8 00000000 73043e00 73690600  .*[q.....>.s..is
    12-10 23:03:55.893: INFO/DEBUG(167): 731a3f68 734d9f88 00000000 00000000 00000000  ..Ms............
    12-10 23:03:55.893: INFO/DEBUG(167): memory near r8:
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c60 1d300001 7308de78 42802618 731a51c8  ..0.x..s.&.B.Q.s
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c70 7160ca78 7160cb20 76475c94 41463b74  x.`q .`q.\Gvt;FA
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c80 7373df2c 00000001 427fe0c8 741b6c52  ,.ss.......BRl.t
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c90 00000000 414928bd 7373df2c 741b6c50  .....(IA,.ssPl.t
    12-10 23:03:55.893: INFO/DEBUG(167): 76475ca0 715eefe0 7160ca88 00000000 00000000  ..^q..`q........
    12-10 23:03:55.893: INFO/DEBUG(167): memory near r9:
    12-10 23:03:55.893: INFO/DEBUG(167): 7373df10 00000000 00000000 7373df48 7417562c  ........H.ss,V.t
    12-10 23:03:55.893: INFO/DEBUG(167): 7373df20 6da271c0 00000000 00000000 1d300001  .q.m..........0.
    12-10 23:03:55.893: INFO/DEBUG(167): 7373df30 1d300005 7373df84 741750a8 6da26b58  ..0...ss.P.tXk.m
    12-10 23:03:55.893: INFO/DEBUG(167): 7373df40 7417562c 00000000 6d707560 00000000  ,V.t....`upm....
    12-10 23:03:55.893: INFO/DEBUG(167): 7373df50 00000000 00000000 00000006 1d200005  .............. .
    12-10 23:03:55.893: INFO/DEBUG(167): memory near sl:
    12-10 23:03:55.893: INFO/DEBUG(167): 7160ca68 00000002 00000000 00000010 00000453  ............S...
    12-10 23:03:55.893: INFO/DEBUG(167): 7160ca78 74175628 7373df2c 6da26b58 70991000  (V.t,.ssXk.m...p
    12-10 23:03:55.893: INFO/DEBUG(167): 7160ca88 427fded8 00000007 76475da8 00000000  ...B.....]Gv....
    12-10 23:03:55.893: INFO/DEBUG(167): 7160ca98 76475ddc 00000010 00000000 41463d00  .]Gv.........=FA
    12-10 23:03:55.893: INFO/DEBUG(167): 7160caa8 00000000 00000000 6ca88670 7373a300  ........p..l..ss
    12-10 23:03:55.893: INFO/DEBUG(167): memory near fp:
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c5c 1d300005 1d300001 7308de78 42802618  ..0...0.x..s.&.B
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c6c 731a51c8 7160ca78 7160cb20 76475c94  .Q.sx.`q .`q.\Gv
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c7c 41463b74 7373df2c 00000001 427fe0c8  t;FA,.ss.......B
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c8c 741b6c52 00000000 414928bd 7373df2c  Rl.t.....(IA,.ss
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c9c 741b6c50 715eefe0 7160ca88 00000000  Pl.t..^q..`q....
    12-10 23:03:55.893: INFO/DEBUG(167): memory near sp:
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c00 7373df30 7160ca88 76475c7c 40137ff1  0.ss..`q|\Gv...@
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c10 75fcda38 402028ff df0027ad 00000000  8..u.( @.'......
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c20 1d300005 7308de78 76475c54 715ebdb0  ..0.x..sT\Gv..^q
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c30 7308de78 715f1620 1d200005 0008de78  x..s ._q.. .x...
    12-10 23:03:55.893: INFO/DEBUG(167): 76475c40 1d300005 6da271c0 7160ca78 00000004  ..0..q.mx.`q....
    12-10 23:03:55.893: INFO/DEBUG(167): code around pc:
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b178 ebff8235 e3560000 15963000 e1a0000d  5.....V..0......
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b188 e1a02006 12833001 15863000 e5973020  . ...0...0.. 0..
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b198 e5931408 eb0152d7 e59f305c e58d4018  .....R..\0...@..
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b1a8 e58d401c e08f3003 e2833008 e597412c  .@...0...0..,A..
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b1b8 e58d3000 e5977130 ea000002 e1a01004  .0..0q..........
    12-10 23:03:55.893: INFO/DEBUG(167): code around lr:
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b15c e8800048 e580600c e5c06010 e585000c  H....`...`......
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b16c e3a00038 ebff779f e1a06000 ebff8235  8....w...`..5...
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b17c e3560000 15963000 e1a0000d e1a02006  ..V..0....... ..
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b18c 12833001 15863000 e5973020 e5931408  .0...0.. 0......
    12-10 23:03:55.893: INFO/DEBUG(167): 7537b19c eb0152d7 e59f305c e58d4018 e58d401c  .R..\0...@...@..
    12-10 23:03:55.923: DEBUG/WifiStateMachine(539): ConnectedState{ what=131155 when=-4ms arg1=1 }
    12-10 23:03:55.933: DEBUG/WifiStateMachine(539): L2ConnectedState{ what=131155 when=-4ms arg1=1 }
    

    另一次崩溃(可能是另一个原因):

    12-11 00:10:38.106: INFO/DEBUG(166): r0 00000027  r1 deadbaad  r2 4024cb0c  r3 00000000
    12-11 00:10:38.106: INFO/DEBUG(166): r4 00000000  r5 7e7a82bc  r6 00000002  r7 00000002
    12-11 00:10:38.106: INFO/DEBUG(166): r8 00000030  r9 7d3c0590  sl 7d3aae24  fp 40253a6c
    12-11 00:10:38.106: INFO/DEBUG(166): ip 00004000  sp 7e7a82b8  lr 4021ec89  pc 4021b32a  cpsr 60000030
    12-11 00:10:38.106: INFO/DEBUG(166): d0  20656c6966206e69  d1  646564756c636e69
    12-11 00:10:38.106: INFO/DEBUG(166): d2  6f63206d6f726620  d3  645f6574656c706d
    12-11 00:10:38.106: INFO/DEBUG(166): d4  000002db000002c9  d5  000002ed000002ec
    12-11 00:10:38.106: INFO/DEBUG(166): d6  000003ae0000039c  d7  000003d4000003c1
    12-11 00:10:38.106: INFO/DEBUG(166): d8  4418800000000262  d9  4434000043898000
    12-11 00:10:38.106: INFO/DEBUG(166): d10 0000000042c00000  d11 0000000000000000
    12-11 00:10:38.106: INFO/DEBUG(166): d12 0000000000000000  d13 0000000000000000
    12-11 00:10:38.106: INFO/DEBUG(166): d14 0000000000000000  d15 0000000000000000
    12-11 00:10:38.106: INFO/DEBUG(166): d16 6769736e75202c2a  d17 29746e692064656e
    12-11 00:10:38.106: INFO/DEBUG(166): d18 6c63206e6f697461  d19 78654c3a3a676e61
    12-11 00:10:38.106: INFO/DEBUG(166): d20 537465673a3a7265  d21 636f4c656372756f
    12-11 00:10:38.106: INFO/DEBUG(166): d22 6863286e6f697461  d23 74736e6f63207261
    12-11 00:10:38.106: INFO/DEBUG(166): d24 0000000000000000  d25 0000000000000000
    12-11 00:10:38.106: INFO/DEBUG(166): d26 0000000000000000  d27 0000000000000000
    12-11 00:10:38.106: INFO/DEBUG(166): d28 0048004700460044  d29 004a0048004a0049
    12-11 00:10:38.106: INFO/DEBUG(166): d30 0000000000000000  d31 0000000000000000
    12-11 00:10:38.106: INFO/DEBUG(166): scr 28000013
    12-11 00:10:38.126: INFO/DEBUG(166): backtrace:
    12-11 00:10:38.126: INFO/DEBUG(166): #00  pc 0001832a  /system/lib/libc.so
    12-11 00:10:38.126: INFO/DEBUG(166): #01  pc 0000dc04  /system/lib/libc.so (abort+4)
    12-11 00:10:38.126: INFO/DEBUG(166): #02  pc 0001f0df  /system/lib/libc.so (__assert2+30)
    12-11 00:10:38.126: INFO/DEBUG(166): #03  pc 0077c954  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getSourceLocation(char const*, unsigned int) const+76)
    12-11 00:10:38.126: INFO/DEBUG(166): #04  pc 0077ca4c  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::FormTokenWithChars(clang::Token&, char const*, clang::tok::TokenKind)+100)
    12-11 00:10:38.126: INFO/DEBUG(166): #05  pc 00781098  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::LexTokenInternal(clang::Token&)+5616)
    12-11 00:10:38.126: INFO/DEBUG(166): #06  pc 0015de68  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::LexFromRawLexer(clang::Token&)+116)
    12-11 00:10:38.126: INFO/DEBUG(166): #07  pc 00781d3c  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getRawToken(clang::SourceLocation, clang::Token&, clang::SourceManager const&, clang::LangOptions const&)+220)
    12-11 00:10:38.126: INFO/DEBUG(166): #08  pc 00781d9c  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::MeasureTokenLength(clang::SourceLocation, clang::SourceManager const&, clang::LangOptions const&)+36)
    12-11 00:10:38.126: INFO/DEBUG(166): #09  pc 001d1824  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::DiagnosticRenderer::emitMacroExpansions(clang::SourceLocation, clang::DiagnosticsEngine::Level, llvm::ArrayRef<clang::CharSourceRange>, llvm::ArrayRef<clang::FixItHint>, clang::SourceManager const&, unsigned int&, unsigned int)+840)
    12-11 00:10:38.126: INFO/DEBUG(166): #10  pc 001d13ec  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::DiagnosticRenderer::emitDiagnostic(clang::SourceLocation, clang::DiagnosticsEngine::Level, llvm::StringRef, llvm::ArrayRef<clang::CharSourceRange>, llvm::ArrayRef<clang::FixItHint>, clang::SourceManager const*, llvm::PointerUnion<clang::Diagnostic const*, clang::StoredDiagnostic const*>)+1224)
    12-11 00:10:38.126: INFO/DEBUG(166): #11  pc 001d1b20  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::DiagnosticRenderer::emitStoredDiagnostic(clang::StoredDiagnostic&)+304)
    12-11 00:10:38.126: INFO/DEBUG(166): #12  pc 0017b1c8  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::cxdiag::lazyCreateDiags(CXTranslationUnitImpl*, bool)+248)
    12-11 00:10:38.126: INFO/DEBUG(166): #13  pc 00009028  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so (Java_name_antonsmirnov_clang_clang_1wrapper_getDiagnostics+72)
    12-11 00:10:38.126: INFO/DEBUG(166): #14  pc 0001fb70  /system/lib/libdvm.so (dvmPlatformInvoke+112)
    12-11 00:10:38.126: INFO/DEBUG(166): #15  pc 0004e8b9  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+360)
    12-11 00:10:38.126: INFO/DEBUG(166): #16  pc 00029020  /system/lib/libdvm.so
    12-11 00:10:38.126: INFO/DEBUG(166): #17  pc 0002d7e8  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
    12-11 00:10:38.126: INFO/DEBUG(166): #18  pc 0005fed5  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
    12-11 00:10:38.126: INFO/DEBUG(166): #19  pc 0005feff  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
    12-11 00:10:38.126: INFO/DEBUG(166): #20  pc 00055327  /system/lib/libdvm.so
    12-11 00:10:38.126: INFO/DEBUG(166): #21  pc 00012e70  /system/lib/libc.so (__thread_entry+48)
    12-11 00:10:38.126: INFO/DEBUG(166): #22  pc 000125c8  /system/lib/libc.so (pthread_create+172)
    12-11 00:10:38.126: INFO/DEBUG(166): stack:
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8278  00000000
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a827c  c6c488f5
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8280  00001000
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8284  00000262
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8288  44188000  /dev/ashmem/dalvik-heap (deleted)
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a828c  43898000  /dev/ashmem/dalvik-heap (deleted)
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8290  40247774  /system/lib/libc.so
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8294  4024cd10
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8298  00000000
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a829c  4021ec89  /system/lib/libc.so (_fwalk+32)
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82a0  00000001
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82a4  7e7a82bc  [stack:5011]
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82a8  00000002
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82ac  00000002
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82b0  df0027ad
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82b4  00000000
    12-11 00:10:38.126: INFO/DEBUG(166): #00  7e7a82b8  75ff7ec2  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82bc  fffffbdf
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82c0  4023dbfc  /system/lib/libc.so
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82c4  00000002
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82c8  00000002
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82cc  4021e1f5  /system/lib/libc.so (fprintf+16)
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82d0  40247718  /system/lib/libc.so
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82d4  75ff7ec2  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82d8  4023dbfc  /system/lib/libc.so
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82dc  40210c08  /system/lib/libc.so (__pthread_clone)
    12-11 00:10:38.126: INFO/DEBUG(166): #01  7e7a82e0  7e7a82e0  [stack:5011]
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82e4  402220e3  /system/lib/libc.so (__assert2+34)
    12-11 00:10:38.126: INFO/DEBUG(166): #02  7e7a82e8  0000042d
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82ec  75feace7  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getSourceLocation(char const*, unsigned int) const::__PRETTY_FUNCTION__)
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82f0  75feace7  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getSourceLocation(char const*, unsigned int) const::__PRETTY_FUNCTION__)
    12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82f4  75a7c958  /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getSourceLocation(char const*, unsigned int) const+80)
    12-11 00:10:38.136: INFO/DEBUG(166): memory near r2:
    12-11 00:10:38.136: INFO/DEBUG(166): 4024caec 00000000 00000000 00000000 00000000  ................
    12-11 00:10:38.136: INFO/DEBUG(166): 4024cafc 00000000 00000000 00000000 00000000  ................
    12-11 00:10:38.136: INFO/DEBUG(166): 4024cb0c 00000001 00000000 00000000 00000000  ................
    12-11 00:10:38.136: INFO/DEBUG(166): 4024cb1c 00000000 00000000 00000000 00000000  ................
    12-11 00:10:38.136: INFO/DEBUG(166): 4024cb2c 00000000 00000000 00000000 00000000  ................
    12-11 00:10:38.136: INFO/DEBUG(166): memory near r5:
    12-11 00:10:38.136: INFO/DEBUG(166): 7e7a829c 4021ec89 00000001 7e7a82bc 00000002  ..!@......z~....
    12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82ac 00000002 df0027ad 00000000 75ff7ec2  .....'.......~.u
    12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82bc fffffbdf 4023dbfc 00000002 00000002  ......#@........
    12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82cc 4021e1f5 40247718 75ff7ec2 4023dbfc  ..!@.w$@.~.u..#@
    12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82dc 40210c08 7e7a82e0 402220e3 0000042d  ..!@..z~. "@-...
    12-11 00:10:38.146: INFO/DEBUG(166): memory near r9:
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3c0570 7d39c9fc 7e020006 0003be14 00000001  ..9}...~........
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3c0580 00000000 7e020015 0003be15 00000004  .......~........
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3c0590 7e313d3c 7e000069 0003be19 00000001  <=1~i..~........
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3c05a0 00000000 7e000016 0003be1e 0000000d  .......~........
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3c05b0 7e1cbd10 7e0200a6 00000000 00000002  ...~...~........
    12-11 00:10:38.146: INFO/DEBUG(166): memory near sl:
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae04 7d3aae24 7d3aaf15 706d6f63 6574656c  $.:}..:}complete
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae14 6d65645f 6e692e6f 70632e6f 67670070  _demo.ino.cpp.gg
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae24 636e6923 6564756c 72413c20 6e697564  #include <Arduin
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae34 3e682e6f 7274730a 20746375 0a7b2073  o.h>.struct s {.
    12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae44 6e692020 3b692074 746e690a 203b6620    int i;.int f;
    12-11 00:10:38.146: INFO/DEBUG(166): memory near fp:
    12-11 00:10:38.146: INFO/DEBUG(166): 40253a4c 00000000 00000000 00000000 00000000  ................
    12-11 00:10:38.146: INFO/DEBUG(166): 40253a5c 00000000 00000000 00000000 00000000  ................
    12-11 00:10:38.146: INFO/DEBUG(166): 40253a6c c6c488f5 00000000 00000000 00000000  ................
    12-11 00:10:38.146: INFO/DEBUG(166): 40253a7c 00000000 00000000 00000000 00000000  ................
    12-11 00:10:38.146: INFO/DEBUG(166): 40253a8c 00000000 00000000 00000000 00000000  ................
    12-11 00:10:38.146: INFO/DEBUG(166): memory near ip:
    12-11 00:10:38.146: INFO/DEBUG(166): 00003fe0 ffffffff ffffffff ffffffff ffffffff  ................
    12-11 00:10:38.146: INFO/DEBUG(166): 00003ff0 ffffffff ffffffff ffffffff ffffffff  ................
    12-11 00:10:38.146: INFO/DEBUG(166): 00004000 ffffffff ffffffff ffffffff ffffffff  ................
    12-11 00:10:38.146: INFO/DEBUG(166): 00004010 ffffffff ffffffff ffffffff ffffffff  ................
    12-11 00:10:38.146: INFO/DEBUG(166): 00004020 ffffffff ffffffff ffffffff ffffffff  ................
    12-11 00:10:38.146: INFO/DEBUG(166): memory near sp:
    12-11 00:10:38.146: INFO/DEBUG(166): 7e7a8298 00000000 4021ec89 00000001 7e7a82bc  ......!@......z~
    12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82a8 00000002 00000002 df0027ad 00000000  .........'......
    12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82b8 75ff7ec2 fffffbdf 4023dbfc 00000002  .~.u......#@....
    12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82c8 00000002 4021e1f5 40247718 75ff7ec2  ......!@.w$@.~.u
    12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82d8 4023dbfc 40210c08 7e7a82e0 402220e3  ..#@..!@..z~. "@
    12-11 00:10:38.146: INFO/DEBUG(166): code around pc:
    12-11 00:10:38.146: INFO/DEBUG(166): 4021b308 e000b164 6823461c d1fb2b00 68e3e026  d....F#h.+..&..h
    12-11 00:10:38.146: INFO/DEBUG(166): 4021b318 4a17b123 447a2401 47986014 20274911  #..J.$zD.`.G.I'
    12-11 00:10:38.146: INFO/DEBUG(166): 4021b328 70082400 eb9cf7f4 f7f52106 a902ecdc  .$.p.....!......
    12-11 00:10:38.146: INFO/DEBUG(166): 4021b338 f04f2006 460a5380 94029304 f7f59403  . O..S.F........
    12-11 00:10:38.146: INFO/DEBUG(166): 4021b348 4629e8ba 20024622 e8c2f7f5 eb88f7f4  ..)F"F. ........
    12-11 00:10:38.146: INFO/DEBUG(166): code around lr:
    12-11 00:10:38.146: INFO/DEBUG(166): 4021ec68 41f0e92d 4c0b2600 447c4680 68a56824  -..A.&.L.F|D$h.h
    12-11 00:10:38.146: INFO/DEBUG(166): 4021ec78 e0076867 300cf9b5 dd022b00 47c04628  gh.....0.+..(F.G
    12-11 00:10:38.146: INFO/DEBUG(166): 4021ec88 35544306 d5f53f01 2c006824 4630d1ef  .CT5.?..$h.,..0F
    12-11 00:10:38.146: INFO/DEBUG(166): 4021ec98 81f0e8bd 0002888e 43f0e92d fb01461f  ........-..C.F..
    12-11 00:10:38.146: INFO/DEBUG(166): 4021eca8 f8dff602 b0878058 44f8460c 8000f8d8  ....X....F.D....
    12-11 00:10:38.146: INFO/DEBUG(166): memory map around fault addr deadbaad:
    12-11 00:10:38.146: INFO/DEBUG(166): be8ef000-be910000 [stack]
    12-11 00:10:38.146: INFO/DEBUG(166): (no map for address)
    12-11 00:10:38.146: INFO/DEBUG(166): ffff0000-ffff1000 [vectors]
    12-11 00:10:38.536: INFO/BootReceiver
    

1 个答案:

答案 0 :(得分:0)

这是并发问题。 Clang方法/结构似乎不是线程安全的,因此必须同步访问。还有一个建议:不要在线程之间共享相同的JNIEnv*!在线程中使用vm>GetEnv()来获取JNIEnv指针。