Crash if using "Fill with slashes" on mm rests

• Dec 30, 2018 - 06:03
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

OS: Windows 7 SP 1 (6.1), Arch.: x86_64, MuseScore version (64-bit): 3.0.0.4839, revision: cf1f5ce

1) Default score
2) Enter some measures including mm rests, or load the test file: mm slashes.mscz
3) Select range a mm rest - image below
4) Tools -> Fill with slashes

---> Crash

  • No issue if the selection includes a filled measure before/after the mm rest

    select.jpg


Comments

Confirming crash (qassert) by doing above procedure. Using 9/feb HEAD 88110b5.

Also crashes if non-range selecting last MMR (marked 3), and deleting it (ctrl-del).

Backtrace from first crash:

#0  0x00007fffea988f3b in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fffea98a2f1 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007fffeaec53fc in qt_message_fatal (context=..., message=...) at global/qlogging.cpp:1840
#3  QMessageLogger::fatal (this=this@entry=0x7fffffff5f70, msg=msg@entry=0x7fffeb1b1f20 "ASSERT: \"%s\" in file %s, line %d")
at global/qlogging.cpp:880
#4  0x00007fffeaec4afb in qt_assert (assertion=, file=, line=) at global/qglobal.cpp:3202
#5  0x00005555566dd262 in Ms::toRest (e=0x555559b81e50) at libmscore/scoreElement.h:441
#6  0x00005555566eee47 in Ms::Measure::computeMinWidth (this=0x555559a34710, s=0x555559c14530, x=0, isSystemHeader=false)
at libmscore/measure.cpp:3991
#7  0x00005555566ed35d in Ms::Measure::createEndBarLines (this=0x555559a34710, isLastMeasureInSystem=true)
at libmscore/measure.cpp:3534
#8  0x00005555566bc67b in Ms::Score::collectSystem (this=0x555559a197b0, lc=...)
at libmscore/layout.cpp:3246
#9  0x00005555566c3320 in Ms::Score::doLayoutRange (this=0x555559a197b0, stick=3840, etick=7200)
at libmscore/layout.cpp:4268
#10 0x0000555556828ee6 in Ms::Score::update (this=0x555559a197b0) at libmscore/cmd.cpp:220
#11 0x0000555556828baf in Ms::Score::endCmd (this=0x555559a197b0, rollback=false)
at libmscore/cmd.cpp:178
#12 0x000055555683a63d in Ms::Score::cmd (this=0x555559a197b0, a=0x5555585e6a50, ed=...)
at libmscore/cmd.cpp:3697
#13 0x0000555555e2f1fb in Ms::ScoreView::cmd (this=0x5555599d9800, s=0x555557d99878 "slash-fill")
at mscore/scoreview.cpp:2320

And backtrace from second way of crashing it:

#0  0x00005555566e00fa in Ms::Measure::findSegment (this=0x0, st=Ms::SegmentType::ChordRest, t=61440)
at libmscore/measure.cpp:734
#1  0x000055555664702f in Ms::Score::localTimeDelete (this=0x5555599c2110)
at libmscore/edit.cpp:2972
#2  0x0000555556834e8d in Ms::Score::cmdTimeDelete (this=0x5555599c2110)
at libmscore/cmd.cpp:3055
#3  0x0000555556837f3d in Ms::Score::::operator()(void) const (__closure=0x555559b39258)
at libmscore/cmd.cpp:3675
#4  0x000055555684970f in std::_Function_handler >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/6/functional:1731
#5  0x0000555556654282 in std::function::operator()() const (this=0x555559b39258) at /usr/include/c++/6/functional:2127
#6  0x000055555683a691 in Ms::Score::cmd (this=0x5555599c2110, a=0x5555585ee7b0, ed=...)
at libmscore/cmd.cpp:3696
#7  0x0000555555e2f1fb in Ms::ScoreView::cmd (this=0x555558665660, s=0x555557d8e6b8 "time-delete")
at mscore/scoreview.cpp:2320

Measure::computeMinWidth(a, b, c) is doing what seems a valid assumption that if isMMRest() holds, then elements of Rest type is only to be found. But it fails at toRest() conversion, when instead findSegmentR() gives back a ElementType::CHORD type.

Fix version
3.2.0