GNU bug report logs - #15370
weirdness w/ uniform-vector-read! compat

Previous Next

Package: guile;

Reported by: Thien-Thi Nguyen <ttn <at> gnu.org>

Date: Fri, 13 Sep 2013 15:57:03 UTC

Severity: normal

Done: Ian Price <ianprice90 <at> googlemail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mark H Weaver <mhw <at> netris.org>
To: Ian Price <ianprice90 <at> googlemail.com>
Cc: Thien-Thi Nguyen <ttn <at> gnu.org>, 15370 <at> debbugs.gnu.org
Subject: bug#15370: weirdness w/ uniform-vector-read! compat
Date: Sun, 20 Oct 2013 13:18:54 -0400
Hi Ian,

Ian Price <ianprice90 <at> googlemail.com> writes:

> Thien-Thi Nguyen <ttn <at> gnu.org> 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 ‘ok’ on a similar (sans the
>> ‘use-modules’ and ‘uniform-vector-element-size’ 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 = SCM_UNBNDP (end) ? SCM_BYTEVECTOR_LENGTH (uvec) : scm_to_size_t (end);
>   c_end *= c_width;
>
> in scm_uniform_vector_read_x in libguile/deprecated.c 
>
> 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




This bug report was last modified 11 years and 309 days ago.

Previous Next


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