FreeBSD strtod() implementation bug affects Erlang R14B01 float handling
Kenji Rikitake
kenji.rikitake@REDACTED
Sun Feb 13 04:32:20 CET 2011
This is not necessarily an Erlang bug, but a notable FreeBSD-specific
issue. Forwarded from the mochiweb Google Group.
Kenji Rikitake
----- Forwarded message from Kenji Rikitake <kenji.rikitake@REDACTED> -----
Date: Sun, 13 Feb 2011 12:26:41 +0900
From: Kenji Rikitake <kenji.rikitake@REDACTED>
To: mochiweb@REDACTED
Subject: Re: [mochiweb] mochinum BigDenorm test case failure on FreeBSD 7.3-RELEASE i386 and R14B01
Reply-To: mochiweb@REDACTED
Paul Guyot has already raised this issue.
http://code.google.com/p/mochiweb/issues/detail?id=59#c0
And FreeBSD PR kern/143037 says this is fixed in FreeBSD 8.1 and later.
http://www.freebsd.org/cgi/query-pr.cgi?pr=143037&cat=kern
So this should be treated as a known bug for FreeBSD 7.x and 8.0.
Thanks for the assistance.
Regards,
Kenji Rikitake
++> Bob Ippolito <bob@REDACTED> [2011-02-13 10:33:09 +0800]:
> Date: Sun, 13 Feb 2011 10:33:33 +0800
> From: Bob Ippolito <bob@REDACTED>
> To: mochiweb@REDACTED
> Subject: Re: [mochiweb] mochinum BigDenorm test case failure on FreeBSD
> 7.3-RELEASE i386 and R14B01
> Reply-To: mochiweb@REDACTED
>
> I have heard of this before, the best I can tell is that FreeBSD (or
> Erlang on FreeBSD) is just slightly broken with regard to extreme
> floats. Erlang probably uses a libc function for list_to_float and it
> doesn't give the correct result?
>
> 1> <<2.225073858507201e-308/float>>.
> <<0,15,255,255,255,255,255,255>>
> 2> <<2.2250738585072014e-308/float>>.
> <<0,16,0,0,0,0,0,0>>
>
> Looking at the code in erts/emulator/beam/bif.c it calls
> sys_chars_to_double from erts/emulator/sys/unix/sys_float.c which ends
> up calling the libc strtod. The bug is probably there.
>
> On Sun, Feb 13, 2011 at 9:16 AM, Kenji Rikitake <kenji.rikitake@REDACTED> wrote:
> > Found the following test case failure on
> > running mochiweb tests on a FreeBSD 7.3-RELEASE i386
> > and R14B01.
> > Fload handling issues?
> >
> > module 'mochinum'
> > ?mochinum: int_ceil_test...ok
> > ?mochinum: int_pow_test...ok
> > ?mochinum: digits_test...*failed*
> > ::error:{assertEqual_failed,
> > ? ? ? ? ?[{module,mochinum},
> > ? ? ? ? ? {line,301},
> > ? ? ? ? ? {expression,"list_to_float ( digits ( BigDenorm ) )"},
> > ? ? ? ? ? {expected,2.225073858507201e-308},
> > ? ? ? ? ? {value,2.2250738585072014e-308}]}
> > ?in function mochinum:'-digits_test/0-fun-13-'/2
> > ?in call from mochinum:digits_test/0
> >
> >
> > ?mochinum: frexp_test...ok
> > ?[done in 0.012 s]
> >
> > --
> > You received this message because you are subscribed to the Google Groups "MochiWeb" group.
> > To post to this group, send email to mochiweb@REDACTED
> > To unsubscribe from this group, send email to mochiweb+unsubscribe@REDACTED
> > For more options, visit this group at http://groups.google.com/group/mochiweb?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups "MochiWeb" group.
> To post to this group, send email to mochiweb@REDACTED
> To unsubscribe from this group, send email to mochiweb+unsubscribe@REDACTED
> For more options, visit this group at http://groups.google.com/group/mochiweb?hl=en.
--
You received this message because you are subscribed to the Google Groups "MochiWeb" group.
To post to this group, send email to mochiweb@REDACTED
To unsubscribe from this group, send email to mochiweb+unsubscribe@REDACTED
For more options, visit this group at http://groups.google.com/group/mochiweb?hl=en.
----- End forwarded message -----
More information about the erlang-bugs
mailing list