3 ms·
Well for the interrupted() case the typical Android app never gets a close signal, it's just kill -9'd. So it's very plausible that simple no Google app ever no
by kllrnohj 9y ago
Well for the interrupted() case the typical Android app never gets a close signal, it's just kill -9'd. So it's very plausible that simple no Google app ever noticed because thread.interrupt() is pretty unusual, and if nobody uses it nobody finds the edge cases.
The Android standard lib these days is OpenJDK-based, but bugs still happen there, too. Even the best of standard libs still have bugs.
- DSMan195276 9y agoReminds me of this bug: https://android-review.googlesource.com/c/platform/bootable/bootloader/legacy/+/14699/1/libc/memset.c https://android-review.googlesource.com/c/platform/bootable/... Basically, when Android's libc was written they wrote `memset` wrong, such that it ignores the input parameter and always writes zeros. Nobody caught it for a while because, well, who calls `memset` with a non-zero value? There was HN thread about it (8 years ago apparently, I feel old...): https://news.ycombinator.com/item?id=1378912 https://news.ycombinator.com/item?id=1378912 The link itself is dead, but I managed to find the link to the code I posted above after a bit of searching.
- kuschku 9y agoThere are more funny bugs like that. For example, the result of "ab".split("") differs by android version. OpenJDK returns ["a", "b"], but older versions return ["", "a", "b"] and some even return ["", "a", "b", ""]. All this is strictly specified in the documentation and Java language specs, but no one ever bothered to fix it.
- kllrnohj 9y agoThat's not Android's libc, that's bootloader code. Android's libc is bionic and its ARM memset is here: https://android.googlesource.com/platform/bionic/+/master/libc/arch-arm/generic/bionic/memset.S https://android.googlesource.com/platform/bionic/+/master/li...
- DSMan195276 9y agoYou would be right, I guess I remembered wrong and didn't look close enough.