public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/3747] New: mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms
@ 2006-12-18 0:57 nmiell at comcast dot net
2006-12-18 9:37 ` [Bug libc/3747] " segher at kernel dot crashing dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: nmiell at comcast dot net @ 2006-12-18 0:57 UTC (permalink / raw)
To: glibc-bugs
A simple test program which aborts immediately:
#include <stdlib.h>
#include <limits.h>
int main(void)
{
while(1) {
long x = mrand48();
if (x > 2147483648 || x < -2147483648)
abort();
}
}
--
Summary: mrand48 and it's friends return values outside of [-
2^31, 2^31] on 64-bit platforms
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: nmiell at comcast dot net
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=3747
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libc/3747] mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms
2006-12-18 0:57 [Bug libc/3747] New: mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms nmiell at comcast dot net
@ 2006-12-18 9:37 ` segher at kernel dot crashing dot org
2006-12-19 2:32 ` nmiell at comcast dot net
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: segher at kernel dot crashing dot org @ 2006-12-18 9:37 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From segher at kernel dot crashing dot org 2006-12-18 09:37 -------
Subject: Re: New: mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms
> if (x > 2147483648
Invalid testcase; this number is negative with default GCC -std flag.
Segher
--
http://sourceware.org/bugzilla/show_bug.cgi?id=3747
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libc/3747] mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms
2006-12-18 0:57 [Bug libc/3747] New: mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms nmiell at comcast dot net
2006-12-18 9:37 ` [Bug libc/3747] " segher at kernel dot crashing dot org
@ 2006-12-19 2:32 ` nmiell at comcast dot net
2006-12-19 8:18 ` drepper at redhat dot com
2007-01-12 17:52 ` cvs-commit at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: nmiell at comcast dot net @ 2006-12-19 2:32 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From nmiell at comcast dot net 2006-12-19 02:32 -------
Since you're too lazy to do the obvious:
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
while(1) {
long x = mrand48();
if (x > 2147483648L || x < -2147483648L) {
printf("long: %ld, int: %d\n", x, (int) x);
abort();
}
}
}
--
http://sourceware.org/bugzilla/show_bug.cgi?id=3747
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libc/3747] mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms
2006-12-18 0:57 [Bug libc/3747] New: mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms nmiell at comcast dot net
2006-12-18 9:37 ` [Bug libc/3747] " segher at kernel dot crashing dot org
2006-12-19 2:32 ` nmiell at comcast dot net
@ 2006-12-19 8:18 ` drepper at redhat dot com
2007-01-12 17:52 ` cvs-commit at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: drepper at redhat dot com @ 2006-12-19 8:18 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From drepper at redhat dot com 2006-12-19 08:18 -------
Fixed in cvs.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://sourceware.org/bugzilla/show_bug.cgi?id=3747
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libc/3747] mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms
2006-12-18 0:57 [Bug libc/3747] New: mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms nmiell at comcast dot net
` (2 preceding siblings ...)
2006-12-19 8:18 ` drepper at redhat dot com
@ 2007-01-12 17:52 ` cvs-commit at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2007-01-12 17:52 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2007-01-12 17:52 -------
Subject: Bug 3747
CVSROOT: /cvs/glibc
Module name: libc
Branch: glibc-2_5-branch
Changes by: jakub@sourceware.org 2007-01-12 17:52:07
Modified files:
. : ChangeLog
stdlib : Makefile jrand48_r.c tst-rand48.c
Added files:
stdlib : tst-rand48-2.c
Log message:
[BZ #3747]
* stdlib/jrand48_r.c (__jrand48_r): Make sure result is in the
[-231 .. 231) range.
* stdlib/tst-rand48.c (main): Fix expected values for 64-bit
targets.
* stdlib/tst-rand48-2.c: New test.
* stdlib/Makefile (tests): Add tst-rand48-2.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.10362.2.23&r2=1.10362.2.24
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdlib/tst-rand48-2.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=NONE&r2=1.1.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdlib/Makefile.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.109&r2=1.109.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdlib/jrand48_r.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.9&r2=1.9.10.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdlib/tst-rand48.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.1&r2=1.1.10.1
--
http://sourceware.org/bugzilla/show_bug.cgi?id=3747
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-01-12 17:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-18 0:57 [Bug libc/3747] New: mrand48 and it's friends return values outside of [-2^31, 2^31] on 64-bit platforms nmiell at comcast dot net
2006-12-18 9:37 ` [Bug libc/3747] " segher at kernel dot crashing dot org
2006-12-19 2:32 ` nmiell at comcast dot net
2006-12-19 8:18 ` drepper at redhat dot com
2007-01-12 17:52 ` cvs-commit at gcc dot gnu dot org
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).