From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21384 invoked by alias); 3 Mar 2014 09:17:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 21370 invoked by uid 89); 3 Mar 2014 09:17:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: hera.aquilenet.fr Received: from hera.aquilenet.fr (HELO hera.aquilenet.fr) (141.255.128.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Mar 2014 09:17:20 +0000 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 4DA661E18; Mon, 3 Mar 2014 10:17:16 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sgkcLO2laEOa; Mon, 3 Mar 2014 10:17:16 +0100 (CET) Received: from pluto (pluto.bordeaux.inria.fr [193.50.110.57]) by hera.aquilenet.fr (Postfix) with ESMTPSA id DA26E1C19; Mon, 3 Mar 2014 10:17:15 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] record_latest_value: Call release_value_or_incref instead of release_value References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 =?utf-8?Q?Vent=C3=B4se?= an 222 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 03 Mar 2014 09:17:00 -0000 In-Reply-To: (Doug Evans's message of "Sun, 02 Mar 2014 22:00:03 -0800") Message-ID: <87wqgbsktg.fsf@gnu.org> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-03/txt/msg00030.txt.bz2 Doug Evans 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=E2=80=99s 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 =3D 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=E2=80=99.