• <i id='laCc8'><tr id='laCc8'><dt id='laCc8'><q id='laCc8'><span id='laCc8'><b id='laCc8'><form id='laCc8'><ins id='laCc8'></ins><ul id='laCc8'></ul><sub id='laCc8'></sub></form><legend id='laCc8'></legend><bdo id='laCc8'><pre id='laCc8'><center id='laCc8'></center></pre></bdo></b><th id='laCc8'></th></span></q></dt></tr></i><div id='laCc8'><tfoot id='laCc8'></tfoot><dl id='laCc8'><fieldset id='laCc8'></fieldset></dl></div>
      <bdo id='laCc8'></bdo><ul id='laCc8'></ul>

      <legend id='laCc8'><style id='laCc8'><dir id='laCc8'><q id='laCc8'></q></dir></style></legend>

        <tfoot id='laCc8'></tfoot>

        <small id='laCc8'></small><noframes id='laCc8'>

        GCC 中地址清理器的有意义的堆栈跟踪

        时间:2023-09-15

      1. <tfoot id='3w0jX'></tfoot><legend id='3w0jX'><style id='3w0jX'><dir id='3w0jX'><q id='3w0jX'></q></dir></style></legend>

            <tbody id='3w0jX'></tbody>
                <bdo id='3w0jX'></bdo><ul id='3w0jX'></ul>
                <i id='3w0jX'><tr id='3w0jX'><dt id='3w0jX'><q id='3w0jX'><span id='3w0jX'><b id='3w0jX'><form id='3w0jX'><ins id='3w0jX'></ins><ul id='3w0jX'></ul><sub id='3w0jX'></sub></form><legend id='3w0jX'></legend><bdo id='3w0jX'><pre id='3w0jX'><center id='3w0jX'></center></pre></bdo></b><th id='3w0jX'></th></span></q></dt></tr></i><div id='3w0jX'><tfoot id='3w0jX'></tfoot><dl id='3w0jX'><fieldset id='3w0jX'></fieldset></dl></div>
              • <small id='3w0jX'></small><noframes id='3w0jX'>

                • 本文介绍了GCC 中地址清理器的有意义的堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我刚刚尝试使用 GCC 和 -fsanitize=address 标志进行编译.当我运行我的程序时,地址清理器发现了一个缺陷,但堆栈跟踪没有帮助.如何配置它以使其指向我需要查看的源代码位置?

                  I just tried compiling with GCC and the -fsanitize=address flag. When I run my program, the address sanitizer finds a flaw, but the stack trace is not helpful. How can I configure this so that it points to the source code locations I need to look at?

                  =================================================================
                  ==32415== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6006004b38a0 at pc 0x10b136d5c bp 0x7fff54b8e5d0 sp 0x7fff54b8e5c8
                  WRITE of size 8 at 0x6006004b38a0 thread T0
                      #0 0x10b136d5b (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1000c6d5b)
                      #1 0x10b136e0c (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1000c6e0c)
                      #2 0x10b138ef5 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1000c8ef5)
                      #3 0x10b137a2e (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1000c7a2e)
                      #4 0x10b13acf2 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1000cacf2)
                      #5 0x10b253647 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001e3647)
                      #6 0x10b24ee55 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001dee55)
                      #7 0x10b237108 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001c7108)
                      #8 0x10b237c17 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001c7c17)
                      #9 0x10b2385c9 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001c85c9)
                      #10 0x10b23f659 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001cf659)
                      #11 0x10b254951 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001e4951)
                      #12 0x10b24fbeb (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001dfbeb)
                      #13 0x10b23dc38 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001cdc38)
                      #14 0x10b229d28 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001b9d28)
                      #15 0x10b229bda (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001b9bda)
                      #16 0x7fff8b7785fc (/usr/lib/system/libdyld.dylib+0x35fc)
                      #17 0x2
                  0x6006004b38a0 is located 0 bytes to the right of 32-byte region [0x6006004b3880,0x6006004b38a0)
                  allocated by thread T0 here:
                      #0 0x10b8bb63a (/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/libasan.0.dylib+0xe63a)
                      #1 0x10b0777c6 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1000077c6)
                      #2 0x10b07701e (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x10000701e)
                      #3 0x10b09cd1b (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x10002cd1b)
                      #4 0x10b09c6ef (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x10002c6ef)
                      #5 0x10b09960e (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x10002960e)
                      #6 0x10b137844 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1000c7844)
                      #7 0x10b13acf2 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1000cacf2)
                      #8 0x10b253647 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001e3647)
                      #9 0x10b24ee55 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001dee55)
                      #10 0x10b237108 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001c7108)
                      #11 0x10b237c17 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001c7c17)
                      #12 0x10b2385c9 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001c85c9)
                      #13 0x10b23f659 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001cf659)
                      #14 0x10b254951 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001e4951)
                      #15 0x10b24fbeb (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001dfbeb)
                      #16 0x10b23dc38 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001cdc38)
                      #17 0x10b229d28 (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001b9d28)
                      #18 0x10b229bda (/Users/cls/workspace/NetworKit/./NetworKit-Tests-D+0x1001b9bda)
                      #19 0x7fff8b7785fc (/usr/lib/system/libdyld.dylib+0x35fc)
                      #20 0x2
                  Shadow bytes around the buggy address:
                    0x1c00c00966c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
                    0x1c00c00966d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
                    0x1c00c00966e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
                    0x1c00c00966f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
                    0x1c00c0096700: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
                  =>0x1c00c0096710: 00 00 00 00[fa]fa fd fd fd fd fa fa fd fd fd fa
                    0x1c00c0096720: fa fa fd fd fd fa fa fa 00 00 00 07 fa fa 00 00
                    0x1c00c0096730: 00 04 fa fa fd fd fd fd fa fa fd fd fd fd fa fa
                    0x1c00c0096740: fd fd fd fa fa fa fd fd fd fa fa fa 00 00 00 07
                    0x1c00c0096750: fa fa 00 00 00 00 fa fa 00 00 00 04 fa fa fd fd
                    0x1c00c0096760: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa
                  Shadow byte legend (one shadow byte represents 8 application bytes):
                    Addressable:           00
                    Partially addressable: 01 02 03 04 05 06 07 
                    Heap left redzone:     fa
                    Heap righ redzone:     fb
                    Freed Heap region:     fd
                    Stack left redzone:    f1
                    Stack mid redzone:     f2
                    Stack right redzone:   f3
                    Stack partial redzone: f4
                    Stack after return:    f5
                    Stack use after scope: f8
                    Global redzone:        f9
                    Global init order:     f6
                    Poisoned by user:      f7
                    ASan internal:         fe
                  ==32415== ABORTING
                  

                  推荐答案

                  这对我有用:

                  • 确保您已安装 llvm(包括 llvm-symbolizer).
                  • 导出以下变量

                  • Make sure you have installed llvm (including llvm-symbolizer).
                  • Export the following variable

                  export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer

                  (替换为 llvm-symbolizer 命令的正确路径).

                  (replace with your correct path to the llvm-symbolizer command).

                  现在运行你的可执行文件(a.out)

                  Now run your executable (a.out for now) as

                  ASAN_OPTIONS=symbolize=1 a.out

                  这篇关于GCC 中地址清理器的有意义的堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:指针的大小是多少?它具体取决于什么? 下一篇:C++结构对齐问题

                  相关文章

                  最新文章

                  1. <tfoot id='BhFkX'></tfoot>

                    <small id='BhFkX'></small><noframes id='BhFkX'>

                  2. <i id='BhFkX'><tr id='BhFkX'><dt id='BhFkX'><q id='BhFkX'><span id='BhFkX'><b id='BhFkX'><form id='BhFkX'><ins id='BhFkX'></ins><ul id='BhFkX'></ul><sub id='BhFkX'></sub></form><legend id='BhFkX'></legend><bdo id='BhFkX'><pre id='BhFkX'><center id='BhFkX'></center></pre></bdo></b><th id='BhFkX'></th></span></q></dt></tr></i><div id='BhFkX'><tfoot id='BhFkX'></tfoot><dl id='BhFkX'><fieldset id='BhFkX'></fieldset></dl></div>

                      <bdo id='BhFkX'></bdo><ul id='BhFkX'></ul>
                    <legend id='BhFkX'><style id='BhFkX'><dir id='BhFkX'><q id='BhFkX'></q></dir></style></legend>