Crash on playback of score with MM rest at the end

• Aug 11, 2020 - 12:31
Reported version
3.5
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

The crash happens when the score ends in multi-measure rests. Press the shortcut to move to the the last system and it will be fine, press it again and you will get the crash. It didn't crash for me when mm rests were turned off.

In a Debug build I get:
Fatal: ASSERT: "tick <= lastMeasure()->endTick()" in file ...\MuseScore\libmscore\score.cpp, line 3811

void MasterScore::setPos(POS pos, Fraction tick)
{
if (tick < Fraction(0,1))
tick = Fraction(0,1);
Q_ASSERT(tick <= lastMeasure()->endTick());
Never check for error conditions you can't handle?
But clearly a regression, 3.4.1 does not crash there. And the above code hasn't been changed in quite a while?


Comments

Update: I can trigger the crash though when user is ON a MM rest first and then invokes the next system command when in Note-Entry. On further study I notice from a ChordRest* -> measure() -> system() call chain, the system is invalid when the measure was a MM measure, and in that case I can get the system via: measure->mmRest1()->system();

So even though JoJo's fix takes care of that use case, I think I should still update this

Personally I think it's Bogus that the code is such that measure()->system() is invalid from a MM rest position. I think that should be updated so it never returns null

Update: I think actually it's when in Note Entry and there's no active ChordRest selected which is what happens when moving to a Multi-Measure Rest measure. Maybe there's no actual ChordRest from which to get the measure and then null is returned.

Update: I notice also [next/prev measure] commands work though. I've noticed that when in Note Entry mode, while in a MMRest, there's no motion of the Note Entry cursor even though it is traversing the "measures underneath" the MMRest. If you get out of NE and then back in, then the entry cursor is updated, but if not it juts stays there until getting uot of the MMRest. That should be updated also.

Fix version
3.5.1