[초보] android 개발 중 로그상에서 SIGBUS 원인을 찾고 있습니다.
01-31 08:19:46.492 I 254 DEBUG *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-31 08:19:46.492 I 254 DEBUG Build fingerprint: 'LGE/batman_skt_kr/batman:4.1.2/JZO54K/LG-F100S-V.1e4c5dc913:user/release-keys'
01-31 08:19:46.492 I 254 DEBUG pid: 6724, tid: 6735, name: Binder_2 >>> com.lge.camera <<<
01-31 08:19:46.492 I 254 DEBUG signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 5f3a9000
01-31 08:19:47.162 I 254 DEBUG r0 4354e658 r1 5f3a9000 r2 00120000 r3 00120000
01-31 08:19:47.162 I 254 DEBUG r4 c3d00001 r5 00000000 r6 5a534fd0 r7 00120000
01-31 08:19:47.162 I 254 DEBUG r8 00000010 r9 00000000 sl 40102a8c fp 00000001
01-31 08:19:47.162 I 254 DEBUG ip 000003fa sp 5de34c7c lr 408ee8bb pc 400c01fc cpsr 20000010
01-31 08:19:47.162 I 254 DEBUG d0 0000000000000000 d1 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d2 0000000000000000 d3 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d4 0000000000000000 d5 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d6 0000000000000000 d7 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d8 0000000000000000 d9 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d10 0000000000000000 d11 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d12 0000000000000000 d13 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d14 0000000000000000 d15 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d16 0000000000000000 d17 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d18 0000000000000000 d19 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d20 0000000000000000 d21 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d22 0000000000000000 d23 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d24 0000000000000000 d25 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d26 0000000000000000 d27 0000000000000000
01-31 08:19:47.162 I 254 DEBUG d28 0100010001000100 d29 0100010001000100
01-31 08:19:47.162 I 254 DEBUG d30 0000000000000000 d31 0000000000000000
01-31 08:19:47.162 I 254 DEBUG scr 80000010
01-31 08:19:47.162 I 254 DEBUG
01-31 08:19:47.162 I 254 DEBUG backtrace:
01-31 08:19:47.162 I 254 DEBUG #00 pc 0000e1fc /system/lib/libc.so
01-31 08:19:47.162 I 254 DEBUG #01 pc 00004fcc
01-31 08:19:47.162 I 254 DEBUG
01-31 08:19:47.162 I 254 DEBUG stack:
01-31 08:19:47.182 I 254 DEBUG 5de34c3c 00000000
01-31 08:19:47.182 I 254 DEBUG 5de34c40 40102a8c
01-31 08:19:47.182 I 254 DEBUG 5de34c44 4090a029 /system/lib/libdvm.so
01-31 08:19:47.182 I 254 DEBUG 5de34c48 00000001
01-31 08:19:47.182 I 254 DEBUG 5de34c4c 5d010101 /system/fonts/LG_Sinhalese.ttf
01-31 08:19:47.182 I 254 DEBUG 5de34c50 40294a21 /system/lib/libbinder.so (android::IPCThreadState::freeBuffer(android::Parcel*, unsigned char const*, unsigned int, unsigned int const*, unsigned int, void*))
01-31 08:19:47.182 I 254 DEBUG 5de34c54 5a783008
01-31 08:19:47.182 I 254 DEBUG 5de34c58 5de34c84 [stack:6735]
01-31 08:19:47.182 I 254 DEBUG 5de34c5c 00000000
01-31 08:19:47.182 I 254 DEBUG 5de34c60 5a534fd0
01-31 08:19:47.182 I 254 DEBUG 5de34c64 c3d00001
01-31 08:19:47.182 I 254 DEBUG 5de34c68 00000000
01-31 08:19:47.182 I 254 DEBUG 5de34c6c 408ee0cf /system/lib/libdvm.so (dvmDecodeIndirectRef(Thread*, _jobject*)+34)
01-31 08:19:47.182 I 254 DEBUG 5de34c70 df0027ad
01-31 08:19:47.182 I 254 DEBUG 5de34c74 00000000
01-31 08:19:47.182 I 254 DEBUG 5de34c78 5a534fd0
01-31 08:19:47.182 I 254 DEBUG #00 5de34c7c 4344e658 /dev/ashmem/dalvik-heap (deleted)
01-31 08:19:47.182 I 254 DEBUG 5de34c80 5a534fd0
01-31 08:19:47.182 I 254 DEBUG #01 5de34c84 5a3290c8
01-31 08:19:47.182 I 254 DEBUG 5de34c88 00000000
01-31 08:19:47.182 I 254 DEBUG 5de34c8c 5a534fd0
01-31 08:19:47.182 I 254 DEBUG 5de34c90 c3d00001
01-31 08:19:47.182 I 254 DEBUG 5de34c94 5d24d8d8
01-31 08:19:47.182 I 254 DEBUG 5de34c98 408ee879 /system/lib/libdvm.so
01-31 08:19:47.182 I 254 DEBUG 5de34c9c 4035b83d /system/lib/libandroid_runtime.so (JNICameraContext::copyAndPost(_JNIEnv*, android::sp const&, int)+184)
01-31 08:19:47.182 I 254 DEBUG 5de34ca0 5f2a9000 /dev/ashmem/AudioFlinger::Client (deleted)
01-31 08:19:47.182 I 254 DEBUG 5de34ca4 5c748fac
01-31 08:19:47.182 I 254 DEBUG 5de34ca8 00000001
01-31 08:19:47.182 I 254 DEBUG 5de34cac 5d31e154
01-31 08:19:47.182 I 254 DEBUG 5de34cb0 5de34cd4 [stack:6735]
01-31 08:19:47.182 I 254 DEBUG 5de34cb4 00000000
01-31 08:19:47.182 I 254 DEBUG 5de34cb8 00120000
01-31 08:19:47.182 I 254 DEBUG 5de34cbc 4160d0b0
01-31 08:19:47.182 I 254 DEBUG 5de34cc0 5d24d8d8
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG memory near r0:
01-31 08:19:47.182 I 254 DEBUG 4354e638 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG 4354e648 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG 4354e658 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG 4354e668 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG 4354e678 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG memory near r1:
01-31 08:19:47.182 I 254 DEBUG 5f3a8fe0 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG 5f3a8ff0 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG 5f3a9000 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 5f3a9010 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 5f3a9020 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG memory near r2:
01-31 08:19:47.182 I 254 DEBUG 0011ffe0 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 0011fff0 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 00120000 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 00120010 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 00120020 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG memory near r3:
01-31 08:19:47.182 I 254 DEBUG 0011ffe0 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 0011fff0 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 00120000 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 00120010 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 00120020 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG memory near r6:
01-31 08:19:47.182 I 254 DEBUG 5a534fb0 d1d1d1d1 d1d1d1d1 d1d1d1d1 d1d1d1d1 ................
01-31 08:19:47.182 I 254 DEBUG 5a534fc0 d1d1d1d1 d1d1d1d1 5d5f2630 00000023 ........0&_]#...
01-31 08:19:47.182 I 254 DEBUG 5a534fd0 40947d0c 00000000 00000009 5a3290c8 .}.@..........2Z
01-31 08:19:47.182 I 254 DEBUG 5a534fe0 00000000 5d49a570 5ce595a8 00000013 ....p.I]...\....
01-31 08:19:47.182 I 254 DEBUG 5a534ff0 408a1368 5a37c488 00000000 0000002b h..@..7Z....+...
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG memory near r7:
01-31 08:19:47.182 I 254 DEBUG 0011ffe0 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 0011fff0 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 00120000 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 00120010 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG 00120020 ffffffff ffffffff ffffffff ffffffff ................
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG memory near sl:
01-31 08:19:47.182 I 254 DEBUG 40102a6c 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG 40102a7c 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG 40102a8c 7663bd72 00000000 00000000 00000000 r.cv............
01-31 08:19:47.182 I 254 DEBUG 40102a9c 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG 40102aac 00000000 00000000 00000000 00000000 ................
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG memory near sp:
01-31 08:19:47.182 I 254 DEBUG 5de34c5c 00000000 5a534fd0 c3d00001 00000000 .....OSZ........
01-31 08:19:47.182 I 254 DEBUG 5de34c6c 408ee0cf df0027ad 00000000 5a534fd0 ...@.'.......OSZ
01-31 08:19:47.182 I 254 DEBUG 5de34c7c 4344e658 5a534fd0 5a3290c8 00000000 X.DC.OSZ..2Z....
01-31 08:19:47.182 I 254 DEBUG 5de34c8c 5a534fd0 c3d00001 5d24d8d8 408ee879 .OSZ......$]y..@
01-31 08:19:47.182 I 254 DEBUG 5de34c9c 4035b83d 5f2a9000 5c748fac 00000001 =.5@..*_..t\....
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG code around pc:
01-31 08:19:47.182 I 254 DEBUG 400c01dc e3520080 ba00001f e1a0c3a2 e35c0006 ..R...........\.
01-31 08:19:47.182 I 254 DEBUG 400c01ec da00000d e24cc006 f5d1f280 f5d1f300 ......L.........
01-31 08:19:47.182 I 254 DEBUG 400c01fc f421028d f421428d f461028d f461428d ..!..B!...a..Ba.
01-31 08:19:47.182 I 254 DEBUG 400c020c e25cc001 f400028d f400428d f440028d ..\......B....@.
01-31 08:19:47.182 I 254 DEBUG 400c021c f440428d 1afffff4 e3a0c006 f421028d .B@...........!.
01-31 08:19:47.182 I 254 DEBUG
01-31 08:19:47.182 I 254 DEBUG code around lr:
01-31 08:19:47.182 I 254 DEBUG 408ee898 19ea6883 dd06429a 46294b08 447b463a .h...B...K)F:F{D
01-31 08:19:47.182 I 254 DEBUG 408ee8a8 fc06f7fe 3010e005 19409908 f7d3463a .......0..@.:F..
01-31 08:19:47.182 I 254 DEBUG 408ee8b8 a801e8e6 fc38f7fe bf00bdfe 000472e5 ......8......r..
01-31 08:19:47.192 I 254 DEBUG 408ee8c8 4606b5f7 a801460c 46154631 f7fe461f ...F.F..1F.F.F..
01-31 08:19:47.192 I 254 DEBUG 408ee8d8 9801fc07 f7ff4621 ea57fbe5 d4030305 ....!F....W.....
01-31 08:19:47.192 I 254 DEBUG
01-31 08:19:47.192 I 254 DEBUG memory map around fault addr 5f3a9000:
01-31 08:19:47.192 I 254 DEBUG 5efa9000-5f2a9000 anon_inode:dmabuf
01-31 08:19:47.192 I 254 DEBUG 5f2a9000-5f3c9000 /dev/ashmem/AudioFlinger::Client (deleted)
01-31 08:19:47.192 I 254 DEBUG 5f7a9000-5f8db000 /system/fonts/LG_HKSC.ttf
SIGBUS가 잘못된 메모리 참조라던데...
AudioFlinger에서 free 할때 잘못된 영역을 참조 하여 발생했는지
문의 드립니다.
로그 보니 핸드폰 개발하시는거 같은데. 주로 ARM
로그 보니 핸드폰 개발하시는거 같은데. 주로 ARM 계열 쓰시겠죠.
SIGBUS는 Memory Alignment와 많이 연관되어 있습니다.
메모리를 4바이트 단위로 접근한다면 메모리주소가 4의 배수, 8바이트 단위면 8의 배수 주소로만 접근해야 되는건데 이걸 무시해서 발생하는 것입니다.
x86은 Memory Alignment가 안맞아도 프로세서 내부에 보정장치가 있어서 속도 좀 떨어지는 걸로 끝나는데 ARM 같은 RISC 계열은 그런거 전혀 없습니다. Exception 떨어지고 뻗어버립니다.
RISC의 모토가 하드웨어를 최대한 단순화해서 처리속도 올리자는 개념으로 나온거니 RISC 프로세서들은 프로그래머 입장에서도 걸리적거리는 사소한 제한이 많죠.
Written By the Black Knight of Destruction
addr2line이나 ndk-stack을 써보세요
addr2line이나 ndk-stack을 써보세요
어디를 찍어 봐야 할까요?
addr2line이나 ndk-stack을 사용한다면 어떤 주소값을 어떻게 찍어 봐야 할까요?
/proc/cpu/alignment 를
/proc/cpu/alignment 를 확인하세요.
alignment exception 이 발생했을 때 커널의 대응 방법을 설정합니다.
지나가다가...
우리 회사의 우월성과 뛰어난 엔지니어들에게 감사를 하며...ㅋㅋㅋ
제가 봤을 때는 안드로이드의 Camera application에서 crash가 발생한 것 같네요..
LG Electronics에서 만드는 BATMAN 프로젝트의 Camera Application이라...
눈을 추적해주는 어플 정도 될 것 같습니다만....
어째든 어플에서 Preloading으로 올라가 있는 Memory 영역을 침범하면서 발생하는 Crash네요...
5f3a9000 여기 Address라고 적혀있기는 하지만, App의 경우에 relocation이라서, 0xa9000으로 relocatio되는 부분은 직접 찾으셔야할거세요~~
예전에는 이런 식으로 찾으면 됐는데, 요즘은 어떻게 변했는지 모르겠네요~ ^^
-_- _-_ -_-