Crash when pasting measures if number > to the last mm rest
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project
The program crashes when attempting to paste full measures onto empty measures, where the number of empty measures is less than the number of full measures (ex. Pasting 7 full measures onto 5 empty measures). This occurs when the empty measures are the last measures of the piece, so the piece length is shorter than the duration being pasted. I have been able to reproduce this consistently.
I am running macOS Mojave 10.14.2 Beta.
Info From MuseScore About:
OS: macOS 10.14, Arch.: x86_64, MuseScore version (64-bit): 3.0.0.19499, revision: 0526317
Comments
With the current revision, I can reproduce if MM rests are enabled.
I cannot if MM rests are disabled.
Is it the issue you encounter?
See:
MuseScore/libmscore/utils.cpp:Ms::Score::tick2measureMM: tick2measureMM 11520 (max 5760) not found
Fails in line 418 of past.cpp which is two lines later the reason for the crash.
The easy 'fix' is to add a
&& endM &&
which does actually work but then checkMeasure isn't called and we better do.The problem is, that dstM does already have _next a nullptr which is confusing at this point because with the 'fix' the measure is there and the database not corrupted. I'll dig further tomorrow. So far my PR is here: https://github.com/musescore/MuseScore/pull/4312
After some more thoughts, the use of the nextMeasureMM and tick2measureMM is obsolete and we should use the functions without MM here, because the MM is still present while copying here and will be removed at a later point.
Frequency is not about Reproducibility (which is Always, of course), but about the Frequency of reporting (ie = Visibility).
And so, it was the first report of this specific issue. More details: https://musescore.org/en/node/277397
I agree it may be confusing.
@fbrauchle that seems to be similar to a reason why I moved selection from there to happen after layout: see PR 4133 (and 4214 for the latter fix). Though this may be not necessary to apply for checking measures: there seem to be no evident reasons to check MM rests for gaps presence.
Fixed in branch master, commit 0addbe288d
fix #279386 Crash when pasting measures if number > to last mm rest
Fixed in branch master, commit 2fdca06631
Merge pull request #4312 from Rockettwo/fix289386_CopyOverMM
fix #279386 Crash when pasting measures if number > to last mm rest
Automatically closed -- issue fixed for 2 weeks with no activity.