Attached MusicXML causes crash

• Jan 6, 2013 - 16:13
S2 - Critical

The attached XML file contains many problems, but MuseScore will load it, although it's rendition is not great.
It renders it initially in page mode with one measure per line.
If I try to open "Page Settings" MuseScore crashes after a couple of seconds.
If I don't do this and switch to "Continuous View" the whole score renders, fairly correctly I think.
This XML was generated from AudiVeris (4.2). The OMR has produced a fairly accurate, although not entirely complete, image.

Attachment Size 123.26 KB


Sorry, I did that last time too :(

Fedora 16x64. MuseScore version... 2.0? Latest build from gitHub. It has some of my code in it too, but I think that shouldn't have anything to do with it.

Hi Mark,

your file does not crash my version of MuseScore (trunk of about a week ago, running on 32-bit SUSE Linux). I did notice many warnings on the console, but none that really seems serious. The validation error is caused by an (incorrect) empty bar-style element. This is ignored by MuseScore and, once again, cannot cause the crash.

The file contains many timing errors (measures containing an incorrect number of notes), but that should also not be a reason for a crash.

Finally, I don't know what causes the weird layout.

To be continued ...

That's good news Leon.

Just to be clear, loading the file doesn't cause the crash, it's trying to use the page settings item on the layout menu that causes it (which I suppose is not what my report title really says). Can you open that menu item without crashing?

Stack trace (after trying to access page settings):

#0 Element::staff (this=0x0) at /home/lvi/dev/MuseScore/libmscore/element.cpp:422
#1 0x084d7045 in Chord::stemPosBeam (this=0x0) at /home/lvi/dev/MuseScore/libmscore/chord.cpp:328
#2 0x084bf8ae in adjust (_spatium4=1.5200125984251971, slant=0, cl=...) at /home/lvi/dev/MuseScore/libmscore/beam.cpp:1192
#3 0x084c96bb in Beam::computeStemLen (this=0x1ad38528, cl=..., py1=@0x1b1115f0, beamLevels=1)
at /home/lvi/dev/MuseScore/libmscore/beam.cpp:1363
#4 0x084cc885 in Beam::layout2 (this=0x1ad38528, crl=..., frag=-1073754520) at /home/lvi/dev/MuseScore/libmscore/beam.cpp:1692
#5 0x084ccb08 in Beam::layout (this=0x1ad38528) at /home/lvi/dev/MuseScore/libmscore/beam.cpp:608
#6 0x08535620 in Score::doLayout (this=0xcd59080) at /home/lvi/dev/MuseScore/libmscore/layout.cpp:627
#7 0x085767bf in Score::clone (this=0x0) at /home/lvi/dev/MuseScore/libmscore/score.cpp:2173
#8 0x082bfd63 in PageSettings::setScore (this=0x8ec63c8, s=0x8e49bf8) at /home/lvi/dev/MuseScore/mscore/pagesettings.cpp:85
#9 0x0829c488 in MuseScore::showPageSettings (this=0x8d16160) at /home/lvi/dev/MuseScore/mscore/musescore.cpp:1526

A similar crash (and stack trace) results from reading the xml file, saving as mscx and reading the mscx file:
#0 Element::staff (this=0x0) at /home/lvi/dev/MuseScore/libmscore/element.cpp:422
#1 0x084d7045 in Chord::stemPosBeam (this=0x0) at /home/lvi/dev/MuseScore/libmscore/chord.cpp:328
#2 0x084bf8ae in adjust (_spatium4=1.5200125984251971, slant=0, cl=...) at /home/lvi/dev/MuseScore/libmscore/beam.cpp:1192
#3 0x084c96bb in Beam::computeStemLen (this=0xc7f4778, cl=..., py1=@0xc9d7890, beamLevels=1)
at /home/lvi/dev/MuseScore/libmscore/beam.cpp:1363
#4 0x084cc885 in Beam::layout2 (this=0xc7f4778, crl=..., frag=-1073747864) at /home/lvi/dev/MuseScore/libmscore/beam.cpp:1692
#5 0x084ccb08 in Beam::layout (this=0xc7f4778) at /home/lvi/dev/MuseScore/libmscore/beam.cpp:608
#6 0x08535620 in Score::doLayout (this=0x8e4c7d0) at /home/lvi/dev/MuseScore/libmscore/layout.cpp:627
#7 0x081c340b in ScoreView::setScore (this=0x8e3a970, s=0x8e4c7d0) at /home/lvi/dev/MuseScore/mscore/scoreview.cpp:925
#8 0x0837d7c0 in ScoreTab::setCurrent (this=0x8df7138, n=0) at /home/lvi/dev/MuseScore/mscore/scoretab.cpp:151
#9 0x0837d928 in ScoreTab::setCurrentIndex (this=0x8df7138, idx=0) at /home/lvi/dev/MuseScore/mscore/scoretab.cpp:316
#10 0x082a7d0a in loadScores (argv=...) at /home/lvi/dev/MuseScore/mscore/musescore.cpp:1968

It seems loading the xml file resulted in corrupting MuseScores internal data structures.

Further debugging shows it crashes when function adjust() in file libmscore/beam.cpp get passed a chordrst list conatining only one element. Don't know what causes that yet.

The attached file is XML for the same piece, but cleaned up more.
It *doesn't* crash MuseScore when opening the page settings dialog, and so may be useful.
It does still think that one or at most two or three short, measures per line is the correct display, which is very unhelpful.

Attachment Size 123.35 KB

Just found what triggers the crash: the E5 ending staff 1 in measure 107 contains two "beam begin" elements, which of course lead nowhere, as it is the final note in the measure. Apparently this is not detected by the MusicXML importer, leading to a crash in the beam layout functions later.

Note: more instances of the same problem may be present. I just managed to isolate one problem area (somewhere in measures 105 to 110) and stumbled upon the beam issue.

Cause of layout issue found too: due a bug in the MusicXML importer combined with many spurious (but legal) staff-details elements, many invisible brackets are added to each system. even though you cannot see the bracket, the layouter apparently still reserves some space for them, which adds up to a large empty space at the left side of the page.