[PATCH] record_latest_value: Call release_value_or_incref instead of release_value
Ludovic Courtès
ludo@gnu.org
Mon Mar 3 09:17:00 GMT 2014
Doug Evans <xdje42@gmail.com> skribis:
> 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.
>
> (gdb) guile (define histnum (history-append! (make-value 42)))
Indeed, good catch. Here’s how I reproduced it:
--8<---------------cut here---------------start------------->8---
(gdb) guile (use-modules (gdb))
(gdb) guile (history-append! (make-value 42))
1
(gdb) p $1
$2 = 42
(gdb) guile (gc)
(gdb) p $1
Segmentation fault
--8<---------------cut here---------------end--------------->8---
What about adding this to the patch as a test case?
Thanks,
Ludo’.
More information about the Gdb-patches
mailing list