Remove the time signature in the presence of another one in a score with parts leads to corruption/crash

• Oct 8, 2016 - 10:52
Reported version
S2 - Critical

Version 2.0.3, AND with 3.0 under development eg: d9dd7cf

1) "My First Score"
2) Enter some notes in the first measure
3) Add another time signature, let's say in the third measure: eg 3/8 time sig, or another, no matter.
See a test file at this step: Test file1.mscz
4) Generate parts -> New all -> Ok.
5) Select and Cut the initial time signature (4/4) in main score
6) Save the score
7) Reload. The file at this step: Test file2.mscz
8) View part
Result: corruption. You can receive rather easily a crash from here, but more simply:
9) In main score, select the whole rest measure 2 -> select eg the quarter note value/type 5 (to enter a triplet or other thing)
Result: crash
new crash.jpg

- This is exactly the final behaviour described in this thread:


Opening the file from step #7 shows in the debug output that the corruption does get detected

Debug: read206 (C:\Users\Jojo\Documents\GitHub\MuseScore\libmscore\read206.cpp:1683, Ms::Score::FileError Ms::MasterScore::read206(Ms::XmlReader&))
Debug: overfilled measure 0, 1920 > 720, track 0 (...\MuseScore\libmscore\check.cpp:386, void Ms::Measure::checkMeasure(int))
Debug: overfilled measure 720, 1920 > 720, track 0 (...\MuseScore\libmscore\check.cpp:386, void Ms::Measure::checkMeasure(int))
Debug: "Measure 1 Staff 1 incomplete. Expected: 3/8; Found: 8/8" (...\MuseScore\libmscore\check.cpp:201, bool Ms::Score::sanityCheck(const QString&))
Debug: "Measure 2 Staff 1 incomplete. Expected: 3/8; Found: 4/4" (...\MuseScore\libmscore\check.cpp:201, bool Ms::Score::sanityCheck(const QString&))

but the corresponding dialog box doesn't show. This is a separate bug, see #139026: Corruptions in (linked) parts get detected, but only reported in the debug output, not in a dialog box like for corrupt scores.

The crash at step #9 then is just the consequence of working with a corrupt score, anything can happen then. Anyway, here's the stack trace:
1 std::vector::operator[] stl_vector.h 795 0xe3074c
2 Ms::Segment::element segment.h 153 0xdfb52b
3 Ms::findLinkedVoiceElement undo.cpp 637 0x7440e6
4 Ms::Score::undoChangeChordRestLen undo.cpp 699 0x7444dd
5 Ms::Score::changeCRlen cmd.cpp 1077 0x7aa443
6 Ms::Score::changeCRlen cmd.cpp 1041 0x7aa1ac
7 Ms::Score::padToggle score.cpp 2610 0x75bcef
8 Ms::Score::cmd cmd.cpp 2393 0x7af8f2
9 Ms::ScoreView::cmd scoreview.cpp 3411 0x414c57
10 Ms::MuseScore::cmd musescore.cpp 4923 0x4a03be
11 Ms::MuseScore::cmd musescore.cpp 4477 0x49e1b4
12 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 733 0x69ce30
13 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a08942
14 Ms::ScoreTab::actionTriggered moc_scoretab.cpp 193 0x6a315f
15 Ms::ScoreTab::qt_static_metacall moc_scoretab.cpp 95 0x6a2e31
16 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a08942
17 ZN12QActionGroup7hoveredEP7QAction 0x1c2f5295
18 ?? 0x226335c8
19 ZN7QAction8activateENS_11ActionEventE 0x1c2f4248
20 ?? 0x28ce08

But the real issue is that the corruption happens in the first place, step #5/#6.

"I believe we display the errors only if the main score is corrupted."

Absolutely true.
You're going to have a new proof of that in a few minutes about another issue.