MuseScore Crashes for one file

• Sep 3, 2019 - 20:46

While I have made multiple backups of this score, I recently enlarged the Instruments playing it to flesh out the orchestration, and after saving it, the file would not open again. I happened to put days of effort into that one version, and would love to have it back, as 're-creating' it will mean re-composing much of it, and I am worried that after all that double-work, the crash may happen again. Anyone know how to fix or de-bug the file?

Attachment Size
2. The_Ending_is_the_Hardest_Part_F.mscz 73.75 KB

Comments

Crash confirmed, even in latest development build, stack trace:
1 Ms::Segment::setNext segment.h 89 0xd42e07
2 Ms::SegmentList::insert segmentlist.cpp 113 0x7e08f7
3 Ms::Measure::createEndBarLines measure.cpp 3658 0x8d4f2d
4 Ms::Score::collectSystem layout.cpp 3320 0x8af78a
5 Ms::LayoutContext::collectPage layout.cpp 4198 0x8b488d
6 Ms::LayoutContext::layout layout.cpp 4508 0x8b65c9
7 Ms::Score::doLayoutRange layout.cpp 4493 0x8b64ca
8 Ms::Score::update cmd.cpp 221 0x9bcbe7
9 Ms::readScore file.cpp 2356 0x65ddfa
10 Ms::MuseScore::readScore file.cpp 349 0x64c2da
11 Ms::MuseScore::openScore file.cpp 327 0x64c1a0
12 Ms::MuseScore::loadFiles file.cpp 304 0x64be4e
13 Ms::MuseScore::cmd musescore.cpp 6098 0x508f74
14 Ms::MuseScore::cmd musescore.cpp 5906 0x50812c
15 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 861 0x40b892
16 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68c82545
17 ZN12QActionGroup7hoveredEP7QAction 0x27844ee5

I MacGyvered the code a bit and got it to read the score without crashing, saved it and now the regular version can read it without crashing too

diff --git a/libmscore/segmentlist.cpp b/libmscore/segmentlist.cpp
index 1190ec3ad..b7f2340cd 100644
--- a/libmscore/segmentlist.cpp
+++ b/libmscore/segmentlist.cpp
@@ -104,7 +104,7 @@ void SegmentList::insert(Segment* e, Segment* el)
       {
       if (el == 0)
             push_back(e);
-      else if (el == first())
+      else if (el == first() || !el->prev())
             push_front(e);
       else {
             ++_size;

And with this I'm calling it a day and go to bed ;-)

In reply to by Jojo-Schmitz

Nice work, Jojo! But as you can well imagine, this does not fix the real problem, and the fact that el->prev() is NULL even though el is not equal to first() is an indication that something is really wrong.

The real problem occurs on line 2399 of measure.cpp where it is assumed that e.tick() is going to be equal to the last tick of the measure, and therefore, since fermata is not NULL, a fermata should be added over the barline. But it turns out that e.tick() may not necessarily be equal to the last tick of the measure (in the case of deleted rests), in which case the fermata should be added to a ChordRest segment. The fix for this is easy enough.

diff --git a/libmscore/measure.cpp b/libmscore/measure.cpp
index 5b182d8be..cafb7b781 100644
--- a/libmscore/measure.cpp
+++ b/libmscore/measure.cpp
@@ -2396,7 +2396,8 @@ void Measure::readVoice(XmlReader& e, int staffIdx, bool irregular)
                   }
             }
       if (fermata) {
-            segment = getSegment(SegmentType::EndBarLine, e.tick());
+            SegmentType st = (e.tick() == endTick() ? SegmentType::EndBarLine : SegmentType::ChordRest);
+            segment = getSegment(st, e.tick());
             segment->add(fermata);
             fermata = nullptr;
             }

If this error is worthy of a brown paper bag, I am afraid that it would have to go to me.

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