From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#15370: weirdness w/ uniform-vector-read! compat Date: Sun, 20 Oct 2013 13:18:54 -0400 Message-ID: <87mwm3g8sh.fsf@netris.org> References: <874n9obu1n.fsf@zigzag.favinet> <87r4bg1fo1.fsf@Kagami.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1382289674 22684 80.91.229.3 (20 Oct 2013 17:21:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2013 17:21:14 +0000 (UTC) Cc: Thien-Thi Nguyen , 15370@debbugs.gnu.org To: Ian Price Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Oct 20 19:21:17 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VXwgm-0003Io-Ml for guile-bugs@m.gmane.org; Sun, 20 Oct 2013 19:21:16 +0200 Original-Received: from localhost ([::1]:36987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXwgm-0004NZ-9s for guile-bugs@m.gmane.org; Sun, 20 Oct 2013 13:21:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXwgd-0004NH-UW for bug-guile@gnu.org; Sun, 20 Oct 2013 13:21:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXwgY-0004VM-QR for bug-guile@gnu.org; Sun, 20 Oct 2013 13:21:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXwgY-0004VI-Mx for bug-guile@gnu.org; Sun, 20 Oct 2013 13:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VXwgY-0007It-EV for bug-guile@gnu.org; Sun, 20 Oct 2013 13:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 20 Oct 2013 17:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15370 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 15370-submit@debbugs.gnu.org id=B15370.138228960328001 (code B ref 15370); Sun, 20 Oct 2013 17:21:02 +0000 Original-Received: (at 15370) by debbugs.gnu.org; 20 Oct 2013 17:20:03 +0000 Original-Received: from localhost ([127.0.0.1]:59341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXwfZ-0007HK-NZ for submit@debbugs.gnu.org; Sun, 20 Oct 2013 13:20:02 -0400 Original-Received: from world.peace.net ([96.39.62.75]:47289 ident=hope6) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXwfX-0007H5-Is for 15370@debbugs.gnu.org; Sun, 20 Oct 2013 13:20:00 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1VXwfQ-0004Rb-KE; Sun, 20 Oct 2013 13:19:52 -0400 In-Reply-To: <87r4bg1fo1.fsf@Kagami.home> (Ian Price's message of "Sun, 20 Oct 2013 09:59:26 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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:7312 Archived-At: Hi Ian, Ian Price writes: > Thien-Thi Nguyen writes: > >> ERROR: In procedure uniform-vector-read!: >> ERROR: In procedure get-bytevector-n!: Value out of range: 4 >> >> FWIW, Guile 1.8.8 produces same output as =E2=80=98ok=E2=80=99 on a simi= lar (sans the >> =E2=80=98use-modules=E2=80=99 and =E2=80=98uniform-vector-element-size= =E2=80=99 noise) input, so i think >> this situation is a regression. Am i missing something? > > You'll notice that if you supply the parameters directly > e.g. (uniform-vector-read! uve port 0 1), it succeeds. That's enough to > pin it down to the lines > > c_end =3D SCM_UNBNDP (end) ? SCM_BYTEVECTOR_LENGTH (uvec) : scm_to_size= _t (end); > c_end *=3D c_width; > > in scm_uniform_vector_read_x in libguile/deprecated.c=20 > > Bytevector length returns the number of bytes, but end specifies the > index. We should only be multiplying the latter, not the former. Simple > fix is to fold the multiplication into the else branch of the > conditional. Indeed! > Since this procedure is marked deprecated, I'd like to know how long it > has left before I patch it. Little point fixing it if it's soon... It will certainly not be removed in the 2.0.x release series, which will remain in use for at least another year or so. Therefore, this should definitely be fixed. Would you like to do it? In any case, thanks for investigating! Mark