public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/18903] New: GDB crashes upon reading debug info
@ 2015-09-01 10:07 martin.apel at simpack dot de
  2015-09-02  8:57 ` [Bug symtab/18903] " martin.apel at simpack dot de
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: martin.apel at simpack dot de @ 2015-09-01 10:07 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18903

            Bug ID: 18903
           Summary: GDB crashes upon reading debug info
           Product: gdb
           Version: 7.10
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: martin.apel at simpack dot de
  Target Milestone: ---

Created attachment 8567
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8567&action=edit
Stack backtrace

When trying to read the debug information of our application, built on Linux
with GCC 4.9 / Intel Fortran 15.0, GDB crashes since version 7.8 until 7.10.
Starting the same executable with GDB 7.7 works without problems. I have
attached a stack backtrace of GDB upon the crash, it seems like in
set_objfile_main_name strlen is called with a null pointer. I have attached a
text file with the stack backtrace generated for GDB 7.10.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug symtab/18903] GDB crashes upon reading debug info
  2015-09-01 10:07 [Bug symtab/18903] New: GDB crashes upon reading debug info martin.apel at simpack dot de
@ 2015-09-02  8:57 ` martin.apel at simpack dot de
  2015-09-03 16:55 ` dje at google dot com
  2020-06-07 17:43 ` tromey at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: martin.apel at simpack dot de @ 2015-09-02  8:57 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18903

--- Comment #1 from Martin Apel <martin.apel at simpack dot de> ---
Created attachment 8571
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8571&action=edit
Workaround patch

The attached patch seems to fix the problem for me. I cannot decide if it is
merely a workaround or an actual fix.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug symtab/18903] GDB crashes upon reading debug info
  2015-09-01 10:07 [Bug symtab/18903] New: GDB crashes upon reading debug info martin.apel at simpack dot de
  2015-09-02  8:57 ` [Bug symtab/18903] " martin.apel at simpack dot de
@ 2015-09-03 16:55 ` dje at google dot com
  2020-06-07 17:43 ` tromey at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: dje at google dot com @ 2015-09-03 16:55 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18903

dje at google dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at google dot com

--- Comment #2 from dje at google dot com ---
The attached patch is close.
There's a preceding reference to name that also needs to be protected.

Here's the definition of set_main_name from 7.6 (I didn't have 7.7 readily
available).

void
set_main_name (const char *name)
{
  if (name_of_main != NULL)
    {
      xfree (name_of_main);
      name_of_main = NULL;
      language_of_main = language_unknown;
    }
  if (name != NULL)
    {
      name_of_main = xstrdup (name);
      language_of_main = language_unknown;
    }
}

I think the thing to do is rewrite set_objfile_main_name to have the same
semantics. [Can't free something from an obstack of course, but otherwise keep
the same semantics.]

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug symtab/18903] GDB crashes upon reading debug info
  2015-09-01 10:07 [Bug symtab/18903] New: GDB crashes upon reading debug info martin.apel at simpack dot de
  2015-09-02  8:57 ` [Bug symtab/18903] " martin.apel at simpack dot de
  2015-09-03 16:55 ` dje at google dot com
@ 2020-06-07 17:43 ` tromey at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at sourceware dot org @ 2020-06-07 17:43 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18903

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tromey at sourceware dot org
         Resolution|---                         |FIXED

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
No test case, so I can't be sure; but the call in
add_partial_symbol checks for null now.

      if (pdi->main_subprogram && actual_name != NULL)
        set_objfile_main_name (objfile, actual_name, cu->language);

So, probably fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-07 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-01 10:07 [Bug symtab/18903] New: GDB crashes upon reading debug info martin.apel at simpack dot de
2015-09-02  8:57 ` [Bug symtab/18903] " martin.apel at simpack dot de
2015-09-03 16:55 ` dje at google dot com
2020-06-07 17:43 ` tromey at sourceware dot org

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).