Bug 562975

Summary: double deletion of std::terminate breakpoint
Product: [Fedora] Fedora Reporter: stack
Component: gdbAssignee: Tom Tromey <tromey>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: jan.kratochvil, patrickm, pmuldoon, tromey
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard: abrt_hash:ee2d5ba4d63c4f5d653b8d3f6158f21c9b75aef0
Fixed In Version: gdb-7.0.1-34.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-16 00:50:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace none

Description stack 2010-02-08 21:46:43 UTC
abrt 1.0.4 detected a crash.

architecture: i686
Attached file: backtrace
cmdline: /usr/bin/gdb -i mi
comment: QtCreator 1.3.1 has previously been downloaded and installed in form of a binary package from www.trolltech.com.
component: gdb
executable: /usr/bin/gdb
kernel: 2.6.31.12-174.2.3.fc12.i686.PAE
package: gdb-7.0.1-31.fc12
rating: 4
reason: Process was terminated by signal 6 (Aborted)
release: Fedora release 12 (Constantine)

How to reproduce
-----
1. Compile qt-creator-1.3.1-src from within QtCreator 1.3.1 in Debug mode.
2. Execute resulting binary and attach to external process from within QtCreator.
3. Switch GUI focus to target process, wile gdb is still attaching to the target process (QtCreator statusbar: "Setting Breakpoints").

Comment 1 stack 2010-02-08 21:46:46 UTC
Created attachment 389630 [details]
File: backtrace

Comment 2 Tom Tromey 2010-02-24 22:08:53 UTC
I was able to reproduce this with a small c++ program.
Running with -i=mi and using -interpreter-exec seems necessary.
I have the libstdc++ debuginfo installed, too, but I'm not sure
whether this is required.  I did have to have my program reference
dlopen.

-interpreter-exec console "print (void*)dlopen(\"/usr/lib/libz.so\", 0x02)"
=library-loaded,id="/usr/lib/libz.so",target-name="/usr/lib/libz.so",host-name="/usr/lib/libz.so",symbols-loaded="0"
==28851== 
==28851== Invalid read of size 4
==28851==    at 0x821A196: delete_breakpoint (breakpoint.c:8693)
==28851==    by 0x821A376: do_delete_breakpoint_cleanup (breakpoint.c:8768)
==28851==    by 0x80B2FCF: do_my_cleanups (utils.c:394)
==28851==    by 0x80B2F8F: do_cleanups (utils.c:377)
==28851==    by 0x82598C5: call_function_by_hand (infcall.c:995)
==28851==    by 0x822E06E: evaluate_subexp_standard (eval.c:1639)
==28851==    by 0x82E312F: evaluate_subexp_c (c-lang.c:1040)
==28851==    by 0x822A445: evaluate_subexp (eval.c:75)
==28851==    by 0x8230E7F: evaluate_subexp_standard (eval.c:2474)
==28851==    by 0x82E312F: evaluate_subexp_c (c-lang.c:1040)
==28851==    by 0x822A445: evaluate_subexp (eval.c:75)
==28851==    by 0x822A61C: evaluate_expression (eval.c:165)
==28851==  Address 0x431eb04 is 4 bytes inside a block of size 204 free'd
==28851==    at 0x4005BCA: free (vg_replace_malloc.c:323)
==28851==    by 0x80B4026: xfree (utils.c:1332)
==28851==    by 0x821A360: delete_breakpoint (breakpoint.c:8762)
==28851==    by 0x821A947: breakpoint_re_set_one (breakpoint.c:9013)
==28851==    by 0x826F17B: catch_errors (exceptions.c:510)
==28851==    by 0x821ACA9: breakpoint_re_set (breakpoint.c:9177)
==28851==    by 0x831CBCF: solib_add (solib.c:757)
==28851==    by 0x8263ABD: handle_inferior_event (infrun.c:3895)
==28851==    by 0x8260E31: wait_for_inferior (infrun.c:2281)
==28851==    by 0x826054D: proceed (infrun.c:1885)
==28851==    by 0x8258A93: run_inferior_call (infcall.c:372)
==28851==    by 0x825954F: call_function_by_hand (infcall.c:794)
~"$1 = (void *) 0x804a038\n"

Comment 3 Tom Tromey 2010-02-24 22:48:30 UTC
Testing a patch.

Comment 4 Tom Tromey 2010-02-25 18:13:32 UTC
I sent a patch upstream for comments:

http://sourceware.org/ml/gdb-patches/2010-02/msg00625.html

I think this is ok for inclusion in the RPM as-is.

Comment 5 Fedora Update System 2010-03-12 13:58:56 UTC
gdb-7.0.1-34.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/gdb-7.0.1-34.fc12

Comment 6 Fedora Update System 2010-03-16 00:50:21 UTC
gdb-7.0.1-34.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.