openjdk/jdk · error

%s: %d->internal error: sysex message status=0x%X while send

Error message

%s: %d->internal error: sysex message status=0x%X while sending short message

What it means

macOS Java Sound MIDI output: while translating a 'short' MIDI message for CoreMIDI (MIDISend), the status byte is 0xF0 or 0xF7 — System Exclusive start/escape bytes, which cannot travel through the short-message API (they require packet-list streaming of arbitrary-length sysex data). The code prints this internal error (with file/line), marks the byte invalid, and the message is not sent.

Source

Thrown at src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiOut.c:130

        case 0x90:    // Note on
        case 0xA0:    // Aftertouch
        case 0xB0:    // Controller
        case 0xE0:    // Pitch wheel
            nData = 3;
            break;

        case 0xC0:    // Program change
        case 0xD0:    // Channel pressure
            nData = 2;
            break;

        case 0xF0: {
            // System common message
            switch (data[0]) {
                case 0xF0:
                case 0xF7:
                    // System exclusive
                    fprintf(stderr, "%s: %d->internal error: sysex message status=0x%X while sending short message\n",
                            __FILE__, __LINE__, data[0]);
                    byteIsInvalid = TRUE;
                    break;

                case 0xF1:    // MTC quarter frame message
                    //fprintf(stderr, ">>>MIDI_OUT_SendShortMessage: MTC quarter frame message....\n");
                    nData = 2;
                    break;
                case 0xF3:    // Song select
                    //fprintf(stderr, ">>>MIDI_OUT_SendShortMessage: Song select....\n");
                    nData = 2;
                    break;

                case 0xF2:    // Song position pointer
                    //fprintf(stderr, ">>>MIDI_OUT_SendShortMessage: Song position pointer....\n");
                    nData = 3;
                    break;

View on GitHub (pinned to 88dfb74bbe)

Solutions

  1. Use javax.sound.midi.SysexMessage (status 0xF0/0xF7 payloads) instead of ShortMessage for system-exclusive data — the macOS implementation will stream it correctly
  2. Validate the status byte before sending: reject/complain about 0xF0/0xF7 in the short-message path
  3. If a library you depend on sends raw sysex via ShortMessage, patch it or upgrade to a version using SysexMessage
  4. Check the printed file/line/status to confirm which message was dropped and fix the sender accordingly

Example fix

// before
ShortMessage msg = new ShortMessage();
msg.setMessage(0xF0, 0x7E, 0x7F); // invalid: sysex start via short message
receiver.send(msg, -1);

// after
SysexMessage msg = new SysexMessage(new byte[]{(byte)0xF0, 0x7E, 0x7F, (byte)0xF7}, 4);
receiver.send(msg, -1);
Defensive patterns

Strategy: type-guard

Type guard

// Guard the short-message send path against sysex status bytes:
static boolean isShortMessageStatus(int status) {
    return status >= 0x80 && status != 0xF0 && status != 0xF7; // 0xF0/0xF7 need SysexMessage
}

if (!isShortMessageStatus(msg.getStatus())) {
    throw new IllegalArgumentException("sysex status 0x" + Integer.toHexString(msg.getStatus())
        + " must be sent via SysexMessage, not ShortMessage");
}
receiver.send(msg, timeStamp);

Prevention

When it happens

Trigger: Calling ShortMessage.setMessage / Receiver.send with a ShortMessage whose status byte is 0xF0 (SysEx start) or 0xF7 (SysEx escape) on the macOS MIDI-Out implementation: e.g. setMessage(0xF0, ...) or constructing a SysexMessage-like payload through the short-message path.

Common situations: Porting MIDI code from other platforms or from javax.sound.midi SysexMessage misuse — sending sysex data as a ShortMessage; libraries that pack arbitrary bytes into ShortMessage; device discovery code probing with raw status bytes.

Related errors


AI-assisted analysis of openjdk/jdk@88dfb74bbe (2026-08-14). Data as JSON: /api/errors/0e235812a29947da. Report an issue: GitHub.