public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: "Hahnfeld, Jonas" <Hahnfeld@itc.rwth-aachen.de>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	"qiyao@gcc.gnu.org" <qiyao@gcc.gnu.org>
Subject: Re: [PATCH] Fix PR gdb/19208 - SIGSEV while opening Fortran program compiled with ifort
Date: Sun, 17 Jan 2016 06:18:00 -0000	[thread overview]
Message-ID: <20160117061757.GA4059@adacore.com> (raw)
In-Reply-To: <8dcce77f86d345348721e0ff02032c74@rwthex-s2-b.rwth-ad.de>

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

> Ping...

Attached is what I just pushed.

gdb/ChangeLog:

       PR gdb/19208
       * dwarf2read.c (read_partial_die): Do not call set_objfile_main_name
       if the function has no name.

(tested on x86_64-linux, with no Fortran)

> Will this also be included in 7.10.2 (if planned?)

As of today, there isn't going to be a 7.10.2. We're very close to
branching for 7.11, so I don't think it's worth backporting, as
the branch will soon be closed.

I also meant to review your comments regarding the documentation
we have about how to contribute, and haven't had the time. But
thank you for those, because they help us spot areas where the
info may have bitrotten.

-- 
Joel

[-- Attachment #2: 0001-GDB-SIGSEGV-opening-a-Fortran-program-compiled-with-.patch --]
[-- Type: text/x-diff, Size: 1854 bytes --]

From dc365182240722969f044918ecd3cab00da55502 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
Date: Wed, 6 Jan 2016 10:10:39 +0400
Subject: [PATCH] GDB SIGSEGV opening a Fortran program compiled with ifort

This patch fixes a SIGSEGV when trying to open a Fortran program
compiled with ifort (reproduced using version using version 16.0.1.150).
The error can be reproduce with most, if not any program. For instance,
a single file only containing "end", compiled with no additional flag,
suffices.

gdb/ChangeLog:

       PR gdb/19208
       * dwarf2read.c (read_partial_die): Do not call set_objfile_main_name
       if the function has no name.
---
 gdb/ChangeLog    | 7 +++++++
 gdb/dwarf2read.c | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fe8fd6c..dbc4b08 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2016-01-17  Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>  (tiny change)
+
+	Pushed by Joel Brobecker  <brobecker@adacore.com>.
+	PR gdb/19208
+	* dwarf2read.c (read_partial_die): Do not call set_objfile_main_name
+	if the function has no name.
+
 2016-01-15  Sandra Loosemore  <sandra@codesourcery.com>
 
 	* charset.c [PHONY_ICONV] (GDB_DEFAULT_HOST_CHARSET):
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index c410500..1020c12 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -15936,7 +15936,8 @@ read_partial_die (const struct die_reader_specs *reader,
 	     compilers pick up the new representation, we'll support this
 	     practice.  */
 	  if (DW_UNSND (&attr) == DW_CC_program
-	      && cu->language == language_fortran)
+	      && cu->language == language_fortran
+	      && part_die->name != NULL)
 	    set_objfile_main_name (objfile, part_die->name, language_fortran);
 	  break;
 	case DW_AT_inline:
-- 
2.5.0


      reply	other threads:[~2016-01-17  6:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 15:47 Hahnfeld, Jonas
2016-01-06  6:20 ` Joel Brobecker
2016-01-06  7:42   ` Hahnfeld, Jonas
2016-01-14  7:19   ` Hahnfeld, Jonas
2016-01-17  6:18     ` Joel Brobecker [this message]

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=20160117061757.GA4059@adacore.com \
    --to=brobecker@adacore.com \
    --cc=Hahnfeld@itc.rwth-aachen.de \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyao@gcc.gnu.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).