Corruption on operations involving measures with local time signature and modified actual duration

• Apr 19, 2017 - 17:54
Reported version
S3 - Major

Windows 10, GIT commit: 3c7a69d

Discovered while working on #188051: Regression: Removing the content of measures after deletion of the time signature causes corruption/crash. The original problem did not affect 2.0.3, nor did the problem described in However, I *can* get corruption for the same basic reasons in a measure whose actual duration differs from nominal *and* there is a local time signature involved:

1) new score for flute & oboe, 4/4
2) add local 3/4 signature to first measure of oboe part
3) change actual duration of measure 3 to 6/4
4) press Delete (with measure 3 still selected)

Result: corruption

But you can also get other corruptions from this combination with other operations that don't invovle deleting the content of the measure. For example, repeat steps 1-3 above, then try the following:

4) enter a dotted whole note into oboe part, measure 3

That shouldn't really be possible, the time stretch should have converted this measure into 4.5 beats. So it's already corrupt in a way. It gets worse:

5) select the dotted whole note, press 7 to change to a whole note

Now you have a the 4.5 beats I expect in measure 3, but measure 4 is corrupt.

Probably best for now to disallow this combination, as there are probably any number of other things that will go wrong that would each need to be corrected.


Actually, there is a pretty good chance that if we could make these measures have the proper rest(s) to start with, things might actually work well. And due to the way this is all implemented, that might turn out to be easier than detecting the local time signature and disallowing the operation. I'm looking into this.

Status (old) active fixed
Status active fixed
Tags View Changes

Cannot reproduce. Behavior seems correct with both scenarios.
Please, reopen if corruption is here. If so, could you please attach the gif or screenshots or mscz with corrupted score?
Tested with MuseScoreNightly-2018-03-30-2123-master-b92a6e0.dmg (MacOS)

Status (old) closed active
Status closed active

Bug definitely still exists. The key is to add a local time signature to the oboe staff only - meaning, hold Ctrl while adding it, so it affects only that staff. Here are the steps to demonstrate clearly:

1) new score, flute & oboe
2) add local time signature (hold ctrl) to measure 1, oboe staff
3) right click measure 3, either staff
4) change actual duration to 6/4

At this point, it's already possibly corrupt - the oboe staff is showing 6 beats when it should (because of the time stretch of the local time signature) be showing only 4.5. To make the corruption more apparent:

5) select measure 3, oboe staff
6) press Delete - now it shows only 3 beats, which is also wrong
7) enter a dotted half note into that measure


This code is pretty much the same between 2.x and master, so I'm apply the same fix (including the fix to my fix) and assuming all is well, PR will be forthcoming.

BTW, I can get a crash in this same scenario even with my fix applied (for both 2.x and master) if, after the change in duration that results in the oboe part having a measure of duration 4.5 beats, I try to enter a double whole note into that measure. The code trying to split that up into ties just can't deal. It works fine in a "normal" 9/8 bar, so it's something about local timesigs throwing off that calculation. I don't think this means my fix here isn't good, just that it allows use to get far enough to find additional ways of breaking local timesigs :-)

Will file issue once I understand more about cause, probably tomorrow.