Red Hat Bugzilla – Bug 9873
String.getBytes() garbles long strings, devours memory
Last modified: 2014-03-16 22:12:53 EDT
String.getBytes() has some weird bug where, if the string is over 1024
characters (or perhaps it's if the output is over 1024 bytes), it
garbles the output, makes it longer than it's supposed to be, and, for
strings over about 2048 characters, consumes vast amounts of CPU and
memory. This has previously been reported to the Kaffe developers,
but they weren't able to replicate it.
The URL above has more details, a fix, and a link to the Kaffe bug-tracking
system where I also reported the bug.
I'm marking Severity as "high" because it does cause crashes. Converting
an 1800-character string to bytes maxed out my memory (it took up something
over 32M) and choked my system to a crawl until it ran out of memory and
Fixed in kaffe-1.0.5-4. Thanks for the patch!