public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org, archer@sourceware.org
Subject: Re: [patch] fix for crash in python pretty-printer
Date: Tue, 07 Jul 2009 20:41:00 -0000	[thread overview]
Message-ID: <8ac60eac0907071341m71bff75by3b7c958e86bbcd39@mail.gmail.com> (raw)
In-Reply-To: <8ac60eac0907071250h4bbd5219p31e5506bd997cd21@mail.gmail.com>

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

On Tue, Jul 7, 2009 at 12:50 PM, Paul Pluzhnikov<ppluzhnikov@google.com> wrote:

> Committed to the mainline.

It turns out I didn't follow what happens when value_struct_elt() raises
error correctly: when it does, res_val will be left as NULL, and that will
trigger gdb_assert in my previous patch.

Here is a fix. Sorry for the noise :-(

-- 
Paul Pluzhnikov

2009-07-07  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* python/python-value.c (valpy_getitem): Remove incorrect assert.

[-- Attachment #2: gdb-pretty-printer-crash-20090707-2.txt --]
[-- Type: text/plain, Size: 682 bytes --]

Index: python/python-value.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python-value.c,v
retrieving revision 1.22
diff -u -p -u -r1.22 python-value.c
--- python/python-value.c	7 Jul 2009 19:36:09 -0000	1.22
+++ python/python-value.c	7 Jul 2009 20:32:27 -0000
@@ -294,17 +294,11 @@ valpy_getitem (PyObject *self, PyObject 
 	}
     }
 
-  if (res_val == NULL)
-    {
-      gdb_assert (field == NULL);
-      return NULL;
-    }
-
   if (field)
     xfree (field);
   GDB_PY_HANDLE_EXCEPTION (except);
 
-  return value_to_value_object (res_val);
+  return res_val ? value_to_value_object (res_val) : NULL;
 }
 
 static int

  reply	other threads:[~2009-07-07 20:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07 18:01 Paul Pluzhnikov
2009-07-07 18:23 ` Tom Tromey
2009-07-07 19:51   ` Paul Pluzhnikov
2009-07-07 20:41     ` Paul Pluzhnikov [this message]
2009-07-07 20:54       ` Tom Tromey
2009-07-07 21:05         ` Paul Pluzhnikov

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=8ac60eac0907071341m71bff75by3b7c958e86bbcd39@mail.gmail.com \
    --to=ppluzhnikov@google.com \
    --cc=archer@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).