MuseScore 3.1 Note Input - Induced Crash

• May 29, 2019 - 03:41
Reported version
P0 - Critical
S2 - Critical

1) In measure 2's bass clef, input a whole note using keyboard input.
2) Press the left arrow. This will bring you back to (apparently) beat 4, within the whole note.
3) Without changing note length or pressing any other keys, input another note on this beat 4. MuseScore will crash immediately.

Expected behavior:
When the left arrow is pressed, the whole note should be selected on beat 1 of the measure, allowing the user to change the note using arrow keys, input a different note/ length, or otherwise edit the measure.

Actual behavior:
When the left arrow is pressed, the selection becomes the start of the latest note in that measure of the entire system; in this case, with a quarter note in the staff above, it is beat 4; if the treble staff has half notes, the selection will be beat three, etc.

Attachment Size
Crash Test.mscz 5.75 KB


Priority P0 - Critical

Confirmed, stack trace:

1 Ms::Score::putNote noteentry.cpp 401 0x836b1a
2 Ms::Score::cmdAddPitch cmd.cpp 3505 0x99e9de
3 Ms::Score::cmdAddPitch cmd.cpp 3467 0x99e692
4 Ms::Score::::operator()(void) const cmd.cpp 3609 0x99f014
5 std::_Function_handler>::_M_invoke(const std::_Any_data &) std_function.h 316 0x9a7306
6 std::function::operator()() const std_function.h 706 0xe1fc8e
7 Ms::Score::cmd cmd.cpp 3759 0x9a27ca
8 Ms::ScoreView::cmd scoreview.cpp 2347 0x44b834
9 Ms::ScoreView::cmd scoreview.cpp 1770 0x447c3d
10 Ms::MuseScore::cmd musescore.cpp 6264 0x4f7cb6
11 Ms::MuseScore::cmd musescore.cpp 5735 0x4f4f25
12 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 855 0x40a1d6
13 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68c81805
14 Ms::ScoreTab::actionTriggered moc_scoretab.cpp 225 0x41147d
15 Ms::ScoreTab::qt_static_metacall moc_scoretab.cpp 110 0x410fe3
16 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68c81805
17 ZN12QActionGroup7hoveredEP7QAction 0x61fc4ee5

Not sure whether this happend in 3.0.5 too?

And it seems that in step 2 something goes wrong already, the left arrow should lead back to the last note entered rather than to the last (quarter) beat

a very simple fix to prevent the crash is to check for cr prio to dereferencing it in if (!st->isTabStaff(cr->tick())), but that leads to a corrupt score being created, having that measure to end up with 5 beats.

OK, rather than changing that to if (cr && !st->isTabStaff(cr->tick())) making it if (!cr || !st->isTabStaff(cr->tick())) fixes crash too, but not the corruption

Frequency Once Many

using if (!cr && !st->isTabStaff(cr->tick())) prevents crah and corruption, but doesn't advance at all to next input position.

Fix version