• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 34,  comments - 5,  trackbacks - 0

            I hate crashes that disappear when run under the debugger and I had one when
            porting mupdf to Windows.

            It helps to know that there’s at least one reason for a changed behavior under
            the debugger: it automatically triggers using debugging heap. While debugging
            heap usually helps find problems, sometimes it does the opposite by changing
            the details of memory allocation.

            One helpful tool when debugging memory problems on Windows is gflags which can
            enable page heap instrumentation for a given program. It works by putting each
            allocation into a separate region of memory and putting a non-readable page
            right after that. Also, upon freeing it makes the memory unreadable. That way
            an overwrite of memory block while it’s still being used or accessing the
            memory after it was freed will cause immediate crash.

            The downside is that using gflags uses much more memory. But in those days of
            cheap gigabytes it’s not a problem that can’t be solved with a couple hundred
            bucks.

            Basic usage of gflags.exe is simple:
            gflags /p /full /enable foo.exe

            From now on foo.exe will always be run with this instrumentation turned on. To
            disable, do
            gflags /p /disable foo.exe

            To see which programs have page heap enabled, do gflags /p. gflags offers many
            other option and you can learn about them via gflags /?. If you run gflags
            without any options, you’ll get a (very confusing) GUI.

            It worked like a charm. I got a crash on accessing freed memory and all I had
            to do was to backtrack to where this memory was allocated to figure out the
            problem.

            reference: http://blog.kowalczyk.info/article/gflags-a-debugging-story.html

            posted on 2009-07-14 12:47 披星戴月 閱讀(567) 評論(0)  編輯 收藏 引用 所屬分類: c/c++
            <2009年7月>
            2829301234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            常用鏈接

            留言簿(2)

            隨筆分類

            隨筆檔案

            文章檔案

            相冊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            成人综合久久精品色婷婷| 久久综合给合久久狠狠狠97色69| MM131亚洲国产美女久久| 亚洲AV无码久久精品成人| 久久精品国产精品青草| 久久久久18| 久久99精品久久久久婷婷| 大美女久久久久久j久久| 狠狠色丁香婷婷久久综合| 久久亚洲精品成人AV| 国产激情久久久久影院| AV无码久久久久不卡蜜桃| 久久久久国色AV免费观看| 久久久亚洲欧洲日产国码二区 | 久久精品亚洲欧美日韩久久| 亚洲欧美成人综合久久久| 国产精品久久久久一区二区三区| 日韩精品久久久久久免费| 久久亚洲AV无码西西人体| 夜夜亚洲天天久久| 亚洲AV无码久久寂寞少妇| 欧美成人免费观看久久| 精品久久久久中文字幕一区| 久久99国产精品久久99果冻传媒| 日韩人妻无码一区二区三区久久| 精品国产日韩久久亚洲| 蜜臀久久99精品久久久久久 | 久久综合久久性久99毛片| 国产精品久久久久久久久免费 | 久久久久久久国产免费看| 国产精品美女久久久m| 色综合久久中文字幕无码| 久久无码专区国产精品发布| 大香伊人久久精品一区二区| 久久精品卫校国产小美女| 久久久国产视频| 亚洲午夜无码久久久久| 久久婷婷五月综合97色| 青青青青久久精品国产 | 区久久AAA片69亚洲| 午夜精品久久久久久影视riav|