From unknown Sat Aug 09 15:50:53 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#17466 <17466@debbugs.gnu.org> To: bug#17466 <17466@debbugs.gnu.org> Subject: Status: unexpected bytevector contents with get-bytevector-n Reply-To: bug#17466 <17466@debbugs.gnu.org> Date: Sat, 09 Aug 2025 22:50:53 +0000 retitle 17466 unexpected bytevector contents with get-bytevector-n reassign 17466 guile submitter 17466 J Kalbhenn severity 17466 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun May 11 12:50:29 2014 Received: (at submit) by debbugs.gnu.org; 11 May 2014 16:50:29 +0000 Received: from localhost ([127.0.0.1]:59459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjWxG-0007h3-DV for submit@debbugs.gnu.org; Sun, 11 May 2014 12:50:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45901) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjRV5-00055r-EI for submit@debbugs.gnu.org; Sun, 11 May 2014 07:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjRUr-0007wo-2p for submit@debbugs.gnu.org; Sun, 11 May 2014 07:00:54 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjRUr-0007wk-0p for submit@debbugs.gnu.org; Sun, 11 May 2014 07:00:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjRUk-0007iz-MK for bug-guile@gnu.org; Sun, 11 May 2014 07:00:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjRUe-0007w1-Hj for bug-guile@gnu.org; Sun, 11 May 2014 07:00:38 -0400 Received: from mx02.posteo.de ([89.146.194.165]:37734 helo=posteo.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjRUe-0007qq-7U for bug-guile@gnu.org; Sun, 11 May 2014 07:00:32 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.posteo.de (Postfix) with ESMTP id 2B12F25AF530 for ; Sun, 11 May 2014 13:00:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at posteo.de Received: from posteo.de ([10.125.125.178]) by localhost (amavis1.posteo.de [10.125.125.165]) (amavisd-new, port 10026) with ESMTP id Q8f5xuU1MH_h for ; Sun, 11 May 2014 13:00:28 +0200 (CEST) Received: from mail.posteo.de (localhost [127.0.0.1]) by mail.posteo.de (Postfix) with ESMTPSA id E40C12C00ED for ; Sun, 11 May 2014 13:00:27 +0200 (CEST) Message-ID: <536F5847.6060004@posteo.eu> Date: Sun, 11 May 2014 13:00:23 +0200 From: J Kalbhenn User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: bug-guile@gnu.org Subject: unexpected bytevector contents with get-bytevector-n Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 11 May 2014 12:50:22 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) concerning the following code example -- (import (rnrs io ports) (ice-9 pretty-print)) (define (problem-part port) (pretty-print (get-bytevector-n port 4096))) (let loop ((count 100)) (if (> count 0) (begin (call-with-input-string "22222222222222222222" problem-part) (loop (- count 1))))) __ when i run it i get output with portions like this -- #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 16 224 240 0 0 0 0 0 50 50 50 50) #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) -- and i would expect the bytevector to always be the same. this first occurred to me in a more complicated scenario where: - the input port is a file-port - pretty-print was used at first and then display instead, but the problem persisted with a much lower frequency system info guile 2.0.11 linux 3.14.2-1-ARCH x86_64 From debbugs-submit-bounces@debbugs.gnu.org Wed May 28 11:24:46 2014 Received: (at control) by debbugs.gnu.org; 28 May 2014 15:24:46 +0000 Received: from localhost ([127.0.0.1]:34679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wpfib-0002On-Qx for submit@debbugs.gnu.org; Wed, 28 May 2014 11:24:46 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:48347) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WpfiV-0002OY-Ir for control@debbugs.gnu.org; Wed, 28 May 2014 11:24:40 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id D69742B39 for ; Wed, 28 May 2014 17:24:34 +0200 (CEST) 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 b8DoO3q+gNsQ for ; Wed, 28 May 2014 17:24:34 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 868ED27EE for ; Wed, 28 May 2014 17:24:34 +0200 (CEST) Date: Wed, 28 May 2014 17:24:33 +0200 Message-Id: <87d2eydiz2.fsf@gnu.org> To: control@debbugs.gnu.org From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: control message for bug #17466 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) merge 17466 17591 From debbugs-submit-bounces@debbugs.gnu.org Wed May 28 11:27:00 2014 Received: (at 17466) by debbugs.gnu.org; 28 May 2014 15:27:00 +0000 Received: from localhost ([127.0.0.1]:34684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wpfkl-0002Sm-Uw for submit@debbugs.gnu.org; Wed, 28 May 2014 11:26:59 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:48353) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wpfkf-0002SV-Ii for 17466@debbugs.gnu.org; Wed, 28 May 2014 11:26:53 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 04BAA2B39; Wed, 28 May 2014 17:26:49 +0200 (CEST) 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 1MK8Gkgt9EmP; Wed, 28 May 2014 17:26:48 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id A22F627EE; Wed, 28 May 2014 17:26:48 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: J Kalbhenn Subject: Re: bug#17466: unexpected bytevector contents with get-bytevector-n References: <536F5847.6060004@posteo.eu> Date: Wed, 28 May 2014 17:26:47 +0200 In-Reply-To: <536F5847.6060004@posteo.eu> (J. Kalbhenn's message of "Sun, 11 May 2014 13:00:23 +0200") Message-ID: <877g55exfs.fsf@gnu.org> User-Agent: Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 17466 Cc: 17466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hello, J Kalbhenn skribis: > (import (rnrs io ports) (ice-9 pretty-print)) > (define (problem-part port) (pretty-print (get-bytevector-n port 4096))) > > (let loop ((count 100)) > (if (> count 0) > (begin (call-with-input-string "22222222222222222222" problem-part) > (loop (- count 1))))) > __ > > when i run it i get output with portions like this > -- > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 16 224 240 0 0 0 0 0 50 50 50 50) > #vu8(50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50) > -- > > and i would expect the bytevector to always be the same. Indeed. I=E2=80=99ve been experiencing that in a more complex scenario too: . The guts of the problem seems to be GC_REALLOC. I=E2=80=99m debugging it n= ow and your reduced test case will be helpful. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed May 28 13:32:37 2014 Received: (at 17466-done) by debbugs.gnu.org; 28 May 2014 17:32:37 +0000 Received: from localhost ([127.0.0.1]:34780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WphiK-0000jx-OH for submit@debbugs.gnu.org; Wed, 28 May 2014 13:32:37 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:48597) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WphiE-0000jd-2L for 17466-done@debbugs.gnu.org; Wed, 28 May 2014 13:32:31 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 992572B3C; Wed, 28 May 2014 19:32:23 +0200 (CEST) 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 KZ6AK6iL90KA; Wed, 28 May 2014 19:32:23 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 3677C27EE; Wed, 28 May 2014 19:32:23 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: J Kalbhenn Subject: Re: bug#17466: unexpected bytevector contents with get-bytevector-n References: <536F5847.6060004@posteo.eu> <877g55exfs.fsf@gnu.org> Date: Wed, 28 May 2014 19:32:22 +0200 In-Reply-To: <877g55exfs.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 28 May 2014 17:26:47 +0200") Message-ID: <87y4xldd21.fsf@gnu.org> User-Agent: Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 17466-done Cc: 17466-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) This is fixed by commit 1baa215, which will be in Guile 2.0.12. It turns out that when shrinking a bytevector, as happens before =E2=80=98get-bytevector-n=E2=80=99 returns, the pointer to the bytevector= =E2=80=99s contents would not be left pointing to the old bytevector. When that old bytevector was eventually reclaimed, anything could happen. Thanks! Ludo=E2=80=99. From unknown Sat Aug 09 15:50:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 26 Jun 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator