* [patch] [python] Fix for double-free.
@ 2008-10-23 17:22 Paul Pluzhnikov
2008-10-23 19:16 ` Pedro Alves
0 siblings, 1 reply; 3+ messages in thread
From: Paul Pluzhnikov @ 2008-10-23 17:22 UTC (permalink / raw)
To: gdb-patches
Greetings,
I made the change below on archer-tromey-python.
Unfortunately, I can't seem to be able to construct a test case
which exposes this bug.
OK to commit without a test case?
Thanks,
--
Paul Pluzhnikov
2008-10-23 Paul Pluzhnikov <ppluzhnikov@google.com>
* python/python-value (valpy_getitem): Fix heap corruption.
diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c
index 93af465..5064ccf 100644
--- a/gdb/python/python-value.c
+++ b/gdb/python/python-value.c
@@ -209,7 +209,8 @@ valpy_getitem (PyObject *self, PyObject *key)
TRY_CATCH (except, RETURN_MASK_ALL)
{
- res_val = value_struct_elt (&self_value->value, NULL, field, 0, NULL);
+ struct value *tmp = self_value->value;
+ res_val = value_struct_elt (&tmp, NULL, field, 0, NULL);
}
GDB_PY_HANDLE_EXCEPTION (except);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch] [python] Fix for double-free.
2008-10-23 17:22 [patch] [python] Fix for double-free Paul Pluzhnikov
@ 2008-10-23 19:16 ` Pedro Alves
2008-10-23 22:51 ` Paul Pluzhnikov
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2008-10-23 19:16 UTC (permalink / raw)
To: gdb-patches; +Cc: Paul Pluzhnikov
I'll take this one.
On Thursday 23 October 2008 18:21:58, Paul Pluzhnikov wrote:
> Greetings,
>
> I made the change below on archer-tromey-python.
>
Thanks for sending it here.
(((( When I asked before please to send breakage fixes here, I was
refering to breakages that affected everybody's non-python GDB usage, like
the build breakage of the other thread. It's certainly nice to have the
code maintained though, in case people are already trying simple
things out. Thanks again. ))))
> Unfortunately, I can't seem to be able to construct a test case
> which exposes this bug.
>
Weird. Maybe the fact that you can't trigger it in FSF has something
to do with owned_by_gdb not being anywhere? That's strange, because one
would expect to see a double-free then anyway, I guess. Still, with
that in mind, the patch looks correct to me, though.
> OK to commit without a test case?
IMO, yes. I'm sure you'll have testcases that trigger this when
more of the python stuff is in.
> Thanks,
> --
> Paul Pluzhnikov
>
> 2008-10-23 Paul Pluzhnikov <ppluzhnikov@google.com>
>
> * python/python-value (valpy_getitem): Fix heap corruption.
>
--
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] [python] Fix for double-free.
2008-10-23 19:16 ` Pedro Alves
@ 2008-10-23 22:51 ` Paul Pluzhnikov
0 siblings, 0 replies; 3+ messages in thread
From: Paul Pluzhnikov @ 2008-10-23 22:51 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
On Thu, Oct 23, 2008 at 12:15 PM, Pedro Alves <pedro@codesourcery.com> wrote:
>> OK to commit without a test case?
>
> IMO, yes. I'm sure you'll have testcases that trigger this when
> more of the python stuff is in.
I *do* already have a test case which shows the bug on the branch.
Committed as above.
Thanks,
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-23 22:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-23 17:22 [patch] [python] Fix for double-free Paul Pluzhnikov
2008-10-23 19:16 ` Pedro Alves
2008-10-23 22:51 ` Paul Pluzhnikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox