杂乱的学习笔记

来自个人维基
2015年5月6日 (三) 20:22Hovercool讨论 | 贡献的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索
  • 字串资源文件:frameworks/base/core/res/res/values-zh-rCN/strings.xml

  • 在用户空间访问内核空间地址是不允许的,会抛出 "SIGSEGV" Exception:
如在 frameworks/base/services/surfaceflinger/DisplayHardware/HWComposer.cpp中加上以下代码:
status_t HWComposer::prepare() const {
    if (mList && mFlinger->isLayerScreenShotVisible()) {
        mList->flags |= HWC_LAYERSCREENSHOT_EXIST;
    }
    
    if (mList && (mList->flags & HWC_GEOMETRY_CHANGED)) {
        //hwc_layer_list_t* list = mList;
        LOGD("kaigo, HWComposer_prepare, list:%d, list->flags:%d, mList->numHwLayers:%d", (int)mList, mList->flags, mList->numHwLayers);
        for (size_t i=0 ; i<mList->numHwLayers ; i++) {
            //dump_layer(&list->hwLayers[i]);
            LOGD("kaigo, HWComposer_prepare, in for, i:%d", i);
            LOGD("kaigo, HWComposer_prepare, %d, i:%d, list->hwLayers[i]:%d", __LINE__, i, mList->hwLayers[i]); //这里会出错!
        }    
    }

    int err = mHwc->prepare(mHwc, mList);
...
...
07-02 10:11:30.054 D/SurfaceFlinger(  655): kaigo, HWComposer_prepare, list:25733432, list->flags:1, mList->numHwLayers:1
07-02 10:11:30.054 D/SurfaceFlinger(  655): kaigo, HWComposer_prepare, in for, i:0
07-02 10:11:30.054 F/libc    (  655): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
07-02 10:11:30.054 D/AEE/AED (  107): $===AEE===AEE===AEE===$
07-02 10:11:30.054 D/AEE/AED (  107): p 0 poll events 1 revents 0
...
07-02 10:11:31.270 I/AEE/AED (  667): $** *** *** *** *** *** *** *** Exception *** *** *** *** *** *** *** **$
07-02 10:11:31.270 I/AEE/AED (  667): Build Info: 'ALPS.ICS2.MP:ALPS.ICS2.MP.V1:MT6577:S01,vivo/bbk77_cu_ics2/bbk77_cu_ics2:4.0.4/IMM76D/1344848531:eng/test-keys'
07-02 10:11:31.271 I/AEE/AED (  667): Exception Log Time:[Mon Jul  2 10:11:31 CST 2012] [62.970000]
07-02 10:11:31.271 I/AEE/AED (  667): 
07-02 10:11:31.271 I/AEE/AED (  667): Exception Class: Native (NE)
07-02 10:11:31.271 I/AEE/AED (  667): Exception Type: SIGSEGV
07-02 10:11:31.271 I/AEE/AED (  667): 
07-02 10:11:31.271 I/AEE/AED (  667): Current Executing Process: 
07-02 10:11:31.271 I/AEE/AED (  667):   pid: 655, tid: 657
07-02 10:11:31.271 I/AEE/AED (  667):   /system/bin/surfaceflinger
07-02 10:11:31.271 I/AEE/AED (  667): 
07-02 10:11:31.271 I/AEE/AED (  667): Backtrace: 
07-02 10:11:31.271 I/AEE/AED (  667):          #00  pc 0001f830  /system/lib/libc.so
07-02 10:11:31.271 I/AEE/AED (  667):          #01  pc 0001acf4  /system/lib/libsurfaceflinger.so (_ZNK7android10HWComposer7prepareEv)
07-02 10:11:31.271 I/AEE/AED (  667):          #02  pc 0001ec92  /system/lib/libsurfaceflinger.so (_ZN7android14SurfaceFlinger21setupHardwareComposerERNS_6RegionE)
07-02 10:11:31.271 I/AEE/AED (  667):          #03  pc 0001f372  /system/lib/libsurfaceflinger.so (_ZN7android14SurfaceFlinger13handleRepaintEv)
07-02 10:11:31.271 I/AEE/AED (  667):          #04  pc 00020d86  /system/lib/libsurfaceflinger.so (_ZN7android14SurfaceFlinger10threadLoopEv)
07-02 10:11:31.271 I/AEE/AED (  667):          #05  pc 0002453e  /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv)
07-02 10:11:31.271 I/AEE/AED (  667):          #06  pc 00024b84  /system/lib/libutils.so
07-02 10:11:31.271 I/AEE/AED (  667):          #07  pc 000136cc  /system/lib/libc.so (__thread_entry)
...