[Bug testsuite/21553] Double free in gdb when running gdb.linespec/ls-errs.exp

qiyao at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Tue Jun 6 11:00:00 GMT 2017


https://sourceware.org/bugzilla/show_bug.cgi?id=21553

Yao Qi <qiyao at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |qiyao at gcc dot gnu.org

--- Comment #1 from Yao Qi <qiyao at gcc dot gnu.org> ---
AddressSanitizer shows this problem more clearly,

break -line 3 1^M
=================================================================^M
^[[1m^[[31m==28131==ERROR: AddressSanitizer: attempting double-free on
0x602000138450 in thread T0:^M
^[[1m^[[0m    #0 0x2b6671853631 in __interceptor_free
(/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54631)^M
    #1 0x82c45e in xfree(void*)
/home/yao/SourceCode/gnu/gdb/git/gdb/common/common-utils.c:100^M
    #2 0x7ced99 in breakpoint::~breakpoint()
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:12740^M
    #3 0x7cee1d in breakpoint::~breakpoint()
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:12742^M
    #4 0x7e0ee8 in std::default_delete<breakpoint>::operator()(breakpoint*)
const /usr/include/c++/4.9/bits/unique_ptr.h:76^M
    #5 0x7e01db in std::unique_ptr<breakpoint, std::default_delete<breakpoint>
>::~unique_ptr() /usr/include/c++/4.9/bits/unique_ptr.h:236^M
    #6 0x7bf182 in create_breakpoint_sal
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:9328^M
    #7 0x7bf4f4 in create_breakpoints_sal
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:9378^M
    #8 0x7d5cf7 in create_breakpoints_sal_default
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:14368^M
    #9 0x7d0355 in bkpt_create_breakpoints_sal
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:13106^M
....
^M
^[[1m^[[32m0x602000138450 is located 0 bytes inside of 2-byte region
[0x602000138450,0x602000138452)^M
^[[1m^[[0m^[[1m^[[35mfreed by thread T0 here:^[[1m^[[0m^M
    #0 0x2b6671853631 in __interceptor_free
(/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54631)^M
    #1 0x82c45e in xfree(void*)
/home/yao/SourceCode/gnu/gdb/git/gdb/common/common-utils.c:100^M
    #2 0x818844 in do_my_cleanups
/home/yao/SourceCode/gnu/gdb/git/gdb/common/cleanups.c:154^M
    #3 0x818925 in do_cleanups(cleanup*)
/home/yao/SourceCode/gnu/gdb/git/gdb/common/cleanups.c:176^M
    #4 0x82bad1 in throw_exception_cxx
/home/yao/SourceCode/gnu/gdb/git/gdb/common/common-exceptions.c:289^M
    #5 0x82bc85 in throw_exception(gdb_exception)
/home/yao/SourceCode/gnu/gdb/git/gdb/common/common-exceptions.c:317^M
    #6 0x82bf0e in throw_it
/home/yao/SourceCode/gnu/gdb/git/gdb/common/common-exceptions.c:373^M
    #7 0x82bf3d in throw_verror(errors, char const*, __va_list_tag*)
/home/yao/SourceCode/gnu/gdb/git/gdb/common/common-exceptions.c:379^M
    #8 0xbfa572 in verror(char const*, __va_list_tag*)
/home/yao/SourceCode/gnu/gdb/git/gdb/utils.c:432^M
    #9 0x9318cd in error(char const*, ...)
/home/yao/SourceCode/gnu/gdb/git/gdb/common/errors.c:43^M
    #10 0x7bed8c in init_breakpoint_sal
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:9294^M
    #11 0x7bf13b in create_breakpoint_sal
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:9326^M
    #12 0x7bf4f4 in create_breakpoints_sal
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:9378^M
    #13 0x7d5cf7 in create_breakpoints_sal_default
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:14368^M
....
^M
^[[1m^[[35mpreviously allocated by thread T0 here:^[[1m^[[0m^M
    #0 0x2b6671853862 in __interceptor_malloc
(/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54862)^M
    #1 0x82c315 in xmalloc
/home/yao/SourceCode/gnu/gdb/git/gdb/common/common-utils.c:43^M
    #2 0x82cb37 in savestring(char const*, unsigned long)
/home/yao/SourceCode/gnu/gdb/git/gdb/common/common-utils.c:179^M
    #3 0x7c067d in find_condition_and_thread
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:9594^M
    #4 0x7c0fa2 in create_breakpoint(gdbarch*, event_location const*, char*,
int, char*, int, int, bptype, int, auto_boolean, breakpoint_ops const*, int,
int, int, unsigned int)
/home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:9759^M

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list