Copy-paste a part with mm rests on another part/mm rests leads to corruption/crash

• Jun 10, 2019 - 01:46
Reported version
3.1
Type
Functional
Frequency
Many
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
Yes
Project

This is in conjunction to Musescore not playing percussion parts properly.


Comments

That didn't cause a crash for me and it seems we're both using version 3.1. It's unlikely that a Mac will crash and not Windows, but perhaps a Mac user could try it. Everyone else who has responded use either windows or linux.

See, I am not able to add the sax part onto the score because it does not show up afterwards, even after I saved it the previous time before it quitted

Title Musescore quitting unexpectedly Crash when saving a part previously pasted from another part containing a complete mm rest
Reproducibility Randomly Always
Severity S3 - Major S2 - Critical
Type Performance Functional
Reported version 3.0 3.1

Ok, got it. Worths just to precise a bit, but right now, basically, the program shuts down when saving a part if this part has received previously the pasting of another empty part (so, with a complete mm rest)
Reproducible from scratch.
New provisional title, probably improvable.

From scratch (other possible scenarios I guess)

1) SATB template + create parts (test file: test satb.mscz )
2) Toggle in Alto part -> Copy this part (ie all range selection)
3) Paste in first Soprano part
4) Remains in this soprano part
5) Save as -> Save

------> crash

Note also:
By disabing mm rest at step #4 (ie in the pasted soprano part): no crash at step #5.
But, you note the corruption at the end of the part:

soprano corruption.jpg

Title Crash when saving a part previously pasted from another part containing a complete mm rest Copy-paste a part with mm rest on another part and mm rest leads to corruption and crash

New title. Basically, mm rests don't appreciate to be copy-paste into the parts.
This leads to crash when saving the destination part, which has become a corrupt part: corruption which appears when disabling the mm rest in the destination part.

Title Copy-paste a part with mm rest on another part and mm rest leads to corruption and crash Copy-paste a part with mm rest on another part/mm rest leads to corruption/crash

In reply to by cadiz1

Ok, so say one instrument's part is exactly the same as the other...maybe an octave higher or such...then would I need to paste it in bar by bar without pasting in the mm rests and then put the mm rests in manually while doing so?

No, not bar by bar. Pay attention only to disable mm rests in the first instrument's part, before copy-paste in another instrument's part

(apparently, it's ok if the destination part contains mm rests, but maybe more precautious to disable here too mm rests. Need a bit more checking)
Said in another way: copy-past a part to another part if both contain mm rests must be avoid. If at least the first one (the "copy") doesn't contain mm rests, seems ok.

The score from the initial post doesn't crash in current master
Your score crashes after step 5 (I missed those), with an assertion failure, so indeed a different problem:

Fatal: ASSERT: "first()" in file ...\libmscore\measure.cpp, line 1921 (C...\libmscore\measure.cpp:1921, )

Famous last words before that:
Debug: PasteStaff: element TimeSig not handled (...\libmscore\paste.cpp:417, bool Ms::Score::pasteStaff(Ms::XmlReader&, Ms::Segment*, int, Ms::Fraction))

Title Copy-paste a part with mm rest on another part/mm rest leads to corruption/crash Copy-paste a part with mm rests on another part/mm rests leads to corruption/crash
Workaround No Yes

Workaround: delete and re-create parts.
But, preferably, beforehand: disable the mm rests at least of the copied part.

The problem seems to occur at the copy end as opposed to the paste end, we are failing to include the last segment in the last measure of the mmrest if it's the last measure of the score, and that's the rest, so we end up copying an empty last measure.

Problem seems to stem from an incomplete solution here: https://github.com/musescore/MuseScore/commit/3a0655682d337aaf883578bfe…, to fix #141496: Copy-paste multimeasure rests containing a full measure, or not after cuting, causes corruption/crash. So even though it seems we are seeing lots of reports of this only recently, it's actually been a problem for some quite some time.

It only occurs if the underlying measures have not been laid out yet (because the part was generated, or score was loaded, and then mmrests were never turned off), because if the measure is laid out, then it has a barline, so we only skip that during the copy, and that's harmless.

Fix should be to improve how we know when to stop copying segments in the case of an mmrest at the end of the score. I should be able to have a PR tomorrow.

Fix version
3.2.3