This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] record_latest_value: Call release_value_or_incref instead of release_value


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]