<Sound Dev> [13] Review Request: 8221445 FastSysexMessage constructor crashes MIDI receiption thread

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Fri Apr 5 06:22:20 UTC 2019

Hello, Audio Guru.

Please review the fix for jdk13.

Bug: https://bugs.openjdk.java.net/browse/JDK-8221445
Fix: http://cr.openjdk.java.net/~serb/8221445/webrev.00

We can get unexpected ArrayIndexOutOfBoundsException, when we create the FastSysexMessage in this place:

Th root cause of the failure is the empty "data", which is incorrect sysex message. According to the specification in this case the InvalidMidiDataException should be thrown. And the code above which creates the FastSysexMessage is ready for this exception:

   } catch (InvalidMidiDataException e) {
     // this happens when invalid data comes over the wire. Ignore it.

Wrong exception is occurred, because in the FastSysexMessage we do not throw any exceptions, but instead we call super.setMessage() for the broken data with assumption that the parent class will throw correct exception. But unfortunately the parent class(unlike FastSysexMessage) does not have the check for the empty array.

PS: It is also interesting the in some cases we throw IndexOutOfBoundsException which is not specified in the javadoc, I'll update the spec later.

Best regards, Sergey.

More information about the sound-dev mailing list