From: Doug Evans <dje@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org, tromey@redhat.com,
ccoutant@google.com, saugustine@google.com
Subject: Re: Crash regression for gdb.dwarf2/dw2-inheritance.exp [Re: [RFA 3/3] Initial Fission support, the actual Fission stuff]
Date: Mon, 30 Apr 2012 00:06:00 -0000 [thread overview]
Message-ID: <CADPb22S5Fz_=_XuJ2C0HWaqey_an-QM=Ba=uFvYozNgkifw0CQ@mail.gmail.com> (raw)
In-Reply-To: <20120429085754.GA9548@host2.jankratochvil.net>
[-- Attachment #1: Type: text/plain, Size: 2907 bytes --]
On Sun, Apr 29, 2012 at 1:57 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Wed, 18 Apr 2012 20:57:38 +0200, Doug Evans wrote:
>> 2012-04-18 Doug Evans <dje@google.com>
>>
>> Initial support for Fission. http://gcc.gnu.org/wiki/DebugFission
>
> Running gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp ...
> -PASS: gdb.dwarf2/dw2-inheritance.exp: ptype inherited
> +ERROR: couldn't load /unsafegdb/testsuite.unix.-m32/gdb.dwarf2/dw2-inheritance.x into /unsafegdb/testsuite.unix.-m32/../../gdb/gdb (end of file).
> +ERROR: Couldn't send ptype inherited to GDB.
> +UNRESOLVED: gdb.dwarf2/dw2-inheritance.exp: ptype inherited
>
> Program terminated with signal 11, Segmentation fault.
> #0 0x000000000063037c in dwarf_decode_line_header (offset=0, cu=0x2c4b410) at dwarf2read.c:12320
> 12320 abfd = section->asection->owner;
> (gdb) p section->asection
> $2 = (asection *) 0x0
> (gdb) bt
> #0 0x000000000063037c in dwarf_decode_line_header (offset=0, cu=0x2c4b410) at dwarf2read.c:12320
> #1 0x000000000061c354 in dwarf2_build_include_psymtabs (cu=0x2c4b410, die=0x2c4b5d0, pst=0x2c2d810) at dwarf2read.c:3324
> #2 0x000000000061e46b in process_psymtab_comp_unit_reader (reader=0x7fff3fa1ac90, info_ptr=0x2c2d777 "\003base", comp_unit_die=0x2c4b5d0, has_children=1,
> data=0x0) at dwarf2read.c:4159
> #3 0x000000000061dc53 in init_and_read_dies_worker (this_cu=0x2c2d7a0, use_existing_cu=0, keep=0, die_reader_func=
> 0x61e036 <process_psymtab_comp_unit_reader>, data=0x0) at dwarf2read.c:3895
> #4 0x000000000061dd12 in init_cu_and_read_dies (this_cu=0x2c2d7a0, use_existing_cu=0, keep=0, die_reader_func=0x61e036 <process_psymtab_comp_unit_reader>,
> data=0x0) at dwarf2read.c:3936
> #5 0x000000000061e4f9 in process_psymtab_comp_unit (this_cu=0x2c2d7a0) at dwarf2read.c:4178
> #6 0x000000000061e726 in dwarf2_build_psymtabs_hard (objfile=0x2c386d0) at dwarf2read.c:4269
> #7 0x000000000061bca2 in dwarf2_build_psymtabs (objfile=0x2c386d0) at dwarf2read.c:3133
> #8 0x0000000000508db2 in read_psyms (objfile=0x2c386d0) at elfread.c:1449
> #9 0x000000000058f9be in require_partial_symbols (objfile=0x2c386d0, verbose=0) at psymtab.c:92
>
> It happens on RHEL-6 i386/x86_68/x86_64-m32. Feel free to request more info.
>
>
> Regards,
> Jan
Hi.
I can't recreate this on my fc16 box (neither i386 nor amd64), but the
it's easy enough to see what the issue is.
Can you test this patch? Regression tested here.
It also fixes a potential segv in dwarf_decode_macros.
2012-04-29 Doug Evans <dje@seba.sebabeach.org>
* dwarf2read.c (dwarf_decode_macros): New arg section_name.
All callers updated.
(init_cu_die_reader): Verify the section is non-empty.
(dwarf_decode_line_header): Don't dereference section->asection
until we know the section is present. Return NULL, not 0.
[-- Attachment #2: gdb-120429-fission-supplement-3-1.patch.txt --]
[-- Type: text/plain, Size: 3582 bytes --]
2012-04-29 Doug Evans <dje@seba.sebabeach.org>
* dwarf2read.c (dwarf_decode_macros): New arg section_name.
All callers updated.
(init_cu_die_reader): Verify the section is non-empty.
(dwarf_decode_line_header): Don't dereference section->asection
until we know the section is present. Return NULL, not 0.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.644
diff -u -p -r1.644 dwarf2read.c
--- dwarf2read.c 28 Apr 2012 23:22:13 -0000 1.644
+++ dwarf2read.c 29 Apr 2012 22:13:16 -0000
@@ -1317,7 +1317,7 @@ static struct die_info *dwarf_alloc_die
static void dwarf_decode_macros (struct line_header *, unsigned int,
char *, bfd *, struct dwarf2_cu *,
struct dwarf2_section_info *,
- int);
+ int, const char *);
static int attr_form_is_block (struct attribute *);
@@ -1671,7 +1671,8 @@ zlib_decompress_section (struct objfile
#endif
}
-/* A helper function that decides whether a section is empty. */
+/* A helper function that decides whether a section is empty,
+ or not present. */
static int
dwarf2_section_empty_p (struct dwarf2_section_info *info)
@@ -3588,7 +3589,7 @@ init_cu_die_reader (struct die_reader_sp
struct dwarf2_section_info *section,
struct dwo_file *dwo_file)
{
- gdb_assert (section->readin);
+ gdb_assert (section->readin && section->buffer != NULL);
reader->abfd = section->asection->owner;
reader->cu = cu;
reader->dwo_file = dwo_file;
@@ -6354,7 +6355,8 @@ read_file_scope (struct die_info *die, s
dwarf_decode_macros (cu->line_header, DW_UNSND (attr),
comp_dir, abfd, cu,
- &dwarf2_per_objfile->macro, 1);
+ &dwarf2_per_objfile->macro, 1,
+ ".debug_macro");
}
else
{
@@ -6365,7 +6367,8 @@ read_file_scope (struct die_info *die, s
dwarf_decode_macros (cu->line_header, macro_offset,
comp_dir, abfd, cu,
- &dwarf2_per_objfile->macinfo, 0);
+ &dwarf2_per_objfile->macinfo, 0,
+ ".debug_macinfo");
}
}
@@ -12317,7 +12320,6 @@ dwarf_decode_line_header (unsigned int o
section = &cu->dwo_unit->dwo_file->sections.line;
else
section = &dwarf2_per_objfile->line;
- abfd = section->asection->owner;
dwarf2_read_section (dwarf2_per_objfile->objfile, section);
if (section->buffer == NULL)
@@ -12329,6 +12331,10 @@ dwarf_decode_line_header (unsigned int o
return 0;
}
+ /* We can't do this until we know the section is non-empty.
+ Only then do we know we have such a section. */
+ abfd = section->asection->owner;
+
/* Make sure that at least there's room for the total_length field.
That could be 12 bytes long, but we're just going to fudge that. */
if (offset + 4 >= section->size)
@@ -16894,7 +16900,7 @@ dwarf_decode_macros (struct line_header
char *comp_dir, bfd *abfd,
struct dwarf2_cu *cu,
struct dwarf2_section_info *section,
- int section_is_gnu)
+ int section_is_gnu, const char *section_name)
{
struct objfile *objfile = dwarf2_per_objfile->objfile;
gdb_byte *mac_ptr, *mac_end;
@@ -16909,8 +16915,7 @@ dwarf_decode_macros (struct line_header
dwarf2_read_section (objfile, section);
if (section->buffer == NULL)
{
- complaint (&symfile_complaints, _("missing %s section"),
- section->asection->name);
+ complaint (&symfile_complaints, _("missing %s section"), section_name);
return;
}
next prev parent reply other threads:[~2012-04-29 23:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-18 19:12 [RFA 3/3] Initial Fission support, the actual Fission stuff Doug Evans
2012-04-19 5:07 ` Doug Evans
2012-04-27 18:29 ` Tom Tromey
2012-04-19 10:25 ` Yao Qi
2012-04-19 15:28 ` Doug Evans
2012-04-27 18:38 ` Tom Tromey
2012-04-27 18:20 ` Tom Tromey
2012-04-28 23:59 ` Doug Evans
2012-04-29 9:05 ` Crash regression for gdb.dwarf2/dw2-inheritance.exp [Re: [RFA 3/3] Initial Fission support, the actual Fission stuff] Jan Kratochvil
2012-04-30 0:06 ` Doug Evans [this message]
2012-04-30 2:07 ` Jan Kratochvil
2012-04-30 14:30 ` Doug Evans
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='CADPb22S5Fz_=_XuJ2C0HWaqey_an-QM=Ba=uFvYozNgkifw0CQ@mail.gmail.com' \
--to=dje@google.com \
--cc=ccoutant@google.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=saugustine@google.com \
--cc=tromey@redhat.com \
/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