Crash on space in score part id
Hi
Musescore crashes (exits without message) on this musicXML file.
It seems that the space in this line is killing it.
OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.4.2.9788, revision: 148e43f
Attachment | Size |
---|---|
output.musicxml | 487 bytes |
Comments
This is the best I could get (@Jojo:opening with 1.3)
In reply to This is the best I could get… by Shoichi
Ow sorry, I thought I was filing a bug report.
I know how to fix the file, but not how to fix Musescore.
In reply to Ow sorry, I thought I was… by Wouter Robers
Well, you did, sort of, as this forum part is called "Support and bug reports", but once bugs are confirmed they should go into the issue tracker
Not much in it:
In reply to Not much in it: <?xml… by Jojo-Schmitz
That's right, but Musescore should not crash on it. It should give an error.
If you remove the space after "P18", Musescore accepts it.
If you change "P18 " to "P19" you get an error message (which is correct behaviour).
In reply to That's right, but Musescore… by Wouter Robers
Ah, very interesting, I totally missed that space (and was wondering what you were talking about)
One question though: who put that space there, what software did the export?
MuseScore 1.3 indeed imports it, but bogus.
MuseScore 2.3.2 and 3.4.2 both crash on it.
Latest development build crashes on it too.
And FWIW Capella Reader 8 doesn't read it but gives an error message
In a Debug build not really a crash, but a failed assertion (so more a suicide):
Debug: Error at line 12 col 16: cannot find part 'P18' (...\mscore\importmxmllogger.cpp:49, void Ms::log(Ms::MxmlLogger::Level, const QString&, const QXmlStreamReader*))
Fatal: ASSERT: "part" in file ...\mscore\importmxmlpass1.cpp, line 1869 (...\mscore\importmxmlpass1.cpp:1869, )
But in a non-debug build indeed a real crash, dereferencing a NULL pointer in the next line of code
Simple fix, leading to that score to get imported rather than just emmiting an error message:
I.e. trim leading and trailing whitespace.
Might well be over-simplistic and probably part id should get
trimmed()
too:See https://github.com/musescore/MuseScore/pull/5862
In reply to See https://github.com… by Jojo-Schmitz
PR got merged (so fix will be in 3.5)
Spaces in the score-part's id (such as after P18) are not allowed, but it is not completely clear to me if this implies file output.musicxml is invalid or that the parser should remove the spaces.
It is clear that error handling in the MusicXML importer is insufficient for the (corner) case where part-list and parts do not match. This should result in an error message instead of a crash. As these errors do not happen frequently, I consider fixing it a low priority.
Relates to #270643: [EPIC] MusicXML import/export issues