Corrupt score with empty measure crashes on load

• Mar 22, 2019 - 06:42
Reported version
P1 - High
S2 - Critical
  1. Open the attached .mscz file in the application.
  2. The application crashed.

Reproduced with MuseScore 3.0.5 (Linux Mint 19.1 Tessa)

Attachment Size
ЧАША....mscz 17.6 KB


Stack trace:
1 Ms::Segment::prev segment.h 91 0xec19fc
2 Ms::Segment::prev1 segment.cpp 321 0x94ca01
3 Ms::Score::getNextMeasure layout.cpp 2679 0x8d2cd3
4 Ms::Score::collectSystem layout.cpp 3337 0x8d6f9e
5 Ms::LayoutContext::collectPage layout.cpp 4000 0x8dbaa4
6 Ms::LayoutContext::layout layout.cpp 4298 0x8dd8dc
7 Ms::Score::doLayoutRange layout.cpp 4284 0x8dd7c3
8 Ms::Score::update cmd.cpp 220 0x9f17dd
9 Ms::readScore file.cpp 2344 0x672d5b
10 Ms::MuseScore::readScore file.cpp 346 0x6601c2
11 Ms::MuseScore::openScore file.cpp 324 0x660082
12 Ms::MuseScore::loadFiles file.cpp 304 0x65fcf9
13 Ms::MuseScore::cmd musescore.cpp 5916 0x50b74a
14 Ms::MuseScore::cmd musescore.cpp 5724 0x50a752
15 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 855 0x40bb1f
16 QMetaObject::activate(QObject *, int, int, void * *) 0x68a9338a
17 QActionGroup::hovered(QAction *) 0x268b4db2
18 QActionGroup::qt_static_metacall(QObject *, QMetaObject::Call, int, void * *) 0x268b573c
19 QMetaObject::activate(QObject *, int, int, void * *) 0x68a9338a
20 QAction::activate(QAction::ActionEvent) 0x268b3e0e

Title The .mscz file crashes the application Corrupt score with empty measure crashes on load
Frequency Many Once
Priority P1 - High

The last measure of the score appears to be completely empty - no rest or anything. It comes right after a section break, so I doubt the measure is supposed to be there at all. Any idea how this came to be? Steps to reproduce from scratch?

The crash happens in layout.cpp, in the loop marked "Add pauses from the end of the previous measure", but even if we add a check for empty measure there, chances are pretty good there would be problems, including likely crashes, elsewhere. Probably we should detect the empty measure sooner and fill it.

Meanwhile, here is a fixed version of the score.

Attachment Size
crash-previous-segment.mscz 17.83 KB

So, might be related (one of the scenarios, or a duplicate) to this issue: #290546: Copy-paste a part with mm rests on another part/mm rests leads to corruption/crash


1) New score for two instruments, say Flute/Oboe (test file: flute oboe.mscz)
2) Switch in Oboe part -> Range select the mm rest, and copy-paste in the Flute part
3) Disable MM rest in this Flute part (you note the corruption)
4) Add a system break juste before (ie mesure 4) the corrupt measure
5) Always this Flute part: Save As/ Save/ Quit
6) Restart (file at this step: flute2.mscz )

--------------> Crash on load

Well, it crashes (so, this file: flute2.mscz ) in the same way here with the latest nigthly/master: OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit):, revision: f0768f1
The only difference, worse, I don't know: no longer Crash Reporter Window. The file attempts to load -> white screen -> and immediatly dies.