davidmoreno / rtpmidid

RTP MIDI (AppleMIDI) daemon for Linux
Other
186 stars 41 forks source link

mysterious seg fault #120

Closed sadguitarius closed 2 months ago

sadguitarius commented 2 months ago

I'm getting this fun new error when I enable a port in Windows RTPMIDI and it makes rtpmidid completely crash. Looks like an undefined variable must be getting passed to one of the fmt specifiers. Any ideas?

Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:533] AVAHI_ENTRY_GROUP_REGISTERING.
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:556] Announce: name="alarm" port=5004
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:556] Announce: name="Midi Through-Midi Through Port-0" port=58153
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:579] Announced 2 services
Sep 06 10:30:19 alarm rtpmidid[45869]:  [midirouter.cpp:52] Added peer 3
Sep 06 10:30:19 alarm rtpmidid[45869]:  [aseq.cpp:142] Event source if 0:1
Sep 06 10:30:19 alarm rtpmidid[45869]:  [aseq.cpp:146] New ALSA connection pisound-pisound MIDI PS-388SF7P from port 20:0 -> 128:0
Sep 06 10:30:19 alarm rtpmidid[45869]:  [local_alsa_multi_listener.cpp:61] New connection to network peer pisound-pisound MIDI PS-388SF7P, from a l>
Sep 06 10:30:19 alarm rtpmidid[45869]:  [rtpserver.cpp:52] Listening RTP MIDI connections at :::39487 / :::39488, with name: 'pisound-pisound MIDI >
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:584] Announce pisound-pisound MIDI PS-388SF7P
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:533] AVAHI_ENTRY_GROUP_REGISTERING.
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:556] Announce: name="alarm" port=5004
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:556] Announce: name="Midi Through-Midi Through Port-0" port=58153
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:556] Announce: name="pisound-pisound MIDI PS-388SF7P" port=39487
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:579] Announced 3 services
Sep 06 10:30:19 alarm rtpmidid[45869]:  [midirouter.cpp:52] Added peer 4
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:486] Entry group state: AVAHI_ENTRY_GROUP_ESTABLISHED
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:492] AVAHI_ENTRY_GROUP_ESTABLISHED Group successfully established.
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:486] Entry group state: AVAHI_ENTRY_GROUP_UNCOMMITED
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:507] AVAHI_ENTRY_GROUP_UNCOMMITED.
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:486] Entry group state: AVAHI_ENTRY_GROUP_REGISTERING
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:512] AVAHI_ENTRY_GROUP_REGISTERING
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:486] Entry group state: AVAHI_ENTRY_GROUP_UNCOMMITED
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:507] AVAHI_ENTRY_GROUP_UNCOMMITED.
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:486] Entry group state: AVAHI_ENTRY_GROUP_REGISTERING
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:512] AVAHI_ENTRY_GROUP_REGISTERING
Sep 06 10:30:19 alarm rtpmidid[45869]:  [mdns_rtpmidi.cpp:473] (Browser) CACHE_EXHAUSTED
Sep 06 10:30:19 alarm rtpmidid[45869]:  [main.cpp:108] Unhandled exception: format specifier requires numeric argument!
Sep 06 10:30:19 alarm systemd[1]: rtpmidid.service: Main process exited, code=dumped, status=11/SEGV
sadguitarius commented 2 months ago

I'm not seeing any additional messages with a debug build, probably because it's the logging itself that's causing the problem. Here's the output of make capture in case it helps

rtpmidid-5004.zip

davidmoreno commented 2 months ago

Thanks!

I just added some guardrails to the final formatting of the logging system. With the latest version it should not fail, and point to where is the problem.

Can you try and report back where is the formatting error?

Thanks!

sadguitarius commented 2 months ago

Ok that's more like it! Here's the error:

[2024-09-06T21:58:20Z] [mdns_rtpmidi.cpp:431] Error formatting "Discovered service="{}" in host={}:{} ip={} flags={:04X}" log message: format specifier requires numeric argument
[2024-09-06T21:58:20Z] [rtpmidiremotehandler.cpp:55] New peer: name=JD-990 address=10.0.0.6:5004
[2024-09-06T21:58:20Z] [local_alsa_listener.cpp:89] Added endpoint for alsawaiter: JD-990, hostname: 10.0.0.6, port: 5004
[2024-09-06T21:58:20Z] [midirouter.cpp:52] Added peer 45
davidmoreno commented 2 months ago

Can you try latest master to check if this error still happens?

sadguitarius commented 2 months ago

No errors and connection to Windows rtpMIDI is working fine! Thanks!