This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] record_latest_value: Call release_value_or_incref instead of release_value
- From: Doug Evans <xdje42 at gmail dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Ludovic Courtès <ludo at gnu dot org>
- Date: Sun, 2 Mar 2014 22:02:47 -0800
- Subject: Re: [PATCH] record_latest_value: Call release_value_or_incref instead of release_value
- Authentication-results: sourceware.org; auth=none
- References: <m3zjl7u8ik dot fsf at sspiff dot org>
On Sun, Mar 2, 2014 at 10:00 PM, Doug Evans <xdje42@gmail.com> wrote:
> Hi.
>
> While testing a fix for bug 16612 I was getting segvs and traced it to
> the new history-append! Scheme function.
>
> The underlying gdb value was getting prematurely freed when its
> Scheme wrapper was garbage collected, but it was still in the value
> history.
>
> I think this is because its reference counting is wrong.
> Upon return from record_latest_value, its reference count is still one.
> However it was one upon entry. It should be two, right?
> One for the Scheme wrapper and one for the history entry.
Apologies for the followup.
I should have said "However it was one upon entry and the value had
already been released."
The value gets released when creating the Scheme wrapper.