The PHP strtod() denial of service bug
blog.andreas.org
The PHP strtod() denial of service bug
1–10 of 19 posts
Re: The PHP strtod() denial of service bug
#2But the point remains that relying on any specific floating point semantics (in C, or any other language) is dangerous.
The potentially infinite loop in strtod was a bug, no matter how you spin it to blame the compiler. Iterative algorithms that must finish in limited time must always have a max # of iterations...
Re: The PHP strtod() denial of service bug
#3I see Miguel finally caved!
Re: The PHP strtod() denial of service bug
#4The author might have something of a point in his rant that it is not exactly intuitive. When you specify 'double' you also expect computations to be done in 64 bit fp precision, so disabling the 80 bit fp flag or using SSE fp by default would have been a sane choice. But the point remains that relying on any specific floating point semantics (in C, or any other language) is dangerous. The potentially infinite loop i…
Re: The PHP strtod() denial of service bug
#5The author might have something of a point in his rant that it is not exactly intuitive. When you specify 'double' you also expect computations to be done in 64 bit fp precision, so disabling the 80 bit fp flag or using SSE fp by default would have been a sane choice. But the point remains that relying on any specific floating point semantics (in C, or any other language) is dangerous. The potentially infinite loop i…
It does not seem all that unreasonable to assume (in library code for dealing with 64-bit floating point numbers) that your 64-bit floating point numbers are actually 64-bit floating point numbers.
Re: The PHP strtod() denial of service bug
#6Re: The PHP strtod() denial of service bug
#7Re: The PHP strtod() denial of service bug
#8While there may be millions of servers running PHP, I doubt millions of users (PHP programmers) were the ones upgrading them. I'd be shocked, if _most_ PHP programmers have ever installed PHP themselves.
Re: The PHP strtod() denial of service bug
#9Re: The PHP strtod() denial of service bug
#10I like how the author rants that the existence of this bug as totally unacceptable then suggests instead using clang compiler "for those who [...] can tolerate a few bugs"
Even though I may encounter more bugs in the latter situation, I feel less pain when I encounter them. And I have the satisfaction that I'm somehow making the world a better place.