unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Ian Price <ianprice90@googlemail.com>
Cc: 13827@debbugs.gnu.org
Subject: bug#13827: faulty range check in bytevector accessor
Date: Tue, 26 Feb 2013 21:30:15 -0500	[thread overview]
Message-ID: <87y5eaxzd4.fsf@tines.lan> (raw)
In-Reply-To: <87liaay0o1.fsf@Kagami.home> (Ian Price's message of "Wed, 27 Feb 2013 02:02:06 +0000")

Ian Price <ianprice90@googlemail.com> writes:
> After some talk on #guile, Mark and I believe it comes down to the range
> check in INTEGER_ACCESSOR_PROLOGUE in bytevectors.c

Going a bit further: INTEGER_ACCESSOR_PROLOGUE uses 'scm_to_uint', which
I believe should fail for 2^32 on a 32-bit machine.  According to
numbers.h:430, 'scm_to_uint' should be an alias for 'scm_to_uint32',
which is defined in numbers.c:9277 and conv-uinteger.i.c:27.

It seems to me that it ought to be getting to conv-uinteger.i.c:50,
which calls 'mpz_fits_ulong_p'.  So maybe it's a bug in the version of
libgmp on Ian's machine, or perhaps I'm missing something.

I don't know whether it's possible to step through the code in
'conv-uinteger.i.c' using gdb.  If so, I'd like to see what happens.  If
not, I suspect the next step is to write some test programs in C and try
them on Ian's machine: first test 'scm_to_uint32', which should raise an
exception for 2^32.  If it doesn't then try testing 'mpz_fits_ulong_p'
directly and see if it's broken.

    Thanks,
      Mark





  reply	other threads:[~2013-02-27  2:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27  2:02 bug#13827: faulty range check in bytevector accessor Ian Price
2013-02-27  2:30 ` Mark H Weaver [this message]
2013-02-27 11:42 ` Ludovic Courtès
2013-02-28  1:38   ` Mark H Weaver
2013-02-28 20:20   ` Ian Price
2013-03-13 12:55 ` Andy Wingo
2013-03-13 14:37   ` Andy Wingo
2014-07-28 14:35 ` Ben Rocer
2016-06-20 15:16   ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y5eaxzd4.fsf@tines.lan \
    --to=mhw@netris.org \
    --cc=13827@debbugs.gnu.org \
    --cc=ianprice90@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).