public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/13259] New: gdb sometimes crashes with SIGSEGV when printing variables
@ 2011-10-05 13:49 martin.runge at web dot de
  2011-10-05 14:09 ` [Bug gdb/13259] " martin.runge at web dot de
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: martin.runge at web dot de @ 2011-10-05 13:49 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13259

             Bug #: 13259
           Summary: gdb sometimes crashes with SIGSEGV when printing
                    variables
           Product: gdb
           Version: 7.3
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: martin.runge@web.de
    Classification: Unclassified


When trying to print a variable's value, gdb can crash with NULL pointer deref
in some cases here:

gdb/varobj.c   (line 2643 in gdb 7.3.1)


static char *
value_get_print_value (struct value *value, enum varobj_display_formats format,
               struct varobj *var)

....
  else if (string_print)
    val_print_string (type, encoding, str_addr, len, stb, &opts); 
....

I have seen some cases, where "type" was still NULL, but "string_print" != 0.

I think val_print_string should only be called, if "type" was resolved before.
If type is still NULL, use val_print_common instead.

I'll send a patch to gdb-patches.

Seen in 7.3.0, 7.3.1 and still present in current snapshot 20111005.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/13259] gdb sometimes crashes with SIGSEGV when printing variables
  2011-10-05 13:49 [Bug gdb/13259] New: gdb sometimes crashes with SIGSEGV when printing variables martin.runge at web dot de
@ 2011-10-05 14:09 ` martin.runge at web dot de
  2011-10-05 14:39 ` jan.kratochvil at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: martin.runge at web dot de @ 2011-10-05 14:09 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13259

--- Comment #1 from Martin Runge <martin.runge at web dot de> 2011-10-05 14:09:07 UTC ---
Created attachment 5962
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5962
additional check for "type != NULL" before using "type"

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/13259] gdb sometimes crashes with SIGSEGV when printing variables
  2011-10-05 13:49 [Bug gdb/13259] New: gdb sometimes crashes with SIGSEGV when printing variables martin.runge at web dot de
  2011-10-05 14:09 ` [Bug gdb/13259] " martin.runge at web dot de
@ 2011-10-05 14:39 ` jan.kratochvil at redhat dot com
  2011-10-06 13:35 ` martin.runge at web dot de
  2011-10-06 13:40 ` jan.kratochvil at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-10-05 14:39 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13259

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
                 CC|                            |jan.kratochvil at redhat
                   |                            |dot com

--- Comment #2 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-10-05 14:38:06 UTC ---
Isn't this fixed by?

commit 991a8c73c524fff940a40d6297ee3e8e948bba4f
Author: pmuldoon <pmuldoon>
Date:   Thu Jul 28 10:36:37 2011 +0000

    2011-07-28  Phil Muldoon  <pmuldoon@redhat.com>

        * varobj.c (value_get_print_value): Move hint check later into the
        function.  Comment function.  Free thevalue before reusing it.

    2011-07-28  Phil Muldoon  <pmuldoon@redhat.com>

        * gdb.python/py-mi.exp: Test printers returning string hint, and
        also not returning a value.
        * gdb.python/py-prettyprint.c: Add testcase for above.
        * gdb.python/py-prettyprint.py: Add test printer for above.

This is only present at HEAD, not at the 7.3.x branch.  Please retest with FSF
GDB HEAD.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/13259] gdb sometimes crashes with SIGSEGV when printing variables
  2011-10-05 13:49 [Bug gdb/13259] New: gdb sometimes crashes with SIGSEGV when printing variables martin.runge at web dot de
  2011-10-05 14:09 ` [Bug gdb/13259] " martin.runge at web dot de
  2011-10-05 14:39 ` jan.kratochvil at redhat dot com
@ 2011-10-06 13:35 ` martin.runge at web dot de
  2011-10-06 13:40 ` jan.kratochvil at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: martin.runge at web dot de @ 2011-10-06 13:35 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13259

Martin Runge <martin.runge at web dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin.runge at web dot de

--- Comment #3 from Martin Runge <martin.runge at web dot de> 2011-10-06 13:34:39 UTC ---
Just testet with CVS head: bug is fixed there.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/13259] gdb sometimes crashes with SIGSEGV when printing variables
  2011-10-05 13:49 [Bug gdb/13259] New: gdb sometimes crashes with SIGSEGV when printing variables martin.runge at web dot de
                   ` (2 preceding siblings ...)
  2011-10-06 13:35 ` martin.runge at web dot de
@ 2011-10-06 13:40 ` jan.kratochvil at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-10-06 13:40 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13259

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WORKSFORME
   Target Milestone|---                         |7.4

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2011-10-06 13:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-05 13:49 [Bug gdb/13259] New: gdb sometimes crashes with SIGSEGV when printing variables martin.runge at web dot de
2011-10-05 14:09 ` [Bug gdb/13259] " martin.runge at web dot de
2011-10-05 14:39 ` jan.kratochvil at redhat dot com
2011-10-06 13:35 ` martin.runge at web dot de
2011-10-06 13:40 ` jan.kratochvil at redhat dot com

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