Undo in Continuous View for reverting in Page View before a system changing displays unexpected clefs

• Aug 21, 2016 - 19:38
Reported version
3.0
Type
Functional
Severity
S4 - Minor
Status
closed
Project

GIT commit: 37e531e / Windows7

1) "My First Score" -> Append 1 measure -> Ok
2) Format -> Add line breaks every 4 measures -> Ok
3) Enter a whole note in measure 20
4) Switch in Continuous View
5) Undo twice

Result: crash

Notes: Notice that it is impossible to enter notes with the mouse beyond an additional measure in Continuous View: the measure 21 works, but not the followings.

For example: After step #4 (Continuous View)

5) Enter a whole note with mouse in measure 21

Result: as expected

6) Enter another whole note with mouse in measure 22
Result: failure

7) Undo three times
Result: crash

- Input notes is possible with the keyboard, but whatever by mouse or keyboard, the action of Undo (depending on the number of notes + 1) causes the same crash.

Don't really understand why, eg, the entering of notes is impossible with mouse after mid-score in continuous view. Something to do with mid-Score?

- In conclusion, the presence of line breaks, the appending of a measure (a minimum), the toggle in continuous view, and the action of Undo seem to be the fatal cocktail of this issue.


Comments

This issue seems to be a side effect of this commit, on May 18: b448ab9
With one of the previous ones, the same day, ie 26e443c,
the behavior was not as expected, however (especially for the Navigator).
At step #4, the score was showed three measures before the whole note. Like this (click on the image):
test piano.jpg
And after Undo (to return in Page View), the page disappeared far left of the screen. But there was no crash.

Title Undo in Continuous View around mid-score and after appending a measure leads to a crash Undo in Continuous View for reverting in View Page before a system changing causes a crash

New concise and easy steps (without appending a measure)
And with a more informative title, I hope.

So:

1) Treble clef template
2) Enter a note in measure 19 (just before the second system)
3) Toggle in Continuous View
4) Undo

Result: crash

Title Undo in Continuous View for reverting in View Page before a system changing causes a crash Undo in Continuous View for reverting in Page View before a system changing causes a crash

Oops... Page View, of course.

Additional information I found: the problem happens when in step 2) of comment #4 measure 19 goes to the next system (the second one in this case), so that a new clef segment (the one at the beginning of measure 19 in the second system) is added. If, for example, I add a whole note instead of a quarter and thus the measure 19 does not move to the 2nd system, there is no crash.
When in debug mode, the execution stops at line 134 of libmscore/segmentlist.cpp with error for example:
Fatal: segment 0x237110f8 Clef not in list
This address refers to the clef segment of the second system in this case.
Backtrace:
#0 Ms::SegmentList::remove (this=0x236d7218, e=0x237110f8) at C:\Git_packages\MuseScore\libmscore\segmentlist.cpp:134
#1 0x007afe5d in Ms::Measure::remove (this=0x236d7128, e=0x237110f8) at C:\Git_packages\MuseScore\libmscore\measure.cpp:705
#2 0x0074e133 in Ms::Score::removeElement (this=0x210c8120, element=0x237110f8) at C:\Git_packages\MuseScore\libmscore\score.cpp:1414
#3 0x00741e14 in Ms::AddElement::undo (this=0x21ccbf20) at C:\Git_packages\MuseScore\libmscore\undo.cpp:1486
#4 0x0073b935 in Ms::UndoCommand::undo (this=0x1f92f590) at C:\Git_packages\MuseScore\libmscore\undo.cpp:145
#5 0x0073c14a in Ms::UndoStack::undo (this=0x235728f0) at C:\Git_packages\MuseScore\libmscore\undo.cpp:310
#6 0x007873fd in Ms::Score::undoRedo (this=0x210c8120, undo=true) at C:\Git_packages\MuseScore\libmscore\cmd.cpp:149
#7 0x0049805b in Ms::MuseScore::undoRedo (this=0x1fd1e3a0, undo=true) at C:\Git_packages\MuseScore\mscore\musescore.cpp:3597
#8 0x0049de9b in Ms::MuseScore::cmd (this=0x1fd1e3a0, a=0x20beeb08, cmd="undo") at C:\Git_packages\MuseScore\mscore\musescore.cpp:4678
#9 0x0049cf40 in Ms::MuseScore::cmd (this=0x1fd1e3a0, a=0x20beeb08) at C:\Git_packages\MuseScore\mscore\musescore.cpp:4479

A similar crash happens with "My first score" when selecting one line break; right-click -> select all similar elements; delete all the line breaks; switch to continuous mode and then undo.

Title Undo in Continuous View for reverting in Page View before a system changing causes a crash Undo in Continuous View for reverting in Page View before a system changing displays unexpected clefs

With the same steps, in comments #4 and #6, the crash is now fixed (since October 18, with this nightly, 681a27f.
Maybe this commit ?: https://github.com/musescore/MuseScore/commit/79b7746f5b49c79889d5a4733…).

Steps, for recall:

1) Treble clef template
2) Enter a note in measure 19 (just before the second system)
3) Toggle in Continuous View
4) Undo

Or

1) "My first score"
2) Select a line break -> right-click -> select all similar elements -> delete all the line breaks
3) Switch to Continuous View
4) Undo

So, by now, the same steps lead to the display of unexpected clefs. See image below (click on)
clefs.jpg

Status (old) active fixed

I can't reproduce.
Fixed (no more unexpected clefs after undo) by f7d9650

Not completely fixed however (ie misplacement of some rests - after the break lines- in Continuous View, and problem also with the last barline of the first system after deleting all break lines in "My First Score".)
Will be the subject of another report.