[erlang-questions] R11B-3 shell crashes when printing float infinity

Per Hedeland per@REDACTED
Mon Apr 2 23:15:28 CEST 2007

"Bob Ippolito" <bob@REDACTED> wrote:
>On 4/2/07, Mikael Pettersson <mikpe@REDACTED> wrote:
>> On Sun, 1 Apr 2007 18:44:24 -0700, Bob Ippolito wrote:
>> > I haven't installed R11B-4 on my workstation yet, so I'm not sure if
>> > this is still applicable... but I just noticed that the R11B-3 shell
>> > crashes if you try and get it to print out float infinity.
>> >
>> > Erlang (BEAM) emulator version 5.5.3 [source] [async-threads:0]
>> > [kernel-poll:false]
>> >
>> > Eshell V5.5.3  (abort with ^G)
>> > 1> float_to_list(1.0e666666).
>> > "inf"
>> > 2> 1.0e666666.
>> > *** ERROR: Shell process terminated! (^G to start new job) ***
>> >
>> > =ERROR REPORT==== 1-Apr-2007::18:41:54 ===
>> > Error in process <0.23.0> with exit value:
>> > {function_clause,[{io_lib_format,float_data,[[],[]]},{io_lib_format,fwrite_e,5},{shell,shell_rep,4},{shell,server_loop,7}]}
>> Your system is broken. Erlang doesn't allow infinities or NaNs.
>> In a working system, the expression "1.0e666666" is supposed to
>> be rejected by the parser (and it is in my system).
>It's nothing I'm running into with production code, but I was writing
>a JSON encoder/decoder and happened to type in a float that was out of
>range and the shell exploded on me.
>> Please try R11B-4 first. If the invalid float constant still
>> is accepted, file a bug report. Useful information would be
>> which CPU, OS and C compiler you're using, and whether ./configure
>> identified "reliable floating-point exceptions" or not.
>I don't have time to compile and test with R11B-4 for at least a few
>days, but I can produce this bug with FreeBSD 6.2 x86-32 with R11B-3
>compiled from ports, and also on Mac OS X 10.4.9 x86-32 with R11B-3
>compiled without any special flags "./configure && make && sudo make

Ditto with R11B-3 on Linux FC5 2.6.17-1.2174_FC5, i686, gcc 4.1.1
20060525. From ./configure:

checking for unreliable floating point execptions... reliable

(yup, it says "execptions":-).

--Per Hedeland

More information about the erlang-questions mailing list