From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Chestnykh Newsgroups: gmane.lisp.guile.bugs Subject: bug#10070: bytevector-copy! overlapping behavior is not specified Date: Thu, 17 Nov 2011 23:40:03 +0100 Message-ID: <20111117234003.dd546e04c6613c318e452f83@codingrobots.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1321576442 643 80.91.229.12 (18 Nov 2011 00:34:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 Nov 2011 00:34:02 +0000 (UTC) To: 10070@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Nov 18 01:33:58 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RRCOz-0006BI-Rs for guile-bugs@m.gmane.org; Fri, 18 Nov 2011 01:33:58 +0100 Original-Received: from localhost ([::1]:40180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRCOz-0002Qa-7A for guile-bugs@m.gmane.org; Thu, 17 Nov 2011 19:33:57 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRArO-0004cf-Tp for bug-guile@gnu.org; Thu, 17 Nov 2011 17:55:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRArN-0002VQ-LM for bug-guile@gnu.org; Thu, 17 Nov 2011 17:55:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRArN-0002VM-Cm for bug-guile@gnu.org; Thu, 17 Nov 2011 17:55:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RRAsE-0008P1-3d for bug-guile@gnu.org; Thu, 17 Nov 2011 17:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Chestnykh Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 17 Nov 2011 22:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10070 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.132157054132265 (code B ref -1); Thu, 17 Nov 2011 22:56:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Nov 2011 22:55:41 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRArs-0008OL-Et for submit@debbugs.gnu.org; Thu, 17 Nov 2011 17:55:41 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRAdl-0007Ln-Ku for submit@debbugs.gnu.org; Thu, 17 Nov 2011 17:41:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRAct-0000IZ-CP for submit@debbugs.gnu.org; Thu, 17 Nov 2011 17:40:12 -0500 Original-Received: from lists.gnu.org ([140.186.70.17]:43107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRAct-0000IU-Af for submit@debbugs.gnu.org; Thu, 17 Nov 2011 17:40:11 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:34247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRAcr-0002Ly-Rz for bug-guile@gnu.org; Thu, 17 Nov 2011 17:40:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRAcq-0000Hk-AJ for bug-guile@gnu.org; Thu, 17 Nov 2011 17:40:09 -0500 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:55698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRAcq-0000H6-5b for bug-guile@gnu.org; Thu, 17 Nov 2011 17:40:08 -0500 Original-Received: by bke17 with SMTP id 17so3207404bke.0 for ; Thu, 17 Nov 2011 14:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=a91wfPM38nAyP4Ks7/ewQtQxStAfuzt39Ps96x4gQvQ=; b=L/ONXMSUxj+15lQnd+CnRj8A+Rcvi/4ErZbeIMSf0lLUy+XJ8x0iF9EODie781dqbr 0H91uCB8F+vyAgDfWWnU27Ft9K5aVot0IqmsTOYRSxGx43xE6bOCQxbH9+8nCOe8PuDe 54HpIIDsExeulRj83n6s5XBk8qeV8AgHS2whg= Original-Received: by 10.205.122.17 with SMTP id ge17mr450258bkc.109.1321569606854; Thu, 17 Nov 2011 14:40:06 -0800 (PST) Original-Received: from xubuntu ([46.161.101.5]) by mx.google.com with ESMTPS id j4sm3419976fae.3.2011.11.17.14.40.05 (version=SSLv3 cipher=OTHER); Thu, 17 Nov 2011 14:40:05 -0800 (PST) X-Mailer: Sylpheed 3.2.0beta3 (GTK+ 2.24.6; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Thu, 17 Nov 2011 17:55:39 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 17 Nov 2011 17:56:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Thu, 17 Nov 2011 19:33:55 -0500 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5926 Archived-At: Hello, Documentation for bytevector-copy! doesn't specify whether source and target may overlap (or the order of copying), it only says: "Copy len bytes from source into target, starting reading from source-start (a positive index within source) and start writing at target-start." R6RS specifies this: "This must work even if the memory regions for the source and the target overlap, i.e., the bytes at the target location after the copy must be equal to the bytes at the source location before the copy." Looking at the code in bytevectors.c I see that the function uses memcpy() instead of memmove(). Am I correct that in the current Guile implementation, bytevectors must not overlap, that is, the effect of (bytevector-copy! source i1 source i2 len) depends on the implementation of memcpy() in libc, and may behave differently on different platforms? Proposal: 1. Specify behavior of bytevector-copy! in the documentation. 2. If the current implementation is not correct, fix this ;-) Thank you! -- Dmitry Chestnykh http://www.codingrobots.org