From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch] .gdb_index: Do not crash on NOBITS
Date: Wed, 08 Sep 2010 19:40:00 -0000 [thread overview]
Message-ID: <20100908185837.GA24606@host1.dyn.jankratochvil.net> (raw)
Hi,
elfutils-0.148 still do not contain patch of its GIT
804e9ca4d644e64a6125307cbf0a0b89477d7611 where the .gdb_index section has been
also split into the separate debug info file.
Due to it binaries split using elfutils-0.148 contain
[38] .gdb_index NOBITS 0000000000000000 0000338c
instead of expected
[28] .gdb_index PROGBITS 0000000000000000 0000211c
and due to it GDB while reading the file can error() by:
Reading symbols from x.debug...Dwarf Error: Can't read DWARF data from 'x.debug'
which should not be fatal but due to some other bugs therein it can crash GDB.
The wrong separate debug info file is for example:
http://kojipkgs.fedoraproject.org/packages/glibc/2.12.90/10/x86_64/glibc-debuginfo-2.12.90-10.x86_64.rpm
/usr/lib/debug/lib64/libutil-2.12.90.so.debug
OK to check-in?
It does not attempt to use .gdb_index from the main binary, it will just
disable .gdb_index usage on these binaries.
Thanks,
Jan
gdb/
2010-09-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2read.c (dwarf2_read_index): Return on no SEC_HAS_CONTENTS.
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1904,6 +1904,13 @@ dwarf2_read_index (struct objfile *objfile)
if (dwarf2_per_objfile->gdb_index.asection == NULL
|| dwarf2_per_objfile->gdb_index.size == 0)
return 0;
+
+ /* Older elfutils strip versions could keep the section in the main
+ executable while splitting it for the separate debug info file. */
+ if ((bfd_get_file_flags (dwarf2_per_objfile->gdb_index.asection)
+ & SEC_HAS_CONTENTS) == 0)
+ return 0;
+
dwarf2_read_section (objfile, &dwarf2_per_objfile->gdb_index);
addr = dwarf2_per_objfile->gdb_index.buffer;
next reply other threads:[~2010-09-08 18:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-08 19:40 Jan Kratochvil [this message]
2010-09-08 23:19 ` Tom Tromey
2010-09-08 23:36 ` Jan Kratochvil
2010-09-09 14:05 ` [patch] Fix ELF stale reference [Re: [patch] .gdb_index: Do not crash on NOBITS] Jan Kratochvil
2010-09-09 16:01 ` Doug Evans
2010-09-09 16:11 ` Jan Kratochvil
2010-10-14 16:07 ` [patch] Fix ELF stale reference Jan Kratochvil
2010-10-14 17:46 ` Tom Tromey
2010-11-19 22:49 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100908185837.GA24606@host1.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).