Re: [Full-disclosure] Firefox 2.0.0.7 has a very serious calculation bug



Thanks.

On 9/29/07, Michal Zalewski <lcamtuf@xxxxxxxx> wrote:
On Sat, 29 Sep 2007, Jimby Sharp wrote:

I don't get the same from C-style double arithmetics. Could you provide
a sample code that you believe should show the same behavior?

If you don't, it's presumably because the subtraction is optimized out by
the compiler, or because you printf() with an insufficient precision in
format spec. The following should do the trick:

volatile double a = 5.2;
volatile double b = 0.1;
main() { printf("%.16lf\n",a-b); }

/mz


_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/



Relevant Pages

  • Re: [Full-disclosure] Firefox 2.0.0.7 has a very serious calculation bug
    ... it's presumably because the subtraction is optimized out by ... the compiler, or because you printfwith an insufficient precision in ... volatile double a = 5.2; ... "Quid quid Latine dictum sit, ...
    (Full-Disclosure)
  • Re: [Full-disclosure] Firefox 2.0.0.7 has a very serious calculation bug
    ... a sample code that you believe should show the same behavior? ... the compiler, or because you printfwith an insufficient precision in ... volatile double a = 5.2; ... "Quid quid Latine dictum sit, ...
    (Full-Disclosure)
  • Re: [Full-disclosure] Firefox 2.0.0.7 has a very serious calculation bug
    ... On Sat, 29 Sep 2007, Jimby Sharp wrote: ... a sample code that you believe should show the same behavior? ... it's presumably because the subtraction is optimized out by ... volatile double a = 5.2; ...
    (Full-Disclosure)
  • Re: Is the following code MT-Safe?
    ... the assert (which is a fundamental design error: ... and almost always leads to either major synchronization failures ... >Does _bRunning need to be tagged as volatile? ... compiler to cache values, but only during the execution of a function; ...
    (microsoft.public.vc.mfc)
  • Re: Volatile + multithreading
    ... The volatile keyword has little use in multithreaded programming. ... > field or global seems to have no impact because it seems the compiler will ... operations as "special" and suppress optimizations around them. ... > majority of the multithreading issues that could have resulted from ...
    (microsoft.public.vc.language)