tofodroid / mimi-mod

Musical Instrument Minecraft Interface
MIT License
13 stars 4 forks source link

[BUG] Crash on dedicated server while playing with seek controls & stop/play buttons in Transmitter #112

Open kawaiicakes opened 8 months ago

kawaiicakes commented 8 months ago

Describe the bug Crash on dedicated server while playing with seek controls & stop/play buttons in Transmitter. I was trying to play a file from its beginning, but it would always start maybe a second or two in. After pressing stop and play a couple times, then clicking & dragging the seek bar, the server hanged and crashed.

Crash Logs crash-2024-03-01_22.07.02-server.txt

Environment Check crash log for OS details Forge 1.19.2-43.2.14 & MIMI 1.19.2-4.0.0 release

tofodroid commented 8 months ago

Hmm this is a funky one, it seems to be stemming from Java's internal MIDI APIs. I've been investigating a potential replacement for the internal APIs since they're pretty dated and have caused some other issues in the past so this might be what pushes me into doing that..

Would happen to have a link handy to the MIDI file you were using when this crash happened?

tofodroid commented 8 months ago

Hello again! I've just uploaded builds for version 4.0.1 to CurseForge and Modrinth which introduces a stopgap solution that should hopefully mitigate the full server hanging and crashing, though it would still cause MIMI transmitters to become unresponsive (it moves some additional MIDI commands to a separate thread so the server thread doesn't get blocked). But at least everything else should continue to function as normal! 😅

I haven't yet figured out the root cause of the issue itself or found way to consistently reproduce it unfortunately. At this point I'm leaning towards attempting a replacement of the Java MIDI APIs in MIMI, but will continue poking around a bit more first.

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kawaiicakes commented 6 months ago

Hmm this is a funky one, it seems to be stemming from Java's internal MIDI APIs. I've been investigating a potential replacement for the internal APIs since they're pretty dated and have caused some other issues in the past so this might be what pushes me into doing that..

Would happen to have a link handy to the MIDI file you were using when this crash happened?

Hey, sorry for the super late response. Unfortunately, I don't remember which MIDI file in particular caused the crash. I have noticed however that many MIDI files simply don't appear within the list (size limitations? corruption of MIDI file? they seem to play fine locally and sometimes are rather small) and wonder if this is at all connected to your question.

tofodroid commented 6 months ago

Hello! No worries about the timing, I absolutely can relate to that 😄, and thanks for the reply!

That's interesting that several MIDI files aren't showing up for you! MIMI doesn't have any strict limitations except that the file must end in .mid or .midi and it does some preliminary parsing of the files to make sure they're valid MIDI (at least by Java standards). If you have some time would you be able to upload one or two of the MIDI files that aren't showing up for you and send them my way? I'd like to poke around in them and see if I can figure out what about them Java doesn't like (and maybe fix it in MIMI).

Thank you!

kawaiicakes commented 6 months ago

Hello! No worries about the timing, I absolutely can relate to that 😄, and thanks for the reply!

That's interesting that several MIDI files aren't showing up for you! MIMI doesn't have any strict limitations except that the file must end in .mid or .midi and it does some preliminary parsing of the files to make sure they're valid MIDI (at least by Java standards). If you have some time would you be able to upload one or two of the MIDI files that aren't showing up for you and send them my way? I'd like to poke around in them and see if I can figure out what about them Java doesn't like (and maybe fix it in MIMI).

Thank you!

misc midi files.zip

The 1812 Overture doesn't appear when accessing it from client, but when I upload it to the server it displays fine. I'm not sure if this is the case for the remaining files. I am only certain that they do not appear on my client.