This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] gdb_bfd_unref failed assertion on AIX.


Hello,

Trying to run any program on AIX triggers a failed assertion:

    (gdb) run
    Starting program: /[...]/simple_main
    /[...]/gdb_bfd.c:288: internal-error: gdb_bfd_unref: Assertion `gdata->refc >= 1' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

What happens is that we have a loop where we forgot to update
the value of "last", resulting in the loop unref'ing the same
BFD over and over again. We bomb the second time around, when
triggering an assertion on the ref counter.

gdb/ChangeLog:

        * rs6000-nat.c (add_vmap): Set "last" to "next" after having
        unref'ed it.

Checked in.

This fixes the startup issue with many programs, but there is still
another issue, distantly related to the bfd-ref-counting patch,
for programs using libpthread.a:

    http://www.sourceware.org/ml/binutils/2012-10/msg00002.html

---
 gdb/ChangeLog    |    5 +++++
 gdb/rs6000-nat.c |    1 +
 2 files changed, 6 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 20631b5..0333167 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-02  Joel Brobecker  <brobecker@adacore.com>
+
+	* rs6000-nat.c (add_vmap): Set "last" to "next" after having
+	unref'ed it.
+
 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
 
 	* target.c (simple_search_memory): Include access length in
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 3eb2cd7..2d2df5b 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -771,6 +771,7 @@ add_vmap (LdInfo *ldi)
 
 	  next = gdb_bfd_openr_next_archived_file (abfd, last);
 	  gdb_bfd_unref (last);
+	  last = next;
 	}
 
       if (!last)
-- 
1.7.9.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]