Crash on open MusicXML file lacking time signature

• Apr 9, 2019 - 21:37
Reported version
P1 - High
S2 - Critical
PR created

1) Try to Open the attached file (open command)

2) Crash will happen immediately

The XML file seems to be well-formed. It was one among several I produced using an application called PlayScore. This is the only one that failed. So it may contain some element that provokes an exception from which the program does not recover gradually.

I retried regeneting the XML file from the application and repeating the action.. but it always leads to crash.


In reply to by Grynde

The file is indeed legal MusicXML, but it has no time signature, which MuseScore apparently does not handle well.

Fixed file attached.

Error messages on console:
mscore/importmxmllogger.cpp:Ms::log: Error at line 18 col 14: no instrument found for part 'P1'
libmscore/measure.cpp:Ms::Measure::computeTicks: =====minTick 0 measure 0x7ff122fcf1a0
libmscore/measure.cpp:unknown: ASSERT: "minTick > Fraction(0,1)" in file libmscore/measure.cpp, line 3244

Stack trace (on a reasonably up-to-date branch):
3 org.qt-project.QtCore 0x00000001153fb749 qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&) + 9
4 org.qt-project.QtCore 0x00000001153fd0c0 QMessageLogger::fatal(char const*, ...) const + 224
5 org.qt-project.QtCore 0x00000001153f8248 qt_assert(char const*, char const*, int) + 72
6 org.musescore.MuseScore 0x000000010c7ba316 Ms::Measure::computeTicks() + 214 (measure.cpp:3244)
7 org.musescore.MuseScore 0x000000010c754f97 Ms::Score::getNextMeasure(Ms::LayoutContext&) + 4935 (layout.cpp:2665)
8 org.musescore.MuseScore 0x000000010c75d8fc Ms::Score::collectSystem(Ms::LayoutContext&) + 2604 (layout.cpp:3407)
9 org.musescore.MuseScore 0x000000010c76c8c8 Ms::LayoutContext::collectPage() + 1768 (layout.cpp:4078)
10 org.musescore.MuseScore 0x000000010c770456 Ms::LayoutContext::layout() + 38
11 org.musescore.MuseScore 0x000000010c770072 Ms::Score::doLayoutRange(Ms::Fraction const&, Ms::Fraction const&) + 4562 (layout.cpp:4368)
12 org.musescore.MuseScore 0x000000010c59de11 Ms::Score::update() + 929 (cmd.cpp:220)
13 org.musescore.MuseScore 0x000000010bc39fe0 Ms::readScore(Ms::MasterScore*, QString, bool) + 3376 (file.cpp:2344)
14 org.musescore.MuseScore 0x000000010bc38f65 Ms::MuseScore::readScore(QString const&) + 181 (file.cpp:346)
15 org.musescore.MuseScore 0x000000010c157015 Ms::loadScores(QStringList const&) + 2677 (musescore.cpp:3347)
16 org.musescore.MuseScore 0x000000010c154d76 main + 53350 (musescore.cpp:7609)

Indeed it also does not have a time signature (which I wouldn't call a "defect", as it is legal MusicXML), but it does not crash MuseScore. Apparently the explanation for the is not as simple as "MuseScore does not support MusicXML files without time signature". Requires further investigation.

I am wondering whether the problem may have been caused by meassure 3.... Apparently it is empty. The original document that I scanned had a repetition bar (that closes some measures later). Yesterday I used a MusicXML (that did not crash) and could see the bar was missing and an empty measure was added. I removed it and musescore took it.