GNU bug report logs - #45816
(ice-9 suspendable-ports):get-bytevector-some! is broken

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: d4ryus <d4ryus@HIDDEN>; dated Tue, 12 Jan 2021 15:04:01 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at 45816 <at> debbugs.gnu.org:


Received: (at 45816) by debbugs.gnu.org; 6 May 2021 10:46:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 06 06:46:50 2021
Received: from localhost ([127.0.0.1]:37332 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lebWs-0001wI-EO
	for submit <at> debbugs.gnu.org; Thu, 06 May 2021 06:46:50 -0400
Received: from mout-p-201.mailbox.org ([80.241.56.171]:47566)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <d4ryus@HIDDEN>) id 1lebWn-0001nu-3C
 for 45816 <at> debbugs.gnu.org; Thu, 06 May 2021 06:46:48 -0400
Received: from smtp2.mailbox.org (smtp2.mailbox.org
 [IPv6:2001:67c:2050:105:465:1:2:0])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4FbVct4sb3zQjwc
 for <45816 <at> debbugs.gnu.org>; Thu,  6 May 2021 12:46:38 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h=
 content-disposition:content-type:content-type:mime-version
 :message-id:subject:subject:from:from:date:date:received; s=
 mail20150812; t=1620297995; bh=ZBkPoxiRzS8Aadq/YyMGlbuaepcYH9wAE
 CoxFEmk2OY=; b=hAU4blflWeRjN9zEwBYZVU4RaqMJ4LM95UZAn75rd1/NW3cqn
 FhitwtjSJIK1hhtmSpfWqVcQI5OVYftGbDrDjJJOrSBpmY2kHTQbAEUKdNm6HGt8
 z+GcmS4NaDkSPxTM6EOEdMvU8gg+slhsnskck4hiK4cZQ0LgVZjzn1rBwvG1objg
 QLlRTdBXfiI93/W3NxcArjbSmf5DMI0MXZcOhlfGbv8AWGvZMou1Nw3GB+D4JsUX
 xpPZki7iyngFELF8Hv8R6AdEtBMj2j5d+N7Fzzcbx5xNNK68LqfoXJGc5jbE7MEs
 L8ewVEQI10tfhn5nvJsnC3rgJVsG9vhdUrEpQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org;
 s=mail20150812; t=1620297996;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=J1UtL/9PqcDK/Z0H25lTFPpzzMSK3aYqMa4cWmIHlV0=;
 b=RH5N8FVMASenz5Gnnqu8F4MIxWwFqlYhZ+oxl0a83HFqqzA2r8I09Gj+bZjAiLXTHQsmQo
 t/7TJ/oAh0E5TetrfCxYzZtsA3XfMNk6Aqyv8lNCzGCl9Q7pjd2+Q3WynGbAYnw76BdSbr
 NE/xPatp++eVUJZ3/XM2/YbyPBhWMPdeNzP1PTZKqHJXeiQ6nooFXK+lGnlorQpkKdxO1V
 S0kHvpD3JtSEAb+96x92D6KDD2+1M9o6lcN8VG90e87p+RVU4PFt1Ha0FzjuQ40puba8RB
 39KBtZdVriJBkk+1XPyoB06IBW/ABfWgSq4ylG9B51h9R393xyOrmz+1i+1LsQ==
X-Virus-Scanned: amavisd-new at heinlein-support.de
Received: from smtp2.mailbox.org ([80.241.60.241])
 by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de
 [80.241.56.123]) (amavisd-new, port 10030)
 with ESMTP id KQvMKOGZxXpL for <45816 <at> debbugs.gnu.org>;
 Thu,  6 May 2021 12:46:35 +0200 (CEST)
Date: Thu, 6 May 2021 12:46:34 +0200
From: d4ryus <d4ryus@HIDDEN>
To: 45816 <at> debbugs.gnu.org
Subject: (ice-9 suspendable-ports):get-bytevector-some! is broken
Message-ID: <YJPJCvRP+Xm+1cEB@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-MBO-SPAM-Probability: **
X-Rspamd-Score: 2.33 / 15.00 / 15.00
X-Rspamd-Queue-Id: A47C01825
X-Rspamd-UID: fb0f33
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45816
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi,

this was fixed by:

  commit f591ad28f1bcec67f17a123766f798d16bec5373
  Author: Andrew Whatson <whatson@HIDDEN>
  Date:   Fri Jan 22 20:10:10 2021 +1000

    Fix suspendable implementation of 'get-bytevector-some!'

    * module/ice-9/suspendable-ports.scm (get-bytevector-some!): Fix
      incorrect arguments to bytevector-copy!

which was released with guile 3.0.6.


- d4ryus




Information forwarded to bug-guile@HIDDEN:
bug#45816; Package guile. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Jan 2021 15:03:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 12 10:03:07 2021
Received: from localhost ([127.0.0.1]:32813 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kzLCL-0003xK-W8
	for submit <at> debbugs.gnu.org; Tue, 12 Jan 2021 10:03:07 -0500
Received: from lists.gnu.org ([209.51.188.17]:53012)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <d4ryus@HIDDEN>) id 1kzKVx-0002Wi-1g
 for submit <at> debbugs.gnu.org; Tue, 12 Jan 2021 09:19:18 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:47928)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <d4ryus@HIDDEN>)
 id 1kzKVw-0008D2-OX
 for bug-guile@HIDDEN; Tue, 12 Jan 2021 09:19:16 -0500
Received: from mout-p-202.mailbox.org ([80.241.56.172]:52872)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <d4ryus@HIDDEN>)
 id 1kzKVu-0000Ut-14
 for bug-guile@HIDDEN; Tue, 12 Jan 2021 09:19:16 -0500
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:105:465:1:1:0])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4DFXkj39CQzQlmf
 for <bug-guile@HIDDEN>; Tue, 12 Jan 2021 15:19:09 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h=
 content-disposition:content-type:content-type:mime-version
 :message-id:subject:subject:from:from:date:date:received; s=
 mail20150812; t=1610461146; bh=gadcbqjtUlPiREemwkdHTii9Q8jQapsYD
 c9yNbygmss=; b=ca8aXRo87cvNZRc+6RX9U7tuxzFYSytVzt0raCK5M0i7RP1Ee
 Y3worCW9JrtTJrOGH6Z9JrR5mEhwV4uPy6vN4aokcvKriDx2xDgGw3k2IBLY7XTL
 vWNOgNAyddDJbxmZnlo1oqqgyYUaA7RVfhKQK05DL6tgUmcWnAP5bKiKfkRYJzh1
 R0BFLR9Fsig2AYDZaSjGqC8f7uQJ8hQrcpZSyl1JpIC/02EcXxmuaDkCwPpTgtxN
 os7GWnNsQNdVWar+aQG82nT8ZCJeOnX64TY5Uc6VpGwxsTK7xghTBYlDhcDENKed
 J+vWSe3NGkJ4rcOMFOEqyIQQbHG5mYwihIPUg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org;
 s=mail20150812; t=1610461147;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=qIXpcQEAvpiUAUve2sPWr8P/hJRSBDvmLOf//zunl50=;
 b=k3MdtUl0BGjZsSrchk3y22MmGdRHclznkS1imA233gq3lrAJcSaWW8bWv7kOC0ex7QW69I
 NzGAvB0FPjIPhz+V6Aaia3SSZ3fD44bHr6Ittfnhgy7LMj10ACIA72a+Rdn4xAmMYzY2PU
 ZEQouqcoF4ib57hXKQ4mZsTnUIvet4rKAbNSFixdGep7+vS2Mw0KxPCer+LE4tqOk9hpQA
 OtrCQUKCwLw2umpG1MNOkRTZFCqotU7KHYagcxHVf77ayXvvD0TVVkmNjG+E6HHQJnQEvN
 Pzxx7CoFy5qJlZtde2sAtzIf8KzH2vBLzMRFeSWhRluqlYK7tfBsNemXU2ouyg==
X-Virus-Scanned: amavisd-new at heinlein-support.de
Received: from smtp1.mailbox.org ([80.241.60.240])
 by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de
 [80.241.56.116]) (amavisd-new, port 10030)
 with ESMTP id 2MaPmUkmpHl3 for <bug-guile@HIDDEN>;
 Tue, 12 Jan 2021 15:19:06 +0100 (CET)
Date: Tue, 12 Jan 2021 15:19:05 +0100
From: d4ryus <d4ryus@HIDDEN>
To: bug-guile@HIDDEN
Subject: (ice-9 suspendable-ports):get-bytevector-some! is broken
Message-ID: <X/2v2XvE8XuIHwAv@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="4zG0w5A58Fq5uK3u"
Content-Disposition: inline
X-MBO-SPAM-Probability: 
X-Rspamd-Score: -2.58 / 15.00 / 15.00
X-Rspamd-Queue-Id: 77C2E185F
X-Rspamd-UID: 3d7b7c
Received-SPF: pass client-ip=80.241.56.172; envelope-from=d4ryus@HIDDEN;
 helo=mout-p-202.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 12 Jan 2021 10:03:04 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


--4zG0w5A58Fq5uK3u
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

hi,

(ice-9 suspendable-ports):get-bytevector-some! calls bytevector-copy!
with transfer-size (which is a number) as third argument:

  ...
  (define (get-bytevector-some! port bv start count)
    (if (zero? count)
        0
        (call-with-values (lambda () (fill-input port 1 'binary))
          (lambda (buf cur buffered)
            (if (zero? buffered)
                (begin
                  (set-port-buffer-has-eof?! buf #f)
                  the-eof-object)
                (let ((transfer-size (min count buffered)))
                  (bytevector-copy! (port-buffer-bytevector buf) cur
                                    transfer-size start buffered)
                  (set-port-buffer-cur! buf (+ cur transfer-size))
                  transfer-size))))))
  ...

The third argument to bytevector-copy! must be the target bytevector,
from the doc:

  Scheme Procedure: bytevector-copy! source source-start target target-start len

    Copy len bytes from source into target, starting reading from
    source-start (a positive index within source) and start writing at
    target-start. It is permitted for the source and target regions to
    overlap.

I think the correct call is:

  (bytevector-copy! (port-buffer-bytevector buf) cur
                    bv start transfer-size)


A potentional fix is attached.

If you need any additional information, please let me know.


-  d4ryus

--4zG0w5A58Fq5uK3u
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="suspendable-get-bytevector-some-fix.patch"

diff --git a/module/ice-9/suspendable-ports.scm b/module/ice-9/suspendable-ports.scm
index f5f005cca..a823f1d37 100644
--- a/module/ice-9/suspendable-ports.scm
+++ b/module/ice-9/suspendable-ports.scm
@@ -338,7 +338,7 @@
                 the-eof-object)
               (let ((transfer-size (min count buffered)))
                 (bytevector-copy! (port-buffer-bytevector buf) cur
-                                  transfer-size start buffered)
+                                  bv start transfer-size)
                 (set-port-buffer-cur! buf (+ cur transfer-size))
                 transfer-size))))))


--4zG0w5A58Fq5uK3u--




Acknowledgement sent to d4ryus <d4ryus@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#45816; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 6 May 2021 11:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.