Crash by changing language after loading a template
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Many
Severity
S1 - Blocker
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
Yes
Project
OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.0.0, revision: 0128daf
Steps:
1) Load a template, eg Grand Staff
2) Edit -> Preferences -> Language: toggle to another language -> OK
Result: crash
- Note: No crash when changing language with the default "Untitled" score.
Comments
Workaround: Changing language by using the default score.
Confirmed. Questionable whether this is a regression (2.x didn't crash, but also didn't allow changing translations on the fly, it required a restart for the change to take effect, which master does not)
I don't get any (meaningfull) stack trace, just a SIGSEV
Crash apparently happens in Qt5Widgets.dll at or just before mscore/musescore.cpp, line 6578
The issue is very strange. In fact, it is not related to language: you can change any other preference or change actually nothing and just press OK right after opening the preferences screen and the application will crash. This is not related also to templates: you can open a new file dialog, cancel it without creating anything, open and confirm preferences and MuseScore will still crash.
The reason of the crash is somewhere in the interaction of
NewWizard
andQApplication::setStyle
. If I remove all pages fromNewWizard
(by disabling allsetPage
calls innewwizard.cpp
) the crash does not happen. If I moveQApplication::setStyle
away fromMuseScore::updateUiStyleAndTheme
and call it only once in themain()
function the crash does not happen. Still disabling setting those css sheets which are pointed at by the crash backtrace does not help in preventing the crash. I wasn't able to locate the actual reason of the crash so far.Anyway there are at least two options to fix this issue:
1) Create
NewWizard
each time when it is needed instead of storing a pointer to its instance insideMuseScore
. This just removes that wizard from the scene when the crash usually happens but this also requires MuseScore to do all the work on the dialog creation from scratch each time. Or we can try not to setMuseScore
as its parent though I am not sure styles will work correctly in that case.2) Move
QApplication::setStyle
call away fromMuseScore::updateUiStyleAndTheme
and call it only once in themain()
function. This works but it is not clear why it works so the actual problem can still persist. If we don't discover the real reason of the crash for some time we can apply this as a temporary fix.So I don't know exactly what happens here but I hope my observations will help someone who will be debugging this or at least myself in the nearest future.
If it can help, I observe the change (crash) with this nightly on October 29: 9fb4549
The previous one works: 78fbab1
Other observation: I note another issue is located exactly at the same moment. Don't know if it can be related or not.
This one: #277747: Choosing "Avancé" workspace in Startup Wizard crashes the program when reloading
And: https://musescore.org/en/node/277747#comment-865997
Thank you cadiz1, that is indeed a useful information! It seems these issues appeared after merging of the workspaces-related pull request after which you observed these issues. It seems that fixing and partial reverting of some of the changes in that pull request helps to fix the issue. I created a pull request on it, see https://github.com/musescore/MuseScore/pull/4114
Fixed in branch master, commit 62d05e1243
fix #277697: Remove some redundant operations on updating styles and icons
Automatically closed -- issue fixed for 2 weeks with no activity.