List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 13 1999 12:40am
Subject:Re: bug in floor(pow(2,63)) and possibly other functions on FreeBSD...
View as plain text  
>>>>> "Dan" == Dan Nelson <dnelson@stripped> writes:

Dan> 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.

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

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

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

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

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

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

Hi!

Currently MySQL handles floating point failures by defining the
matherr() function to handle these.  Unfortunately this approach
doesn't work on FreeBSD :(

I shall look into adding fsetmask() to the MySQL, at least for pow().

Regards,
Monty
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