一种kernel panic问题的解决方法

本文详细描述了Android相机模块在编译过程中遇到的kernel panic问题,包括问题现象、解决过程以及最终的解决方法。重点在于代码跟踪和分析,最终通过修改头文件路径解决了dest指针为NULL导致的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://blog.youkuaiyun.com/tankai19880619/article/details/9004619

项目问题,目前已解决;在此记录。

前些天在调试Camera模块;发现相同的代码在厂家提供的环境里边编译、就是ok的,在我们的源码树中编译,将HAL库推进去后、就会kernel panic。

一、现象

  1. F/libc    ( 4250): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 4358 (CameraPreviewTh)  
  2. I/DEBUG   ( 2366): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  
  3. I/DEBUG   ( 2366): Build fingerprint: 'TV/tclm6/tclm6:4.2.1/V8-AML7601-LF1R001/20130523:eng/test-keys'  
  4. I/DEBUG   ( 2366): Revision: '32'  
  5. I/DEBUG   ( 2366): pid: 4250, tid: 4358, name: CameraPreviewTh  >>> /system/bin/mediaserver <<<  
  6. I/DEBUG   ( 2366): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000  
  7. I/DEBUG   ( 2366):     r0 00000000  r1 00000500  r2 45498500  r3 0000001e  
  8. I/DEBUG   ( 2366):     r4 00000280  r5 00000000  r6 00000780  r7 00000000  
  9. I/DEBUG   ( 2366):     r8 00000500  r9 00000780  sl 00000f00  fp 45498f00  
  10. I/DEBUG   ( 2366):     ip 00000280  sp 46054d80  lr 4410816f  pc 44108214  cpsr 80030030  
  11. I/DEBUG   ( 2366):     d0  696765623e3e3e31  d1  3e3e3e2d2d2d2d2d  
  12. I/DEBUG   ( 2366):     d2  3234767975793e3e  d3  32766e5f6f745f32  
  13. I/DEBUG   ( 2366):     d4  54535f5745495645  d5  4552503e2d455441  
  14. I/DEBUG   ( 2366):     d6  4154535f57454956  d7  0000823549742400  
  15. I/DEBUG   ( 2366):     d8  0000000000000000  d9  0000000000000000  
  16. I/DEBUG   ( 2366):     d10 0000000000000000  d11 0000000000000000  
  17. I/DEBUG   ( 2366):     d12 0000000000000000  d13 0000000000000000  
  18. I/DEBUG   ( 2366):     d14 0000000000000000  d15 0000000000000000  
  19. I/DEBUG   ( 2366):     d16 0000000000000000  d17 0000000000000000  
  20. I/DEBUG   ( 2366):     d18 4000000000000000  d19 bf66c168e3a87def  
  21. I/DEBUG   ( 2366):     d20 3fc555533bceb625  d21 3e66376972bea4d0  
  22. I/DEBUG   ( 2366):     d22 3fb0271122ac41c2  d23 bf8388915620e116  
  23. I/DEBUG   ( 2366):     d24 3ff0271122ac41c2  d25 0000000000000000  
  24. I/DEBUG   ( 2366):     d26 0000000000000000  d27 0000000000000000  
  25. I/DEBUG   ( 2366):     d28 0000000000000000  d29 0000000000000000  
  26. I/DEBUG   ( 2366):     d30 0000000000000000  d31 0000000000000000  
  27. I/DEBUG   ( 2366):     scr 60000010  
  28. I/DEBUG   ( 2366):   
  29. I/DEBUG   ( 2366): backtrace:  
  30. I/DEBUG   ( 2366):     #00  pc 0002e214  /system/lib/hw/camera.meson6.so (yuyv422_to_nv21(unsigned char*, unsigned char*, int, int)+195)  
  31. I/DEBUG   ( 2366):     #01  pc 0002d05b  /system/lib/hw/camera.meson6.so (android::V4LCameraAdapter::previewThread()+490)  
  32. I/DEBUG   ( 2366):     #02  pc 0002d145  /system/lib/hw/camera.meson6.so  
  33. I/DEBUG   ( 2366):     #03  pc 00011253  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+94)  
  34. I/DEBUG   ( 2366):     #04  pc 00010dcd  /system/lib/libutils.so  
  35. I/DEBUG   ( 2366):     #05  pc 0000e478  /system/lib/libc.so (__thread_entry+72)  
  36. I/DEBUG   ( 2366):     #06  pc 0000db64  /system/lib/libc.so (pthread_create+160)  
  37. I/DEBUG   ( 2366):   
  38. I/DEBUG   ( 2366): stack:  
  39. I/DEBUG   ( 2366):          46054d40  401da160  /system/lib/libc.so  
  40. I/DEBUG   ( 2366):          46054d44  401b3a6d  /system/lib/libc.so (vfprintf+44)  
  41. I/DEBUG   ( 2366):          46054d48  000001e0    
  42. I/DEBUG   ( 2366):          46054d4c  00000280    
  43. I/DEBUG   ( 2366):          46054d50  4411bce1  /system/lib/hw/camera.meson6.so  
  44. I/DEBUG   ( 2366):          46054d54  45498500  /dev/video0  
  45. I/DEBUG   ( 2366):          46054d58  00000003    
  46. I/DEBUG   ( 2366):          46054d5c  401b167d  /system/lib/libc.so (printf+24)  
  47. I/DEBUG   ( 2366):          46054d60  4411d5fa  /system/lib/hw/camera.meson6.so  
  48. I/DEBUG   ( 2366):          46054d64  46054d74    
  49. I/DEBUG   ( 2366):          46054d68  00000280    
  50. I/DEBUG   ( 2366):          46054d6c  4410816f  /system/lib/hw/camera.meson6.so (yuyv422_to_nv21(unsigned char*, unsigned char*, int, int)+30)  
  51. I/DEBUG   ( 2366):          46054d70  4411d5fa  /system/lib/hw/camera.meson6.so  
  52. I/DEBUG   ( 2366):          46054d74  00000000    
  53. I/DEBUG   ( 2366):          46054d78  df0027ad    
  54. I/DEBUG   ( 2366):          46054d7c  00000000    
  55. I/DEBUG   ( 2366):     #00  46054d80  00000280    
  56. I/DEBUG   ( 2366):          46054d84  45498000  /dev/video0  
  57. I/DEBUG   ( 2366):          46054d88  45498500  /dev/video0  
  58. I/DEBUG   ( 2366):          46054d8c  45498a00  /dev/video0  
  59. I/DEBUG   ( 2366):          46054d90  00000780    
  60. I/DEBUG   ( 2366):          46054d94  0004b000    
  61. I/DEBUG   ( 2366):          46054d98  0004b280    
  62. I/DEBUG   ( 2366):          46054d9c  0004b001    
  63. I/DEBUG   ( 2366):          46054da0  0004b281    
  64. I/DEBUG   ( 2366):          46054da4  45498000  /dev/video0  
  65. I/DEBUG   ( 2366):          46054da8  45498500  /dev/video0  
  66. I/DEBUG   ( 2366):          46054dac  45498a00  /dev/video0  
  67. I/DEBUG   ( 2366):          46054db0  45498f00  /dev/video0  
  68. I/DEBUG   ( 2366):          46054db4  45498001  /dev/video0  
  69. I/DEBUG   ( 2366):          46054db8  45498a01  /dev/video0  
  70. I/DEBUG   ( 2366):          46054dbc  45498003  /dev/video0  
  71. I/DEBUG   ( 2366):          ........  ........  
  72. I/DEBUG   ( 2366):     #01  46054e08  00000000    
  73. I/DEBUG   ( 2366):          46054e0c  00000000    
  74. I/DEBUG   ( 2366):          46054e10  00000000    
  75. I/DEBUG   ( 2366):          46054e14  00000000    
  76. I/DEBUG   ( 2366):          46054e18  00000000    
  77. I/DEBUG   ( 2366):          46054e1c  00000000    
  78. I/DEBUG   ( 2366):          46054e20  00000000    
  79. I/DEBUG   ( 2366):          46054e24  00000000    
  80. I/DEBUG   ( 2366):          46054e28  00000280    
  81. I/DEBUG   ( 2366):          46054e2c  000001e0    
  82. I/DEBUG   ( 2366):          46054e30  00000000    
  83. I/DEBUG   ( 2366):          46054e34  00000000    
  84. I/DEBUG   ( 2366):          46054e38  00000000    
  85. I/DEBUG   ( 2366):          46054e3c  00000000    
  86. I/DEBUG   ( 2366):          46054e40  00000000    
  87. I/DEBUG   ( 2366):          46054e44  00000000    
  88. I/DEBUG   ( 2366):          ........  ........  
  89. I/DEBUG   ( 2366):     #02  46054e98  44001498    
  90. I/DEBUG   ( 2366):          46054e9c  40226255  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+96)  
  91. I/DEBUG   ( 2366):   
  92. I/DEBUG   ( 2366): memory near r2:  
  93. I/DEBUG   ( 2366):     454984e0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454984f0 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498500 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498510 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498520 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498530 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498540 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498550 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498560 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498570 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498580 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498590 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454985a0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454985b0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454985c0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454985d0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):   
  94. I/DEBUG   ( 2366): memory near fp:  
  95. I/DEBUG   ( 2366):     45498ee0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498ef0 ffffffff ffffffff ffffffff ffffffff  
  96. I/DEBUG   ( 2366):     45498f00 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f10 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f20 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f30 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f40 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f50 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f60 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f70 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f80 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f90 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498fa0 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498fb0 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498fc0 ffffffff ffffffff ffffffff..  
F/libc    ( 4250): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 4358 (CameraPreviewTh)
I/DEBUG   ( 2366): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 2366): Build fingerprint: 'TV/tclm6/tclm6:4.2.1/V8-AML7601-LF1R001/20130523:eng/test-keys'
I/DEBUG   ( 2366): Revision: '32'
I/DEBUG   ( 2366): pid: 4250, tid: 4358, name: CameraPreviewTh  >>> /system/bin/mediaserver <<<
I/DEBUG   ( 2366): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG   ( 2366):     r0 00000000  r1 00000500  r2 45498500  r3 0000001e
I/DEBUG   ( 2366):     r4 00000280  r5 00000000  r6 00000780  r7 00000000
I/DEBUG   ( 2366):     r8 00000500  r9 00000780  sl 00000f00  fp 45498f00
I/DEBUG   ( 2366):     ip 00000280  sp 46054d80  lr 4410816f  pc 44108214  cpsr 80030030
I/DEBUG   ( 2366):     d0  696765623e3e3e31  d1  3e3e3e2d2d2d2d2d
I/DEBUG   ( 2366):     d2  3234767975793e3e  d3  32766e5f6f745f32
I/DEBUG   ( 2366):     d4  54535f5745495645  d5  4552503e2d455441
I/DEBUG   ( 2366):     d6  4154535f57454956  d7  0000823549742400
I/DEBUG   ( 2366):     d8  0000000000000000  d9  0000000000000000
I/DEBUG   ( 2366):     d10 0000000000000000  d11 0000000000000000
I/DEBUG   ( 2366):     d12 0000000000000000  d13 0000000000000000
I/DEBUG   ( 2366):     d14 0000000000000000  d15 0000000000000000
I/DEBUG   ( 2366):     d16 0000000000000000  d17 0000000000000000
I/DEBUG   ( 2366):     d18 4000000000000000  d19 bf66c168e3a87def
I/DEBUG   ( 2366):     d20 3fc555533bceb625  d21 3e66376972bea4d0
I/DEBUG   ( 2366):     d22 3fb0271122ac41c2  d23 bf8388915620e116
I/DEBUG   ( 2366):     d24 3ff0271122ac41c2  d25 0000000000000000
I/DEBUG   ( 2366):     d26 0000000000000000  d27 0000000000000000
I/DEBUG   ( 2366):     d28 0000000000000000  d29 0000000000000000
I/DEBUG   ( 2366):     d30 0000000000000000  d31 0000000000000000
I/DEBUG   ( 2366):     scr 60000010
I/DEBUG   ( 2366): 
I/DEBUG   ( 2366): backtrace:
I/DEBUG   ( 2366):     #00  pc 0002e214  /system/lib/hw/camera.meson6.so (yuyv422_to_nv21(unsigned char*, unsigned char*, int, int)+195)
I/DEBUG   ( 2366):     #01  pc 0002d05b  /system/lib/hw/camera.meson6.so (android::V4LCameraAdapter::previewThread()+490)
I/DEBUG   ( 2366):     #02  pc 0002d145  /system/lib/hw/camera.meson6.so
I/DEBUG   ( 2366):     #03  pc 00011253  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+94)
I/DEBUG   ( 2366):     #04  pc 00010dcd  /system/lib/libutils.so
I/DEBUG   ( 2366):     #05  pc 0000e478  /system/lib/libc.so (__thread_entry+72)
I/DEBUG   ( 2366):     #06  pc 0000db64  /system/lib/libc.so (pthread_create+160)
I/DEBUG   ( 2366): 
I/DEBUG   ( 2366): stack:
I/DEBUG   ( 2366):          46054d40  401da160  /system/lib/libc.so
I/DEBUG   ( 2366):          46054d44  401b3a6d  /system/lib/libc.so (vfprintf+44)
I/DEBUG   ( 2366):          46054d48  000001e0  
I/DEBUG   ( 2366):          46054d4c  00000280  
I/DEBUG   ( 2366):          46054d50  4411bce1  /system/lib/hw/camera.meson6.so
I/DEBUG   ( 2366):          46054d54  45498500  /dev/video0
I/DEBUG   ( 2366):          46054d58  00000003  
I/DEBUG   ( 2366):          46054d5c  401b167d  /system/lib/libc.so (printf+24)
I/DEBUG   ( 2366):          46054d60  4411d5fa  /system/lib/hw/camera.meson6.so
I/DEBUG   ( 2366):          46054d64  46054d74  
I/DEBUG   ( 2366):          46054d68  00000280  
I/DEBUG   ( 2366):          46054d6c  4410816f  /system/lib/hw/camera.meson6.so (yuyv422_to_nv21(unsigned char*, unsigned char*, int, int)+30)
I/DEBUG   ( 2366):          46054d70  4411d5fa  /system/lib/hw/camera.meson6.so
I/DEBUG   ( 2366):          46054d74  00000000  
I/DEBUG   ( 2366):          46054d78  df0027ad  
I/DEBUG   ( 2366):          46054d7c  00000000  
I/DEBUG   ( 2366):     #00  46054d80  00000280  
I/DEBUG   ( 2366):          46054d84  45498000  /dev/video0
I/DEBUG   ( 2366):          46054d88  45498500  /dev/video0
I/DEBUG   ( 2366):          46054d8c  45498a00  /dev/video0
I/DEBUG   ( 2366):          46054d90  00000780  
I/DEBUG   ( 2366):          46054d94  0004b000  
I/DEBUG   ( 2366):          46054d98  0004b280  
I/DEBUG   ( 2366):          46054d9c  0004b001  
I/DEBUG   ( 2366):          46054da0  0004b281  
I/DEBUG   ( 2366):          46054da4  45498000  /dev/video0
I/DEBUG   ( 2366):          46054da8  45498500  /dev/video0
I/DEBUG   ( 2366):          46054dac  45498a00  /dev/video0
I/DEBUG   ( 2366):          46054db0  45498f00  /dev/video0
I/DEBUG   ( 2366):          46054db4  45498001  /dev/video0
I/DEBUG   ( 2366):          46054db8  45498a01  /dev/video0
I/DEBUG   ( 2366):          46054dbc  45498003  /dev/video0
I/DEBUG   ( 2366):          ........  ........
I/DEBUG   ( 2366):     #01  46054e08  00000000  
I/DEBUG   ( 2366):          46054e0c  00000000  
I/DEBUG   ( 2366):          46054e10  00000000  
I/DEBUG   ( 2366):          46054e14  00000000  
I/DEBUG   ( 2366):          46054e18  00000000  
I/DEBUG   ( 2366):          46054e1c  00000000  
I/DEBUG   ( 2366):          46054e20  00000000  
I/DEBUG   ( 2366):          46054e24  00000000  
I/DEBUG   ( 2366):          46054e28  00000280  
I/DEBUG   ( 2366):          46054e2c  000001e0  
I/DEBUG   ( 2366):          46054e30  00000000  
I/DEBUG   ( 2366):          46054e34  00000000  
I/DEBUG   ( 2366):          46054e38  00000000  
I/DEBUG   ( 2366):          46054e3c  00000000  
I/DEBUG   ( 2366):          46054e40  00000000  
I/DEBUG   ( 2366):          46054e44  00000000  
I/DEBUG   ( 2366):          ........  ........
I/DEBUG   ( 2366):     #02  46054e98  44001498  
I/DEBUG   ( 2366):          46054e9c  40226255  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+96)
I/DEBUG   ( 2366): 
I/DEBUG   ( 2366): memory near r2:
I/DEBUG   ( 2366):     454984e0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454984f0 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498500 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498510 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498520 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498530 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498540 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498550 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498560 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498570 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498580 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498590 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454985a0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454985b0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454985c0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     454985d0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366): 
I/DEBUG   ( 2366): memory near fp:
I/DEBUG   ( 2366):     45498ee0 ffffffff ffffffff ffffffff ffffffffI/DEBUG   ( 2366):     45498ef0 ffffffff ffffffff ffffffff ffffffff
I/DEBUG   ( 2366):     45498f00 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f10 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f20 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f30 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f40 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f50 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f60 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f70 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f80 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498f90 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498fa0 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498fb0 ffffffff ffffffff ffffffff ffffffff I/DEBUG   ( 2366):     45498fc0 ffffffff ffffffff ffffffff..

二、解决

1.分析其中的重要信息

  1. I/DEBUG   ( 2366):     #00  pc 0002e180  /system/lib/hw/camera.meson6.so (yuyv422_to_nv21(unsigned char*, unsigned char*, int, int)+157)  
  2. I/DEBUG   ( 2366):     #01  pc 0002d00b  /system/lib/hw/camera.meson6.so (android::V4LCameraAdapter::previewThread()+458)  
  3. I/DEBUG   ( 2366):     #02  pc 0002d0dd  /system/lib/hw/camera.meson6.so  
  4. I/DEBUG   ( 2366):     #03  pc 00011253  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+94)  
  5. I/DEBUG   ( 2366):     #04  pc 00010dcd  /system/lib/libutils.so  
  6. I/DEBUG   ( 2366):     #05  pc 0000e478  /system/lib/libc.so (__thread_entry+72)  
  7. I/DEBUG   ( 2366):     #06  pc 0000db64  /system/lib/libc.so (pthread_create+160)  
I/DEBUG   ( 2366):     #00  pc 0002e180  /system/lib/hw/camera.meson6.so (yuyv422_to_nv21(unsigned char*, unsigned char*, int, int)+157)
I/DEBUG   ( 2366):     #01  pc 0002d00b  /system/lib/hw/camera.meson6.so (android::V4LCameraAdapter::previewThread()+458)
I/DEBUG   ( 2366):     #02  pc 0002d0dd  /system/lib/hw/camera.meson6.so
I/DEBUG   ( 2366):     #03  pc 00011253  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+94)
I/DEBUG   ( 2366):     #04  pc 00010dcd  /system/lib/libutils.so
I/DEBUG   ( 2366):     #05  pc 0000e478  /system/lib/libc.so (__thread_entry+72)
I/DEBUG   ( 2366):     #06  pc 0000db64  /system/lib/libc.so (pthread_create+160)

2.代码跟踪

操作:
out/target/product/tclm6/obj/SHARED_LIBRARIES/camera.meson6_intermediates/LINKED
arm-none-linux-gnueabi-addr2line 0002e180 -e camera.meson6.so
结果:
hardware/amlogic/camera/utils/util.cpp:157      
////(*ptrdesty1++) = (*ptrsrcy1);在yuyv422_to_nv21(unsigned char*, unsigned char*, int, int)函数中

操作:
arm-none-linux-gnueabi-addr2line 0002d00b -e camera.meson6.so
结果:
hardware/amlogic/camera/V4LCameraAdapter/V4LCameraAdapter.cpp:1571   
//// yuyv422_to_nv21(src,dest,width,height); 

操作:
arm-none-linux-gnueabi-addr2line 0002d0dd -e camera.meson6.so
结果:
hardware/amlogic/camera/V4LCameraAdapter/V4LCameraAdapter.cpp:303    
////writefile((char*)SYSFILE_CAMERA_SET_PARA, (char*)"1");

3.分析

    从上边结果来看,在hardware/amlogic/camera/V4LCameraAdapter/V4LCameraAdapter.cpp:1571处调用yuyv422_to_nv21(src,dest,width,height)挂掉的可能性比较打;于是加如下log:

  1. D/V4LCameraAdapter( 2371): TK----------->>>>>src is 0x45d0f000  
  2. D/V4LCameraAdapter( 2371): TK---------->>>>>>dest is 0x0  
  3. D/V4LCameraAdapter( 2371): TK------------>>>>>width is 640  
  4. D/V4LCameraAdapter( 2371): TK--------->>>>>height is 480  
D/V4LCameraAdapter( 2371): TK----------->>>>>src is 0x45d0f000
D/V4LCameraAdapter( 2371): TK---------->>>>>>dest is 0x0
D/V4LCameraAdapter( 2371): TK------------>>>>>width is 640
D/V4LCameraAdapter( 2371): TK--------->>>>>height is 480

    不难发现,上边dest指针为NULL、导致的kernel panic。

4.解决

  通过对比编译环境发现,在dest赋值处;用到的头文件位置不同,导致结果差异。通过重新设置头文件路径,问题解决。

三、思考

  目前掌握的结局kernel panic故障的方法是使用交叉编译工具链给我们提供的arm-none-linux-gnueabi-addr2line工具,通过地址定位源文件中出错的函数或具体行数。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值