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.1k stars 2.62k forks source link

Freeze/crash when editing soundfont folder text box #18973

Open ThePython10110 opened 1 year ago

ThePython10110 commented 1 year ago

Issue type

Crash or freeze

Bug description

When typing C:/ or C:\ into the soundfont folder text box, MuseScore freezes, and not even Task Manager can kill it until it crashes itself several minutes later. You can type a path without the drive letter (for example Users\Username\Documents), then add C:\ to the beginning, and everything will work fine. It seems to only freeze when it thinks that C:/ or C:\ is the soundfont folder it's supposed to search.

If I can remember correctly, this has been happening since 4.0.0. I thought I reported it, but I apparently didn't.

For some reason, as I was testing this error today, (and getting 100% consistent freezing and crashing every time), the freezes suddenly went from several minutes to around 30 seconds, and it stopped crashing. Maybe this isn't as much of a bug as I thought it was... I don't know. Typing in all the folder text boxes is normally weirdly laggy anyway, maybe it's some kind of check that it does every time a character is typed, and for some reason checking "C:\" takes way longer?

Steps to reproduce

  1. Open the preferences menu.
  2. Go to General->Folders
  3. Type C:/ or C:\ into the Soundfont box (or add ";C:\" to what's already there).

Screenshots/Screen recordings

No response

MuseScore Version

MuseScore version (64-bit): 4.1.1-232071203, revision: github-musescore-musescore-e4d1ddf

Regression

No.

Operating system

Windows 10

Additional context

This is the only relevant part of the log file.

2023-08-08T13:22:21.861 | ERROR | main_thread | SoundFontRepository | loadSoundFontPaths: [401] The file does not exist
2023-08-08T13:22:22.404 | ERROR | main_thread | ipc        | writeToSocket: failed write to socket, err: "Unknown error" 
2023-08-08T13:22:22.469 | ERROR | main_thread | SoundFontRepository | loadSoundFontPaths: [401] The file does not exist
2023-08-08T13:22:23.012 | ERROR | main_thread | ipc        | writeToSocket: failed write to socket, err: "Unknown error" 
2023-08-08T13:22:30.896 | ERROR | main_thread | ipc        | writeToSocket: failed write to socket, err: "Unknown error" 
2023-08-08T13:30:20.108 | ERROR | main_thread | SoundFontRepository | loadSoundFontPaths: [401] The file does not exist
2023-08-08T13:30:20.659 | ERROR | main_thread | ipc        | writeToSocket: failed write to socket, err: "Unknown error" 
2023-08-08T13:30:21.219 | ERROR | main_thread | ipc        | writeToSocket: failed write to socket, err: "Unknown error" 
2023-08-08T13:31:00.162 | ERROR | main_thread | ipc        | writeToSocket: failed write to socket, err: "Unknown error" 
2023-08-08T13:31:33.389 | ERROR | main_thread | SoundFontRepository | loadSoundFontPaths: [401] The file does not exist
2023-08-08T13:31:33.935 | ERROR | main_thread | ipc        | writeToSocket: failed write to socket, err: "Unknown error" 
2023-08-08T13:31:34.968 | ERROR | main_thread | ipc        | writeToSocket: failed write to socket, err: "Unknown error" 
2023-08-08T13:32:11.566 | ERROR | main_thread | ipc        | writeToSocket: failed write to socket, err: "Unknown error" 
mrelhussein commented 1 year ago

I am trying to solve this issue, can you tell me in which files you have the problem ? Thank you!

cbjeukendrup commented 1 year ago

@mrelhussein The code for the Folders preferences page is in src/appshell/qml/Preferences/FoldersPreferencesPage.qml and src/appshell/view/preferences/folderspreferencesmodel.cpp/.h, is that what you mean?

However, it looks like the problem is in FilePicker.qml, which notifies that the path has been edited after each character the user types. Probably the text field is using something like onTextChanged instead of onTextEditingFinished.

zacjansheski commented 1 year ago

Am I correct in understanding this is a Windows 10 specific issue? I haven't reproduced on Windows 11

ThePython10110 commented 1 year ago

I just realized... this may have something to do with the fact that I downloaded a pack of 1200 soundfonts that I never use. I somehow never thought about that. And it's probably why @zacjansheski didn't notice it.

Edit: I deleted the soundfonts, and it still happens, so never mind.