Changing key signature with the Change Instruments function and transposing instruments lead to a crash under certain circumstances
Version 3.6.2 / Windows 10
First reported here: https://musescore.org/en/node/318636
I don't know what happens internally, the unique trigger (if there is one?), but I can reproduce from scratch. First of all, there are a number of necessary conditions: at least 2 instruments, with parts.
And it doesn't matter if we are in pitch concert or not.
There seems to be a mishmash with Instruments change, transposing instruments, and key signatures, except however from what I can see at the moment, if the instrument that has been changed is not transposing, for example piano or flute.
Steps (example for this test file) : flute and clarinett.mscz
- Create a score for 2 flutes, 4 measures
- Generate parts
- Make an instrument change, from the second flute, to a clarinet.
- Select the first measure (first or second flute, no matter)
- Click the key signature in A (3 sharps)
Result : crash
-
It fails also with this file (same steps #4 and 5) : 2 clari sax tenor.mscz
-
Works with this one : for step #5, choose key signature eg in D (2 sharps, or other, except so 3 sharps, same as concert pitch) : Clarinett and flute.mscz
Comments
Stack trace:
1 Ms::KeySig::showCourtesy keysig.h 66 0x10360dc
2 Ms::Score::updateInstrumentChangeTranspositions edit.cpp 3957 0x9768aa
3 Ms::Score::undoChangeKeySig edit.cpp 3909 0x97630a
4 Ms::Measure::drop measure.cpp 1537 0xa0b1aa
5 Ms::applyDrop palette.cpp 484 0x6c1977
6 Ms::Palette::applyPaletteElement palette.cpp 740 0x6c32f8
7 Ms::UserPaletteController::applyPaletteElement paletteworkspace.cpp 579 0x505ba7
8 Ms::AbstractPaletteController::qt_static_metacall moc_paletteworkspace.cpp 287 0x5f1042
9 Ms::AbstractPaletteController::qt_metacall moc_paletteworkspace.cpp 339 0x5f122e
10 Ms::UserPaletteController::qt_metacall moc_paletteworkspace.cpp 432 0x5f13bf
11 QQmlObjectOrGadget::metacall(QMetaObject::Call, int, void * *) const 0x66255e90
12 CallMethod(QQmlObjectOrGadget const&, int, int, int, int *, QV4::ExecutionEngine *, QV4::CallData *, QMetaObject::Call) 0x661a0674
13 CallPrecise(QQmlObjectOrGadget const&, QQmlPropertyData const&, QV4::ExecutionEngine *, QV4::CallData *, QMetaObject::Call) 0x661a17a4
14 QV4::QObjectMethod::callInternal(QV4::Value const *, QV4::Value const *, int) const 0x661a2564
15 QV4::Moth::VME::interpret(QV4::CppStackFrame *, QV4::ExecutionEngine *, const char *) 0x661b3e78
16 QV4::Moth::VME::exec(QV4::CppStackFrame *, QV4::ExecutionEngine *) 0x661b6dff
17 QV4::Function::call(QV4::Value const *, QV4::Value const *, int, QV4::ExecutionContext const *) 0x66158fae
18 QQmlJavaScriptExpression::evaluate(QV4::CallData *, bool *) 0x6626cc9c
19 QQmlBoundSignalExpression::evaluate(void * *) 0x6622a851
20 QQmlBoundSignal_callback(QQmlNotifierEndpoint *, void * *) 0x6622bd7b
...
undo(new ChangeKeySig(keySig, e, keySig->showCourtesy()));
herekeySig
is 0, sokeySig->showCourtesy()
dereferences a nullprtSeams an easy fix:
See https://github.com/musescore/MuseScore/pull/7719 (3.x)
and https://github.com/musescore/MuseScore/pull/7720 (master)
Fixed in branch master, commit 231cd02016
Fix #318646: Crash when changing key signature on staff with Instruments change and transposing instruments
Fixed in branch 3.x, commit 06df428746
Fix #318646: Crash when changing key signature on staff with Instruments change and transposing instruments
Automatically closed -- issue fixed for 2 weeks with no activity.
Came up again in #319485: 3.6.2 Crash when I enter a key/instrument change ...