Opening a score createted via "Save selection" of a linked staff causes a crash
Nightly c3c1b81 / Windows7
1) New score with two linked staves
2) Input some notes in two measures
3) Select eg the first measure of the top staff, or the second staff (no crash if you select both the staves)
4) File -> Save selection -> Save
5) Load the new file
Result: crash
First reported on this thread : https://musescore.org/en/node/66516
For location of this issue, see comment #2
Comments
Stack trace:
0 Ms::Staff::invisible staff.h 184 0xbcded4
1 Ms::Measure::read measure.cpp 1755 0x7bbd85
2 Ms::Score::readStaff scorefile.cpp 270 0x7fd5a8
3 Ms::Score::read scorefile.cpp 966 0x8018e0
4 Ms::Score::read1 scorefile.cpp 911 0x80156a
5 Ms::Score::loadCompressedMsc scorefile.cpp 759 0x8007de
6 Ms::Score::loadMsc scorefile.cpp 806 0x800a6b
7 Ms::readScore file.cpp 2105 0x58d321
8 Ms::MuseScore::readScore file.cpp 328 0x57e246
9 Ms::MuseScore::dropEvent musescore.cpp 1524 0x4841a5
10 ZN7QWidget5eventEP6QEvent 0x61e0bc22
11 ?? 0xc0
measure.cpp, line 1755 calls
s->lines->setVisible(!staff->invisible());
with staff being NULL
Would that get fixed, it would later crash on line 1778:
Fraction timeStretch(staff->timeStretch(tick());
for the same reason (staff being NULL)
And with that being fixed it dies with
Fatal: ASSERT failure in QList::operator[]: "index out of range", file C:/Qt/5.4/mingw491_32/include/QtCore/qlist.h, line 486 (:0, )
We may 2 fixes, one to not create such a 'broken' saved selection and another to not crash on it?
The saved selection is lacking the entire part section, it just has the staff, its measures and notes/rests. And indeed since
https://github.com/musescore/MuseScore/commit/dcb974e324653f829bda60b48…
parts are not written for a selection (or are they?)
Fixed in branch master, commit b8564ef29d
fix #66576: Opening a score createted via 'Save selection' of a linked staff causes a crash
Fixed in branch 2.0.2, commit 9fc6a20627
fix #66576: Opening a score createted via 'Save selection' of a linked staff causes a crash
We choose to extend the selection to full parts in order to avoid the creation of corrupted files.
Well, it fixed the creation of such broken score, not the crash on opening them, does it?
Shouldn't we al least add a check for a missing 'part' section to the sanity check, so we can report such a score as being corrupt?
Automatically closed -- issue fixed for 2 weeks with no activity.