//
在我们终端 lunch 过的目录 执行 stack 加上带有报错日志的文件路径, 他会帮我们过滤trace 信息如下操作
我的报错文件存放在: ~/log/build.log
则执行命令如下:
stack ~/log/build.log
得到结果如下:
ts@ts-HP-EliteDesk-800-G5-TWR:~/BM_NEW/LINUX/android/vendor/qcom/proprietary/chi-cdk$ stack ~/log/build.log
device/qcom/sm6150/sm6150.mk:115: warning: "Compiling with full value-added framework"
hardware/qcom/media/conf_files/sm6150/sm6150.mk:28: warning: "Compiling with full value-added framework or for AUTO Platform"
hardware/qcom/media/conf_files/sm6150/sm6150.mk:42: warning: "Enabling codec2.0 SW only for non-generic odm build variant"
mkdir: 无法创建目录"/firmware": 权限不够
Searching for native crashes in /home/ts/log/build.log
Reading symbols from /home/ts/BM_NEW/LINUX/android/out/target/product/sm6150/symbols
signal 9 (Killed)
signal 9 (Killed)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 5145 (provider@2.4-se), pid 5062 (provider@2.4-se)
Revision: '0'
pid: 5062, tid: 5145, name: provider@2.4-se >>> /vendor/bin/hw/android.hardware.camera.provider@2.4-service_64 <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
x0 0000000000000000 x1 0000000000000000 x2 0000000000000000 x3 0000000000000f00
x4 0000000000000870 x5 0000000080800000 x6 5f5b490425000000 x7 000080a504495b5f
x8 20f53b4b3362b0da x9 20f53b4b3362b0da x10 0000007b52501d60 x11 0000000000000039
x12 0000000000000010 x13 0000000000000005 x14 0000000000000008 x15 00002fc1bfaa5c6c
x16 0000007b55cc9358 x17 0000007b55d322a4 x18 0000007b50344000 x19 0000007b52502650
x20 0000007b38694000 x21 0000000000000000 x22 0000007b4aa61300 x23 00000000000000ab
x24 0000007b5250d020 x25 0000000000000000 x26 0000007b55cc3c16 x27 0000000000000000
x28 0000000000000004 x29 0000007b525022c0
Using arm64 toolchain from: /home/ts/BM_NEW/LINUX/android/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/
Stack Trace:
RELADDR FUNCTION FILE:LINE
00000000000042cc Tsldc::SetWindows(unsigned int, unsigned int, unsigned int, unsigned int)@@Base+40 /vendor/lib64/libtsldc.so
v--------------> ChiMemCpyNode::LDCProcess(ChiImageList*, ChiImageList*, unsigned long) vendor/qcom/proprietary/chi-cdk/vendor/node/eptz/camxchinodeeptz.cpp:1501
v--------------> ChiMemCpyNode::ProcessRequest(ChiNodeProcessRequestInfo*) vendor/qcom/proprietary/chi-cdk/vendor/node/eptz/camxchinodeeptz.cpp:1213
00000000000046a4 MemCpyNodeProcRequest(ChiNodeProcessRequestInfo*)+1828 vendor/qcom/proprietary/chi-cdk/vendor/node/eptz/camxchinodeeptz.cpp:491
00000000004e4270 CamX::ChiNodeWrapper::ExecuteProcessRequest(CamX::ExecuteProcessRequestData*)+2352 vendor/qcom/proprietary/camx/src/core/chi/camxchinodewrapper.cpp:2187
v--------------> CamX::DeferredRequestQueue::DeferredWorkerWrapper(void*) vendor/qcom/proprietary/camx/src/core/camxnode.cpp:1648
v--------------> CamX::DeferredRequestQueue::DeferredWorkerCore(CamX::Dependency*) vendor/qcom/proprietary/camx/src/core/camxdeferredrequestqueue.cpp:287
00000000004f4f34 CamX::DeferredRequestQueue::DeferredWorkerWrapper(void*)+10948 vendor/qcom/proprietary/camx/src/core/camxdeferredrequestqueue.cpp:360
v--------------> CamX::ThreadCore::DispatchJob(CamX::RuntimeJob*) vendor/qcom/proprietary/camx/src/utils/camxthreadcore.cpp:302
v--------------> CamX::ThreadCore::ProcessJobQueue() vendor/qcom/proprietary/camx/src/utils/camxthreadcore.cpp:462
v--------------> CamX::ThreadCore::DoWork() vendor/qcom/proprietary/camx/src/utils/camxthreadcore.cpp:370
000000000047e330 CamX::ThreadCore::WorkerThreadBody(void*)+1192 vendor/qcom/proprietary/camx/src/utils/camxthreadcore.cpp:337
00000000000e68a0 __pthread_start(void*)+36) (BuildId: f8da9ef138257423256285049dff190a /apex/com.android.runtime/lib64/bionic/libc.so
0000000000084b6c __start_thread+64) (BuildId: f8da9ef138257423256285049dff190a
可以看到调用栈中最上面是报错的函数SetWindows();
然后我们返回到文件中,查找这个函数上面的一些信息, 可以看到其报空指针异常 casue : null pointer dereference;
然后我们就可以按照这个方法的位置空指针异常去查看代码进行分析了, 一般这种概率性出现的空指针, 基本跟调用时序有关系;