Crash on XML Import

• Dec 30, 2017 - 09:42

I'm using an Android app "Playscore", which will generate an XML file from a photo of a page of music (and play the music, but that's not my purpose). Usually, I can import the XML into Musescore - usually some corrections to be made, but the process works pretty well. Occasionally, I find an XML file that crashes Musescore. I've tried with both 2.1 and the nightlies and both crash. I'm assuming the XML file is malformed in some way, but I think Musescore should report an XML error rather than just crash. I've attached a file that causes a crash if someone is willing to try to diagnose the problem. This file won't harm your set-up, you'll just be able to restart Musescore (but don't load it alongside any unsaved edits). PlayScore_IMG_20171230_084222.xml

And here, in case it helps, is a file generated by the same process that loads into Musescore without causing a problem. PlayScore_20171226_095852.xml


Comments

In reply to by Leon Vinken

Thanks Leon,

I've found one problem that I can work round. The files that crash are missing a time signature.

I can work round it by manually inserting

4
4

after ... .

I assume the reason the time signature is missing is that PlayScore, which works on only one page at a time, doesn't see a time signature. So maybe Musescore needs to report missing time signature rather than crash, but whether it's possible then to carry on with importing the xml is less clear.

In reply to by StuartC

The actual issue is somewhat complicated. The offending file contains several duplicate clef or time signature definitions (i.e. more than one at the same time / same staff in the music). The one that causes the crash is at line 960, at the start of part three. MuseScore correctly detects the duplicate clef definition and tries to report in on the console. Unfortunately, the checking / reporting function Segment::checkElement() needs a valid time signature (which there isn't at this time) to report the error with measure and beat, so it crashes.

Obviously, MuseScore shouldn't crash, so I will implement a fix for this issue.

You may want to also report this as "incorrect MusicXML" to the PlayScore supplier.

Do you still have an unanswered question? Please log in first to post your question.