8000 crash with large sysex on MacOS · Issue #165 · Boddlnagg/midir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
crash with large sysex on MacOS #165
Open
@mzero

Description

@mzero

While not documented in the coremidi crate, PacketBuffer has an intrinsic size limit based on a poorly documented and handled size limit in Apple's CoreMIDI MIDIPacketList and MIDIPacket structures. The size limit is a bit less than 65536. (Exact value isn't documented!)


MidiOutputConnection's send() takes whatever data is passed in and passes it directly to PacketBuffer. If the data is big (think 80k sysex messages) - then PacketBuffer creates a corrupted buffer, which when sent causes a hard crash.

If the semantics of send() are that it will send what ever it is handed... then it needs to break larger messages up into chunks, and send the one after another.

If the semantics of send() are that it wants to inherit the limits of PacketBuffer, then it should document, and perhaps enforce that constraint.


How did I find this? I'm sending 80k sysexs (to control a synth) from a WebMIDI app.... and in Firefox on Mac it crashes the browser completely and instantly! I don't know who to blame for the crash... but the 80k byte array gets passed:

JavaScript -> Firefox/Gekko's C++ code -> Firefox/Gekkot's Rust crate midir_impl -> Boodlnagg's Rust midir package -> coremidi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0