MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

[MU4 Issue] Export This score to Xml cause crash

Open Gai-Luron opened this issue 2 years ago • 3 comments

I have a score who crash when i try to export to XML. I try to remove all in this score and score continue to crash

1-Load Score provifded (Yes it's a ascore with empty measures, do the same when notes are in it ) 2-Try to make a XML export 3-Result in crash

OS: Windows 10 Version 2009, Arch.: x86_64, MuseScore version (64-bit): 4.0.1-230120506, revision: github-musescore-musescore-f23ceb1 TestParts.zip

Gai-Luron avatar Jan 12 '23 19:01 Gai-Luron

Find the reason of the crash!!!!!!

1 - Create Score image 2 - Add repeat sign in measure 3 image 3 - Select 2d Measure and type "R", This replace Repeat sign. image 4 - Try to export result in crash

If you have saved the file before crash Remove 3th Measure using "suppr" youu see that the measure is corrupted. No rest image image

Very very hard to understand and reproduce from scratch

OS: Windows 10 Version 2009, Arch.: x86_64, MuseScore version (64-bit): 4.0.1-230140506, revision: github-musescore-musescore-9b70a8c

Gai-Luron avatar Jan 14 '23 17:01 Gai-Luron

@Gai-Luron Thanks very much, that's very useful!!! So this is in fact another case of score corruption!

cbjeukendrup avatar Jan 14 '23 17:01 cbjeukendrup

I did a bit of investigation, and this seems related somewhat related to https://github.com/musescore/MuseScore/issues/15874. When pasting (or using "repeat selection"), the measure repeats in the target measure are not properly deleted, which results in this behaviour. So far, I can't really make sense of why that is happening.

relevant places in the code:

  • Here we're removing the measure repeat but it turns out to be the one in the next next measure, so one measure too far. https://github.com/musescore/MuseScore/blob/7a0bfc4b56e7cb3e747e0e751877f9460c494fd5/src/engraving/libmscore/paste.cpp#L257-L260
  • Here we're doing something very dirty with a measure repeat, somehow cloning it but to a Rest instead of a Measure Repeat. This causes a crash, see #15904. But even when that crash is fixed, it is still very dirty, and especially we are not properly removing the measure repeat (we're removing the element, but the measure itself still thinks it's a measure repeat measure). https://github.com/musescore/MuseScore/blob/7a0bfc4b56e7cb3e747e0e751877f9460c494fd5/src/engraving/libmscore/edit.cpp#L402-L408

cbjeukendrup avatar Jan 15 '23 22:01 cbjeukendrup

To add to this scenario (and it also results in a crash when exporting to XML):

Create a score and use some measure repeats: image

Now select the second measure and press 'R': image

Result is the "repeated measure" is copied without the rests and a second measure repeat is replace with a measure rest.

Export to XML now will crash MS4.

henkdegroot avatar Jan 20 '23 21:01 henkdegroot

I'm getting same crash when also trying to export the same file to midi.

bbguitar avatar Jan 23 '23 09:01 bbguitar

@Gai-Luron - Can you check again?

Is this issue still happening with 4.0.1? If not, can you check to see if it's solved in 4.0.2?

Tantacrul avatar Jan 30 '23 13:01 Tantacrul

This still happens in 4.0.1, 4.0.2 and master.

cbjeukendrup avatar Jan 30 '23 15:01 cbjeukendrup

Fixed in #16165

DmitryArefiev avatar Feb 02 '23 16:02 DmitryArefiev