Running musescore in converter mode crashes

• Jun 5, 2018 - 08:56
Reported version
3.0
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Running musescore (latest code from master) in converter mode (using the options file.mscz -o file.png) crashes. Stack trace:

1 QString::QString qstring.h 906 0xdcc158
2 Ms::Workspace::name workspace.h 54 0xe1c1c8
3 Ms::MuseScore::preferencesChanged musescore.cpp 537 0x49654d
4 Ms::MuseScore::MuseScore musescore.cpp 1404 0x49cc87
5 main musescore.cpp 6358 0x4bf5b5

Culprit apparently is 064156c

Possible fix is to change mscore/musescore.cpp, line 537 from

      if (preferences.getString(PREF_APP_WORKSPACE) != Workspace::currentWorkspace->name()) { 

to

      if (Workspace::currentWorkspace && preferences.getString(PREF_APP_WORKSPACE) != Workspace::currentWorkspace->name()) { 

or

      if (!converterMode && preferences.getString(PREF_APP_WORKSPACE) != Workspace::currentWorkspace->name()) { 

Or not to call preferencesChanged() in mscore/musescore.cpp, line 1404, if in converterMode, after all that mode should not change any preferences at all, or should it? So change from

      preferencesChanged();

to

      if (!converterMode)
            preferencesChanged();

or

      if (!MScore::noGui)
            preferencesChanged();

All these variants fix this crash, I like the last best (all prefs set in that method seem to deal with GUI settings, and this check additionally covers plugin mode, which IMHO should crash currently too), but I'm not sure about possible unwanted side effects.

Strange that mtest or vtest didn't catch this?


Comments