List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:October 24 1999 9:38pm
Subject:Re: bug in floor(pow(2,63)) and possibly other functions on FreeBSD...
View as plain text  
In the last episode (Oct 24), sinisa@stripped said:
> Jeremy Cole writes:
>  > 
>  > mysql> select floor(pow(2,63));
>  > Floating point exceptionERROR 2013: Lost connection to MySQL server during
> query
>  > mysql>  - core dumped
>  > mysqld daemon ended
>
> Regarding core dump on FreeBSD, this seems to be purely FreeBSD
> problem.
> 
> Please search mailing list archives, there are many, many references
> on properly patching FreeBSD system libs.

3.3 should not need any system patches to run MySQL correctly.  

I'm not sure why mysql is core dumping here.  It could be due to
FreeBSD's strict settings on the floating-point exception mask (loss of
precision exception in this case probably).

The last time this came up (and it comes up every 6 months or so), the
consensus was that we would rather trap FP errors than blindly pass
them on to the user application.  *Most* applications do not check for
FP errors correctly, so it's easier to simply SIGFPE than let the error
propagate.  If a program wants to ignore NaN, divide-by-zero,
underflow, or overflow conditions, let it wrap the offending line of
code with two fpsetmask() calls; one to mask the condition, and one to
restore the previous mask.  

If you want to completely ignore floating point errors, call
fpsetmask(0) at the top of main().  Make sure to handle NaN and Inf
values after each FP operation, though.

I scanned the mailinglists and the thread that covers this issue most
completely is

http://www.freebsd.org/cgi/mid.cgi?id=199710101907.OAA09470@ style="color:#666">stripped


-- 
	Dan Nelson
	dnelson@stripped
Thread
bug in floor(pow(2,63)) and possibly other functions on FreeBSD...Jeremy Cole24 Oct
  • Re: bug in floor(pow(2,63)) and possibly other functions on FreeBSD...sinisa24 Oct
    • Re: bug in floor(pow(2,63)) and possibly other functions on FreeBSD...Dan Nelson24 Oct
      • Re: bug in floor(pow(2,63)) and possibly other functions on FreeBSD...sinisa25 Oct
      • Re: bug in floor(pow(2,63)) and possibly other functions on FreeBSD...Michael Widenius13 Nov