RFR: 8319598: SMFParser misinterprets interrupted running status

Jan Trukenmüller duke at openjdk.org
Wed Nov 8 08:16:58 UTC 2023


On Tue, 7 Nov 2023 19:18:28 GMT, Jan Trukenmüller <duke at openjdk.org> wrote:

> The MIDI file parser misinterprets events without status byte when they appear directly after a Meta of SysEx event.
> 
> For my bugfix I had to decide between two possible solutions:
> - Strict solution: Throw an InvalidMidiDataException
> - Tolerant solution: Use the status of the last channel event as running status
> 
> I used the tolerant solution.
> I will send an email to the list client-libs-dev with my reasons.

I should not have written my reasons as an Email but directly as a Comment in Github.
Now the statistics part is nearly unreadable.
So only this part again but correctly formatted:

**Summary:**

- 1.1% of all MIDI files fail to be loaded by SMFParser (for ANY reason)
- 0.43% of all MIDI files contain interrupted running status (maybe some more that have a different problem before the first IRS occurs)
- From the files with IRS
  - before the bugfix:
    - 15.67% can be parsed without exception (but with incorrectly interpreted data)
    - 69.9% fail with InvalidMidiDataException
    - 14.42% fail with EOFException
  - after the bugfix:
    - 94.2% can be parsed without exception
    - 5.4% fail with InvalidMidiDataException
    - 0.4% fail with EOFException
- The bugfix fixes exceptions for:
  - 78.5% of files with interrupted running status
  - 30.25% of ALL failing MIDI files in general !!!!!
- The bugfix doesn't change anything to any MIDI file without interrupted running status

**Details:**

Statistics from (only) the 721 files with interrupted running status:
- before the fix:
  - all: 721
  - success: 113
  - InvalidMidiDataException: 504
  - EOFException: 104
- after the fix:
  - all: 721
  - success: 679
  - InvalidMidiDataException: 39
  - EOFException: 3

Statistics from ALL files before and after the fix:
- before the fix:
  - all: 169457
  - success: 167586
  - fail: 1871
    - InvalidMidiDataException: 1606
    - EOFException: 265
- after the fix:
  - all: 169457
  - success: 168152
  - fail: 1305
    - InvalidMidiDataException: 1141
    - EOFException: 164

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16546#issuecomment-1801289515


More information about the client-libs-dev mailing list