Talk type: Talk

Overflow in Collections.rotate

  • Talk in Russian

The implementation of the static method rotate in the java.util.Collections class had an overflow bug. This defect occurred only on arrays with a number of elements more than 2^30, i.e. on very large arrays and had been in OpenJDK for 22 years. All versions of Java 21 inclusively are subject to this bug.

As in the case with other "centenarians", this error was discovered by accident. At that time, I taught first-year students of computer science faculty at Moscow Aviation Institute. It turned out that even the Java SE implementation written by Sun Microsystems engineers does not pass the tests that I prepared to check students' laboratory works! This talk is about the thorny path from detection of the bug to committing to master.

Speakers

Invited experts

Schedule