I remember when everyone was bashing PHP (http://news.ycombinator.com/item?id=2066084) when they were bitten by the same issue. Then there were articles about this being maybe a GCC bug or at least design issue but people were still saying that it's PHP's duty to take care of this.
I was always afraid that this might bite other environments too as the code that caused the issue in PHP was apparently taken from elsewhere (see http://blog.andreas.org/display?id=9 for a detailed analysis of the problem). Now this is turning out to be true.
I just reported a problem last week and got a response inside 12 hours. I was amazed. Certainly faster than I've ever gotten a response from Sun.
Average over the last 3 issues is about 48 hours - if accepted as a bug. But if you provide source code that demonstrates the problem turnaround is usually very fast, and that seems to be the case here.
So they're not falling over themselves to fix a bug which no one has noticed for 10+ years, and which hardly anyone is going to hit in actual use. Maybe they're spending their time fixing problems which are actually affecting developers.
If I'm not mistaken, this is bad: it enables a trivial DOS attack against any web service that accepts floating-point input. (For instance, one of the commenters on the OP noted that Google Spreadsheets backends are vulnerable.) This includes, as a special case, any service that accepts JSON input.
I expect a lot of teams will have to rush out a patch. I feel for them...
Incidentally, I haven't seen a simple workaround posted anywhere. Has anyone seen a regexp or code snippet that can identify strings which would trigger this bug?
Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_22).
Type in expressions to have them evaluated.
Type :help for more information.
I assume this hits Clojure, JRuby, etc. harder because it affects all values which are converted to Strings, but only affects Java when one explicitly converts to Double?
So when a (Java) website expects an Int as input, it's not affected, but Clojure,JRuby etc would be?
So, in summary, we've made counting on computers so complex that we're still failing to get it right. Similarly to how we've made the alphabet (unicode) on computers so complex that most programs are still trying to get that right.
This seems to be a not rare occurrence around the phase boundaries of functions. I had a similar problem with the atan2 function in the PL/I - Fortran library on the CDC 6600. One of my testers was stepping across the boundary between valid and invalid arguments and there was a single binary value that blew up. I was the compiler lead so it got fixed. Any of you remember the 486 floating point problem?
Android is not i386 based and this is x87 FPU and gcc specific bug in commonly used atod() implementation, so I assume that this does not happen on Android.
Obvious question --- are there any java web services running at Oracle that take a string input from a form or a URL, and tries to convert said stirng to a floating point variable?
[+] [-] pilif|15 years ago|reply
I was always afraid that this might bite other environments too as the code that caused the issue in PHP was apparently taken from elsewhere (see http://blog.andreas.org/display?id=9 for a detailed analysis of the problem). Now this is turning out to be true.
[+] [-] SingAlong|15 years ago|reply
Java's turn to deal with the x87 register issue. Here's a hint Oracle, "volatile"
http://twitter.com/rasmus/status/32365768603602944
[+] [-] Uchikoma|15 years ago|reply
[+] [-] mjw|15 years ago|reply
This affects JRuby, and potentially anyone with a JSON-based API running on the JVM with a JSON parser using the java stdlib to parse JSON floats:
(not the most recent JRuby I know, but seems this is a JVM problem...)[+] [-] rll|15 years ago|reply
[+] [-] wladimir|15 years ago|reply
[+] [-] praptak|15 years ago|reply
This speaks volumes about Oracle as the Java's steward.
[+] [-] mavroprovato|15 years ago|reply
[+] [-] nikster|15 years ago|reply
Average over the last 3 issues is about 48 hours - if accepted as a bug. But if you provide source code that demonstrates the problem turnaround is usually very fast, and that seems to be the case here.
[+] [-] andrew1|15 years ago|reply
[+] [-] snewman|15 years ago|reply
I expect a lot of teams will have to rush out a patch. I feel for them...
Incidentally, I haven't seen a simple workaround posted anywhere. Has anyone seen a regexp or code snippet that can identify strings which would trigger this bug?
[+] [-] djacobs|15 years ago|reply
[+] [-] latch|15 years ago|reply
[+] [-] leppie|15 years ago|reply
[+] [-] lukesandberg|15 years ago|reply
[+] [-] abscondment|15 years ago|reply
user=> (def d 2.2250738585072012e-308)
[+] [-] paulitex|15 years ago|reply
Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_22). Type in expressions to have them evaluated. Type :help for more information.
scala> 2.2250738585072012e-308
(infinite loop)
[+] [-] Jach|15 years ago|reply
[+] [-] ibejoeb|15 years ago|reply
[+] [-] VMG|15 years ago|reply
[+] [-] Uchikoma|15 years ago|reply
So when a (Java) website expects an Int as input, it's not affected, but Clojure,JRuby etc would be?
Am I right, what am I missing?
(see the comment with
user=> (def d 2.2250738585072012e-308)
)
[+] [-] r0h4n|15 years ago|reply
[+] [-] speleding|15 years ago|reply
[+] [-] cygwin98|15 years ago|reply
[+] [-] joeyh|15 years ago|reply
[+] [-] russell|15 years ago|reply
[+] [-] VMG|15 years ago|reply
[+] [-] dfox|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] tytso|15 years ago|reply
[+] [-] jd0g|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] wildmXranat|15 years ago|reply