CRASH if try changing duration of Repeat Measure

• Oct 12, 2016 - 09:37
Reported version
3.0
Type
Functional
Severity
S2 - Critical
Status
closed
Project

affects both 2.0.3 and 3.0.0 676b0a3.

Reproduction Steps:
1. Drag Repeat Measure to any measure
2. Click on augmentation dot

CRASH!!!

When reproducing my own branch in windows 10 Home from qtcreator, I get a SIGFPE (Arithmetic exception), but I can't copy and paste the stack trace because the bug crashed QtCreator as well! Fortunately, I grabbed a screenshot:

Screenshot (71).png

One possible easy fix would be to disable augmentation dot for repeat measure. It might even be a good idea to prohibit setting repeat measure to the other durations as well, since repeat measure currently doesn't understand anything other than a measure duration. However, maybe eventually we want to allow #127396: Simile Marks inside measure to indicate repeat previous beat (playback & display) & MusicXML i/o for "beat-repeat" & "slash" in which case might want to allow changing repeat measure duration (and maybe even change the name from "RepeatMeasure" to "SimileMark".)


Comments

Also I can crash by selecting the repeat measure element and pressing '8' to change duration to longa, which will fail this assert:

Fatal: ASSERT: "e == 0 || e->type() == Element::Type::CHORD" in file C:\Users\Eric\Documents\GitHub\MuseScore\libmscore\element.h, line 778 (:0, )

When getting #21649: [MusicXML] Repeat measure sign not exported or imported working, I was using a simple int in RepeatMeasure to represent the number of measures that it covers. Now that I'm starting to implement #10220: Add a two measure repeat sign, I'm exploring whether to store the duration of the measure repeat as the inherited Rest's duration. I'm going to treat the duration type as V_MEASURE...anyway I don't know if representing multi-measure durations as type V_MEASURE is an abuse of that type or not. But anyway, if I go that route, I might be able to fix the longa & double-longa part of this crash, by simply treating them as V_MEASUREs of durations that are multiple of a measure (based on the time signature of the starting measure of the multi-measure repeat). Anyway, I might also disable the use of augmentation dots for RepeatMeasures as well.

Title CRASH if add augmentation dot to Repeat Measure or set duration to longa CRASH if add augmentation dot to Repeat Measure or set duration to double or longa

argh...gave up on #3 ...was causing my tests to fail, so I'm going back to using a simple int instead of trying to use the Fractional duration to represent the number of measures covered, so disregard #3.

Again, simplest solution is just prohibit changing duration of RepeatMeasure elements, although I was hoping to somehow incorporate that into multi-meas repeats or simile marks.

Title CRASH if add augmentation dot to Repeat Measure or set duration to double or longa CRASH if try changing duration of Repeat Measure

Note that pressing Q or W on a repeat measure element will also cause this same crash.

In my PR for #10220: Add a two measure repeat sign, I'm going to have Q & W be the only supported ways to change the duration of repeat measure element, and I will forbid changing duration any other manner (since doesn't make logical sense for an entity that can only be a pos int number of measures.