From: Andy Wingo <wingo@pobox.com>
To: "Göran Weinholt" <goran@weinholt.se>
Cc: 14917-done@debbugs.gnu.org
Subject: bug#14917: Missing range check in fxcopy-bit can give SIGABRT
Date: Tue, 21 Jun 2016 09:35:44 +0200 [thread overview]
Message-ID: <87oa6v3sfj.fsf@pobox.com> (raw)
In-Reply-To: <87y59190rq.fsf@industria.weinholt.se> ("Göran Weinholt"'s message of "Sat, 20 Jul 2013 08:57:29 +0200")
Howdy :)
Three years later, this is now fixed and will be in 2.1.4. I think
we'll cherry-pick it back to 2.0.12 too.
Cheers,
Andy
On Sat 20 Jul 2013 08:57, Göran Weinholt <goran@weinholt.se> writes:
> Hello schemers,
>
> the fxcopy-bit procedure from (rnrs) is missing some range checks. It
> can return a non-fixnum:
>
> scheme@(guile-user)> (import (rnrs))
> scheme@(guile-user)> (fxcopy-bit 0 (fixnum-width) 1)
> $1 = 9223372036854775808
>
> It can also crash the guile process, which is somewhat surprising for a
> fixnum procedure:
>
> scheme@(guile-user)> (import (rnrs))
> scheme@(guile-user)> (fxcopy-bit 0 100000000000 0)
> FATAL: memory error in realloc
> Aborted
>
> Here's an alternative error message:
>
> scheme@(guile-user)> (import (rnrs))
> scheme@(guile-user)> (fxcopy-bit 0 1000000000000 0)
> gmp: overflow in mpz type
> Aborted
>
> Other implementations of fxcopy-bit usually check that the third
> argument is 0 or 1, but I'm not sure that is required.
>
> There's also a bitwise-copy-bit procedure that is similary affected.
> Tested with Guile 2.0.9.40-824b-dirty on an amd64 system.
>
> Regards,
prev parent reply other threads:[~2016-06-21 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-20 6:57 bug#14917: Missing range check in fxcopy-bit can give SIGABRT Göran Weinholt
2016-06-21 7:35 ` Andy Wingo [this message]
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=87oa6v3sfj.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=14917-done@debbugs.gnu.org \
--cc=goran@weinholt.se \
/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).