Skip to content

Race condition in RtMidiIn::getMessage() #352

Description

@Spacechild1

If the user doesn't set a callback for RtMidiIn, MIDI messages are pushed to a ringbuffer (MidiQueue) and eventually popped in RtMidiIn::getMessage. However, MidiQueue itself is not threadsafe and there is no other kind of thread synchronization involved. This looks like a dangerous race condition to me.

AFAICT this concerns all platforms because the (unsafe) implementation of RtMidiIn::getMessage() is the same on all APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions