Crash when adding tempo marking on multimeasure rest

• Apr 16, 2019 - 20:41
Reported version
3.x-dev
Priority
P0 - Critical
Type
Development
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project
  1. First two bars with and multimeasure rest on
  2. Add text - tempo marking
  3. Program crashes and sends report
Attachment Size
Go_Down_Gamblin'.mscz 54.58 KB

Comments

Frequency Many Once
Priority P0 - Critical

Confirmed, seems to crash both in master and in stable releases since the initial 3.0.0.

At first glance, this issue looks similar to #280775: Crash if inserting rehearsal mark on a multimeasure rest. This problem was common to many text-based elements and was fixed by this patch but, for some reason, tempo markings addition is handled by a separate function MuseScore::addTempo which was untouched by that patch. Maybe applying the same approach for addTempo or merging it to cmdAddText can fix this issue.

Title Tempo marking on multimeasure rest. Crash when adding tempo marking on multimeasure rest
Severity S4 - Minor S2 - Critical

I tried this approach with addTempo (see 792633f) and it seemed to work. Then I tried adding a second Tempo Text to the same mmRest, and it crashed in the same place. And indeed the code suffers from the same problem when called from cmdAddText, which means that adding (for example) a Staff Text and an Expression Text to the same mmRest will cause a crash.

Fix version
3.1.0