Appending measures makes saving crash if corrupt part
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
duplicate
Regression
No
Workaround
Yes
Project
Steps to reproduce the issue:
- Open the attached file
- Add at least two measures
- Save the document
Resulting behavior
- Program crash
- Saved file is corrupted (some tags missing in the end for .mscx, empty file for .mscz)
Workaround
Insert measures instead of adding them, and shifts the notes left
Notes
- Adding one measure, saving, closing, re-opening, and only then add the second measure will also trigger the crash when saving
- Adding notes before saving does not seem to do anything
Reproduced on
- Musescore 3.0.1 on Windows 10 x64
- Musescore 3.1 on Windows 10 x64
- Musescore 3.1 on Arch Linux x64
- d62a933231aad6dcae02d93cd9d3f83335a225a3 on Arch Linux x64
File created on
- Musescore 3.0.1 on Windows 10 x64
(I have some previous versions of the file but all of them seems to trigger the crash)
Aknowledged issues
The following issues don't seem to be related, as reproducing the aforementioned steps one the files provided does not crash MuseScore (at least in 3.1).
- #281001: Program crashes with Add > Measures > Insert one measure.
- [#286081]
- #107001: Adding measures can crash musescore
Backtrace
#0 0x0000555555f9d2f0 in Ms::Segment::next1() const ()
#1 0x0000555555f4324a in Ms::Measure::write(Ms::XmlWriter&, int, bool, bool) const ()
#2 0x0000555556046ac8 in Ms::Score::writeMovement(Ms::XmlWriter&, bool) ()
#3 0x0000555556046c68 in Ms::Score::writeMovement(Ms::XmlWriter&, bool) ()
#4 0x00005555560471ad in Ms::Score::write(Ms::XmlWriter&, bool) ()
#5 0x000055555604729b in Ms::Score::saveFile(QIODevice*, bool, bool) ()
#6 0x000055555604745b in Ms::Score::saveFile(QFileInfo&) ()
#7 0x0000555555c58fb0 in Ms::MuseScore::saveAs(Ms::Score*, bool, QString const&, QString const&) ()
#8 0x0000555555c50f29 in Ms::MuseScore::saveAs(Ms::Score*, bool) ()
#9 0x0000555555a9fcb9 in Ms::MuseScore::cmd(QAction*, QString const&) ()
#10 0x0000555555aa134e in Ms::MuseScore::cmd(QAction*) ()
...
From d62a933231aad6dcae02d93cd9d3f83335a225a3. I can provide a core file if needed.
Attachment | Size |
---|---|
WMGW-guitar-bass.mscz | 22.64 KB |
Comments
Doesn't crash for me, using latest master code, OS: Windows 7 SP 1 (6.1), Arch.: x86_64, MuseScore version (32-bit): 3.1.0., revision: 3543170
Oh, it is not "Insert measures" but "Append measures" that causses the crash on save.
There is a failed assertion (in a DEBUG build):
Fatal: ASSERT: "first()" in file ...\libmscore\measure.cpp, line 1919 (...\libmscore\measure.cpp:1919, )
2 lines earlier than the call to
next1()
Another workaround (and possible debug hint): remove the linked part, append measures, generate the part again
In my understanding, the fact of adding two measures is only a revealer here. The problem does not come from adding them. But, basically, because the part is corrupt. Save it, and look (and that's why the issue is fixed by removing and then recreating the part). guitar-bass.mscz
So it is likely to be related to this issue - very serious - that has not been resolved to date. Or even simply a duplicate of #290096: Remove select range in a score with parts results in corruption
Ie, what was called "timewise delete" is not synced in the parts.
The corruption is the same (look at the very end of the part) by adding measures to one of the test files attached to the bug report: test2 result corrupt.mscz
Strange (and bad) that there is no corruption warning.
Another one probably too which can be related: #285386: Crash when deleting a horizontal frame if corrupt part
As far as I can remember, and I no longer know if this was still the case, corruption warning occurs when the corruption appears in the main score, but not in the parts.
If it is related to timewise delete, then it got to be a duplicate of #290096: Remove select range in a score with parts results in corruption
Reopen if you disagree