musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.23k stars 2.64k forks source link

Disconnecting from M-Audio AIR 192|6 causes MuseScore to hang #20037

Open rurattee opened 11 months ago

rurattee commented 11 months ago

Issue type

Crash or freeze

Bug description

Similar to this issue.

MuseScore seems to have issues regarding closing and crashing. I've found that in multiple circumstances, the program refuses to close and remains in Task Manager as a "Suspended" process. The first instance occurred while trying to update. I clicked the update button, was told to close, closed MuseScore, and then was told to close again. I found MuseScore listed in Background processes, Suspended. The second instance was a crash related to selecting a MIDI controller. I attempted to add my MIDI controller (Studiologic SL88 Grand but I believe this may happen with any controller) and the program froze. This may be related to FL Studio being open simultaneously. Regardless, I went to Task Manager and the program was marked as Suspended again. In both cases I clicked "End Task" a few times and nothing happened. Afterwards, I went to Resource Monitor and attempted to both resume the process and kill it. Resuming the process yielded no error, but didn't actually resume it. Killing it led to an "Access is denied" system error. The first time this occurred, I rebooted my PC to not waste time, assuming it was an uncommon error. The second time, I tried a few other things. Besides seeing if Windows could kill the process by mashing the "X" button until it was recognized as unresponsive, I tried to kill the process using CMD/Powershell. The results are as follows:

PS C:\Users\OMG meee :3c> taskkill /im MuseScore4.exe /f ERROR: The process "MuseScore4.exe" with PID 3844 could not be terminated. Reason: There is no running instance of the task.

PS C:\Users\OMG meee :3c> wmic process where "name='MuseScore4.exe'" delete Deleting instance \DESKTOP\ROOT\CIMV2:Win32_Process.Handle="3844" ERROR: Code = 0x80041003 Description = Access denied Facility = WMI

I looked into a few other tools as well. ProcessExplorer gave the same "Access is denied" error. Process Hacker 2 gave a slightly different error:

Unable to terminate MuseScore4.exe (PID 3844): An attempt was made to access an exiting process.

After looking around on StackExchange, it seems that MuseScore has somehow become an unkillable process by some means. I don't really know what could be causing this, but I'm guessing it may be on the user end? I looked into the security permissions for the program and both my user and the system have full authority to terminate the process, as does another "NT AUTHORITY" "user." Even if the process has managed to make itself unkillable, I don't think I've personally done anything to cause this. I haven't used MuseScore in a while and this only happened when returning to the program after several months. I don't believe this was an issue the previous time I used the program.

Steps to reproduce

1a. Open MuseScore 2a. Attempt to update in Muse Hub 3a. Close MuseScore 4a. Check Task Manager to see if process has been suspended in background

1b. Open MuseScore 2b. Cause crash (select MIDI controller in I/O preferences while FL Studio is open? I genuinely don't know what caused the crash, but it's sort of a minor issue to me at this moment) 3b. Check Task Manager to see if process is suspended in foreground and unkillable

Screenshots/Screen recordings

image image

MuseScore Version

4.11? Whatever the latest update as of this morning is, but I can't check.

Regression

I don't know

Operating system

Windows 10 Home

Additional context

OS: Windows 10 Home 22H2 19045.3570 CPU: Intel Core i7-10700k GPU: NVIDIA RTX 2070 Super Memory: 32.0 GB

The only thing I noticed upon opening the program initially was it detecting a few Kilohearts VSTs I downloaded a couple weeks ago. Other than that, I haven't noticed anything out of the ordinary and even that doesn't really seem to present as an issue.

rurattee commented 11 months ago

For an additional update, I attempted to reconnect my MIDI controller again today and MuseScore crashed again when selecting it. FL Studio, nor any other programs that take MIDI input were open. It may be a driver/firmware issue that's causing it. Since I have to reboot my PC again, I'll retry in a few minutes and update this comment if updating my keyboard firmware fixes this particular crash.

Update/Edit: Okay, interestingly, it's not the SL88 that's causing the issue. For whatever reason, MuseScore crashes when attempting to deselect the "2- AIR 192 6" MIDI input, i.e. selecting "No device." This is an M-Audio interface that's connected only over USB. I repaired my drivers just in case that was causing the issue, which it isn't. I'm going to try to see if disconnecting it from my PC and then selecting a different MIDI device before reconnecting it mitigates this crash. However, I still don't understand why this would cause a crash. Once I've tested this, I'm also going to see if MuseScore can close on its own under normal circumstances without suspending itself indefinitely, or if reopening it while suspended doesn't spawn a new process, meaning that closing it is technically a non-issue in cases where an update isn't available.

rurattee commented 11 months ago

Follow-up on the last comment's edit, the AIR 192|6 was causing the issue. I still don't know why, but I suppose that everything is resolved with that on my end, though this could be a symptom of a larger issue? As for closing under normal circumstances, it seems that MuseScore can close and reopen normally. I don't see it listed anywhere in task manager and I've tried closing from both the starting screen and inside the score that I had open during one of the crashes. This could be the MIDI device creating issues on closure (though I've had it connected before with no issue, I've owned the interface for a few years now), but I don't know if I want to tempt fate by trying to select it as a MIDI device again. Although my issue is technically resolved, I'm not going to close this myself as the issue still exists and I've just found a workaround. There's still some bug that's causing the process to be stuck in a suspended/exiting state that could be related to having certain kinds of MIDI devices connected. Please feel free to close the issue if it's too vague or uncommon to be solved, however.

cbjeukendrup commented 11 months ago

Thanks for your investigation, that's appreciated! Seems likely that it's caused by that MIDI device... As far as I know, being "suspended" means that an app is waiting for some input resource from another process or from the user in some cases. That may mean in this case that MuseScore somehow gets blocked by the MIDI device's driver software when trying to disconnect from it. When MuseScore crashes when switching, do you mean that it hangs forever, or that it suddenly disappears from your screen?

rurattee commented 11 months ago

Thanks for the reply! When it crashes it hangs forever. The screenshot from my original post was taken about 40 minutes into my attempts to get it to close. It hung on the whited out screen until I rebooted. Unlike most other programs that crash in that manner (to my knowledge), it could freely be minimized and maximized, though I didn't try dragging the window around so I'm not sure how that would have behaved. Normally I'm used to being able to minimize frozen windows but being unable to bring them back up/maximize them. Despite all the issues with trying to get it to close, it also didn't interfere with rebooting. Let me know if you need any more info!

rurattee commented 11 months ago

Just as a small update, I've recently had this happen in the Vocaloid 6 Editor as well. As such, I believe the problem mainly lies in the device's driver code somewhere. I'm going to send in a support ticket to M-Audio linking this thread and will post another comment if anything comes of that.

mavriq-dev commented 10 months ago

I've had this happen consistently on a computer even after a hardware and software rebuild. The same thing, trying to deselect certain midi devices hang it and it runs perm in background processes. I've seen it happen with eleven rack and hammer 88. No idea why it is unkillable.

cbjeukendrup commented 9 months ago

@mavriq-dev In your case, is it specific to MuseScore or do you see the same behaviour with other apps?

mavriq-dev commented 9 months ago

Only musescore. I can reproduce it on demand. I could do a capture with procmon if you think that would be helpful and possible see what is being accessed that hangs things....

On Sun, Dec 31, 2023 at 8:13 PM Casper Jeukendrup @.***> wrote:

@mavriq-dev https://github.com/mavriq-dev In your case, is it specific to MuseScore or do you see the same behaviour with other apps?

— Reply to this email directly, view it on GitHub https://github.com/musescore/MuseScore/issues/20037#issuecomment-1873084217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJYH265CQQVHZHBAFGYVRLYMIESZAVCNFSM6AAAAAA7NJ6476VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTGA4DIMRRG4 . You are receiving this because you were mentioned.Message ID: @.***>

-- Geoff Van Brunt