Select a note/rest before change the measure duration leads to corruption/crash
2.0.3 Version 3c7a69d, and current Nightly 5248e08/ Windows7
First reported: https://musescore.org/en/node/139651
1) "My First Score"
2) Select the whole rest, first measure, and type on 5 (so, the first quarter rest is hightlighted)
Result:
3) Right-click on the measure -> Measure Properties -> Change "Actual Measure duration": eg 1/4 -> Ok
4) Type two notes (eg two E)
Result: corruption
5) Undo twice (more "visible" corruption)
- To get a crash:
On any score, eg this test file: test file measure duration.mscz
1) Select a quarter note (regardless of which: the first, third etc.) in the first measure
2) Right-click on this measure -> Measure Properties -> Change "Actual Measure Duration" to 1/4 -> Ok
3) Type a note
Result: crash
Comments
The crash is due to a failed assertion:
Fatal: ASSERT: "rtick2 > rtick1" in file ...\MuseScore\libmscore\sig.cpp, line 178 (:0, )
Immediatelly prior to that I see the following debug output:
Debug: segment not found (...\MuseScore\libmscore\measure.cpp:312, Ms::AccidentalVal Ms::Measure::findAccidental(Ms::Segment*, int, int, bool&) const)
Debug: Segment::add(Rest) there is already a Chord at 2:0:0(480) track 0. score 0x22916990 (...\MuseScore\libmscore\segment.cpp:423, void Ms::Segment::checkElement(Ms::Element*, int))
Debug: toDurationList:: rest remains -1/2 (...\MuseScore\libmscore\durationtype.cpp:485, std::vector Ms::toDurationList(Ms::Fraction, bool, int, bool))
I locate a change of behavior in October, 4, 2014 .
Ie: with this nigthly: 28893f9 at the end of the step #3 (ie, change duration measure -> Ok), the single action to press Ok un-selects (no highlighted) the rest/note.
So, then, by typing notes: no issue:
- With this one: a614472, one can observe the current behavior, ie, at the end of the step #3, the rest/note remains selected, and so with the consequences of corruption already described (see second image, first post)
So may have gotten introduced with the fix for #34876: Crash when dragging object over bar and then frame or #35091: "Apply" doesn't work in Measure Properties, the latter being more likely, just from looking at the topic?
Or here?: https://github.com/musescore/MuseScore/commit/4e1b3b53cc856bb99418ca31a…
As far as I can see 4e1b3b5 is not between 28893f9 (exclusive) and a614472 (inclusive)
Here, for fix ?: #31396: MuseScore 2.0 beta 1 - Crashing when I try to edit figured bass text
The topic of that one doesn't seem related either
Or here? https://github.com/musescore/MuseScore/pull/1350/files
Indeed the most likely candidate, to fix #35091: "Apply" doesn't work in Measure Properties, merged in 701aeb3, the only one between the 2 commits you identified as the borders
Here is the stack trace (omitting the first steps calling Qt assert functions):
[...]
#4 0x0000000003b3e6c4 in Ms::TimeSigFrac::strongestSubbeatLevelInRange (this=0x7fffffff8fe0, rtick1=960, rtick2=481, subbeatTick=0x7fffffff8cc0)
at /home/antonio/MuseScore/libmscore/sig.cpp:178
#5 0x000000000302b299 in Ms::populateRhythmicList (dList=0x7fffffff9100, l=..., isRest=false, rtickStart=960, nominal=..., maxDots=1)
at /home/antonio/MuseScore/libmscore/durationtype.cpp:530
#6 0x000000000302af67 in Ms::toRhythmicDurationList (l=..., isRest=false, rtickStart=960, nominal=..., msr=0x6130001f0940, maxDots=1)
at /home/antonio/MuseScore/libmscore/durationtype.cpp:510
#7 0x0000000003aa3b15 in Ms::Score::setNoteRest (this=0x61b00005b080, segment=0x613000152880, track=0, nval=..., sd=..., stemDirection=...)
at /home/antonio/MuseScore/libmscore/cmd.cpp:581
#8 0x000000000306a3e0 in Ms::Score::putNote (this=0x61b00005b080, p=..., replace=true, insert=false) at /home/antonio/MuseScore/libmscore/edit.cpp:1369
#9 0x000000000305d57e in Ms::Score::cmdAddPitch (this=0x61b00005b080, step=35, addFlag=false, insert=false) at /home/antonio/MuseScore/libmscore/edit.cpp:945
#10 0x0000000000ceacb4 in Ms::ScoreView::cmdAddPitch (this=0x6170000a8e80, note=0, addFlag=false, insert=false) at /home/antonio/MuseScore/mscore/scoreview.cpp:5485
#11 0x0000000000c654e0 in Ms::ScoreView::cmd (this=0x6170000a8e80, a=0x602000184fd0) at /home/antonio/MuseScore/mscore/scoreview.cpp:2821
Here is what I found: the problem is that at #7 in Ms::Score::setNoteRest, a fraction -1/4 is used as input of Ms::toRhythmicDurationList. This apparently comes from the output of function makeGap at line 572 of cmd.cpp.
Sorry that I could not go deeper into the analysis.
Ciao,
ABL
Fixed in branch 2.0.4, commit 5f823285da
fix #139656: Select a note/rest before change the measure duration leads to corruption/crash
still open for master branch, I believe?
Fixed in branch master, commit a4b5f1b156
fix #139656: Select a note/rest before change the measure duration leads to corruption/crash
sorry for having been too impatient once again :-)
Automatically closed -- issue fixed for 2 weeks with no activity.