Crash when multi-measure rests are enabled and press End

• Oct 24, 2019 - 05:26
Reported version
3.x-dev
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

v-3.3-RC on Windows 10 crash report sent with my name included (mike320)

Create a score
Enable multi-measure rests (I know that if the score ends with a multi-measure rest the crash occurs)
Press End

Crash!


Comments

Priority P0 - Critical

Confirm, it's as simple to reproduce as:

1) default empty score
2) press "M"
3) press "End"

Crash happens in ScoreView::pageEnd(), we grab score()->last() which is the last measurebase and then try to access its system, but the last measure has no system because it is covered by an mmrest. I'll see about a fix.

Reported version 3.2 3.x-dev

Confirmed. Not an issue with 3.2.3 but with 3.3 RC, so a regression that needs fixing before 3.3 gets released

I see 2 possible fixes for this particular crash

  1. use score()->lastMeasureMM() instead of score()->last()
  2. check for lm->system() to be not NULL before accessing lm->system()->page()->width()

Or even both.

screenNext(), screenPrev(), pageNext(), pagePrev() and pageTop() seem to not be affected by this issue (i.e. don't crash), just pageEnd(), only that accesses lm->system()

Status PR created fixed

Fixed in branch master, commit b84d499896

_fix #296034: Crash when multi-measure rests are enabled and press End

also consistenltly use lastMeasureMM() rather than last() in other
places of that file_

Fix version
3.3.3