Crash on opening file with apparently invalid note anchored textline
I created the attached file in MuseScore v2.0.1, saved it, and then after closing the MuseScore, opening it and trying to load the file it just saved crashed the program.
Shout to the Lord (final).mscz
I have a version before it that opens just fine (although the playback is jitterring at some parts)
I also exported it into PDF and MP3 before quitting the program, and also attach the PDF here, for your reference on how it should look like.
Attachment | Size |
---|---|
Shout to the Lord (final).mscz | 92.07 KB |
Shout to the Lord (final).pdf | 249.38 KB |
Shout to the Lord v2.mscz | 55.37 KB |
Comments
Actually MuseScore 2.0.1 crashes on opening this file (oops, you even wrote so...)
It does crash in the latest development build too.
Stack trace:
0 Ms::Element::parent element.h 324 0xbcf500
1 Ms::Note::chord note.h 349 0xbcbe8f
2 Ms::SLine::linePos line.cpp 661 0x8ea210
3 Ms::SLine::layout line.cpp 708 0x8ea519
4 Ms::Score::doLayout layout.cpp 1522 0x80b08d
5 Ms::Score::update cmd.cpp 175 0x7941de
6 Ms::readScore file.cpp 2186 0x58d85f
7 Ms::MuseScore::readScore file.cpp 328 0x57e1f6
8 Ms::MuseScore::openScore file.cpp 309 0x57e0c1
9 Ms::MuseScore::loadFiles file.cpp 290 0x57de62
10 Ms::MuseScore::cmd musescore.cpp 3982 0x493381
11 Ms::MuseScore::cmd musescore.cpp 3875 0x492bf6
12 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 810 0x6a6cf6
13 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a655a2
14 ZN12QActionGroup7hoveredEP7QAction 0x61dc4b95
15 ?? 0x1e70f5d0
16 ZN7QAction8activateENS_11ActionEventE 0x61dc3b6e
17 ?? 0x28ca18
18 ?? 0x909001bc
19 ?? 0xd9ac25ff
...
It dies dereferencing a NULL pointer, seems a spanner is lacking it's endElement()?
The problem is indeed a spanner - a "note acnhored textline", specifically - for which no end element is found. The line is the "Rit." that is attached to a note at the beginning of measure 43 in the second staff.
Now, textlines added from the palette are not normally attached to notes - they are normally attached to "segments" (meaning, a specific point in time, not a specific note). However, we do have a "note anchored textline" you can create from the Add menu that is almost completely untested I fear. I'm guessing you used this; the question is, what did you do specifically to create this situation, and can it be reproduced? It seems there are actually *two* such lines here, one of which is empty. That's probably part of the key to reproducing the problem.
Meanwhile, here is a version of your score with those lines removed. This one should load correctly. You might consider adding it again as a regular text line from the Lines palette, which is apparently how you added the other ones.
I think the file itself is not valid at this point, although of course we should handle it more gracefully than crashing. But I would be especially interested in figuing out how to reproduce this so we can prevent it in the future.
Wah, thank you for the quick reply. Indeed when I saw your comment regarding NULL pointer dereferencing endElement I immediately remember that bar, because this is how I made it:
1. Create the minim A note on bar 43, and quaver A note on bar 44
2. Connect those two using Note Anchored Textline
3. Delete quaver A note on bar 44 (note that the line still exists at this point)
I created that A note on bar 44 because I wanted to create a horizontal line. Using Note Anchored Textline on A to C creates a rising line, so I tricked it by creating the same note and then deleted it. I guess it would have worked the same way if I hide the note instead of deleting. But again, I guess there should be a better way to create a Rit. line rather than using Note Anchored Textline, which is using regular Line as you mentioned.
Again, thank you for the amazing support =D
One more issue is that I can't export this file to MusicXML format (even after the fix). I think it's because of the Rit. line in the beginning. If I deleted the measure it is in (I can't delete the Rit symbol itself), it can export to XML nicely. That first Rit. Line was created by exporting from Sibelius containing a line into MusicXML then importing it in MuseScore.
What do you mean you can't export it to MusicXML? What goes wrong when you try? It worked for me when I just tried it, although it took quite a long time (over a minute, I think). Maybe you gave up too soon?
FWIW, I just realized your file contain over 4000 separate but identical/overlapping "Rit" texts in that first measure. Not sure if it came in that way from Sibelius or if it was the result of something that went wrong during import or if it resulted from a lot of copy and paste or what. But that's why it appears you cannot delete the text - you deleted only one of them. There are another 4000+ copies of that same "Rit." text in measure 2.
Can you attach the original MusicXML you imported from Sibelius, and/or share any insight into how you think you ended up with 4000+ copies of the "Rit." text?
Meanwhile, I will see if I can reproduce the problem with the note anchored textline following your instructions.
Thanks for the simple and clear steps on the note anchored textline! I was able to reproduce the original crash from scratch:
1) My First Score
2) measure 1, enter two half notes
3) select both half notes
4) add / lines / note anchored textline
5) delete second
5) save
6) reload
Result: crash
For future reference, to create a horizontal text line, just add it from the Lines palette (the last entry on the list - with the default text of "VII"). The note anchored text line is intended for something completely different, and is as I mentioned almost entirely untested.
It is not a surprise, I guess. Very former issue.
I can reproduce the crash since more a year with this Nightly, almost "famous" now! ;-) ,
on May 19, 2014: 56177c3
Fixed in branch master, commit 335c3bd36b
fix #67001: Crash on opening file with invalid note anchored textline. Also delete note line when start or end note deleted.
Fixed in branch 2.0.2, commit 894a1d4320
fix #67001: Crash on opening file with invalid note anchored textline. Also delete note line when start or end note deleted.
Sorry for the late reply, I just found a time to do this.
Regarding the "Can't export to MusicXML", the software crashes after a few seconds (not a few minutes like you said). This is also happening on my friend's computer which has 32GB RAM. So perhaps it's not memory issue. Do let me know if there is any information I can help you with.
For the issue regarding multiple Rit., I found the reason for having multiple Rit. in the score. Apparently each time I click save, the number of Rit. increases by (at least) one =O
Here is the steps:
1. Start by importing this XML: Arbab Bridge.xml
2. Save as .mscz. Closing it and opening it will result in one Rit. This is expected.
3. Modify something, and save. Closing and opening it will now result in two Rit.
4. Repeat as necessary to increase the number of Rit.
If you think this should be in separate issue, please kindly inform me, I will open a new issue page.
For reference, here is the file after a few times saving: Test.mscz
Thanks for the file and steps! I can reproduce with your MusicXML file, but not with one I create from scratch with a similar line, and offhand, looking at the MusicXML itself, I don't see the relevant difference.
Please, do file a separate issue, with this file and those steps. Include the word "MusicXML" in the title somewhere - "Duplicate lines on save in file imported from MusicXML", perhaps. By the way, I get the duplicate at step 2 - just saving the MusicXML as MSCZ and then opening the latter already created two Rit lines.
I've managed to reproduce this in a smaller file and understand a little better what is going on, even if I don't know the solution. So I have filed a new issue with the addition information - #67711: Duplicate / corrupt lines on save/reload in file imported from MusicXML.
Thanks again for your dligence in helping narrow down the problem!
I'm going to guess the crash you are seeing on export is related. If you remove all instances of the "Rit" line (eg, select the measure, right click one "Rit", Select / All similar elements in range selection, delete), and the text at the end of the previous measure ("In Bataknese, Javanese, Modern, and Moluccan Style"), does the crash go away?
Hi, thank you for the new issue, so I guess I don't need to post another issue.
Regarding your question, yes, the crash goes away with just removing all the Rit. (I don't need to remove the text at previous measure).
Automatically closed -- issue fixed for 2 weeks with no activity.