Crash undoing add instruments
Reported version
3.x-dev
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
Crash in current master with the following steps:
1) default score
2) edit / instruments, add something (flute, say)
3) undo
Result: assertion failure, looks to be trying to move viewport but using an invalid staff index
Fix version
3.5.0
Comments
Related to 9c2e6f759 maybe? (I hope not)
Doesn't seem likely, I can't see how that could have broken anything.
I couldn't reproduce this, for me undo works fine (Linux, Ubuntu 19.10).
I could reproduce under Linux Mint 19.3, debug build of c458cc34eb with the given steps.
Here is the backtrace (only the relevant part:
-6 0x000055555c659436 in Ms::System::staff(int) const (this=0x6120006a8340, staffIdx=1)
at libmscore/system.h:132
-7 0x000055555f02116e in Ms::StaffLines::pagePos() const (this=0x611001608180)
at libmscore/stafflines.cpp:53
-8 0x000055555f021628 in Ms::StaffLines::canvasPos() const (this=0x611001608180)
at libmscore/stafflines.cpp:62
-9 0x000055555d6880d6 in Ms::needViewportMove(Ms::Score*, Ms::ScoreView*) (cs=0x62c000018200, cv=0x617000054b00)
at mscore/scoreview.cpp:5090
-10 0x000055555d688abe in Ms::ScoreView::moveViewportToLastEdit() (this=0x617000054b00)
at mscore/scoreview.cpp:5118
-11 0x000055555c523b51 in Ms::MuseScore::endCmd(bool) (this=0x61b000081880, undoRedo=true)
at mscore/musescore.cpp:6006
-12 0x000055555c50de57 in Ms::MuseScore::undoRedo(bool) (this=0x61b000081880, undo=true)
at mscore/musescore.cpp:4903
In particular, in needViewportMove funtion the startStaff and the endStaff are both 1 (retrieved from state
const CmdState& state = cs->cmdState();
), but in the score there is only staff 0 after the undo (staff 1 was "un-done").#303762: [EPIC] Collection of Undo issues
In reply to I couldn't reproduce this,… by Sergios - Anes…
https://github.com/musescore/MuseScore/pull/6183
Fixed in branch 3.x, commit 954aed8132
_Fix #302573 - Crash undoing add instruments
Root cause was in needViewportMove() which used the begin and end staff
from the cmdState but the state wasn't adapted for the removed staff yet._
Fixed in branch 3.x, commit 13793f9e72
_Merge pull request #6183 from njvdberg/issue-302573-crash-undo-instruments
Fix #302573 - Crash undoing add instruments_
Fixed in branch 3.5beta, commit 136467c85b
_Merge pull request #6183 from njvdberg/issue-302573-crash-undo-instruments
Fix #302573 - Crash undoing add instruments_
Automatically closed -- issue fixed for 2 weeks with no activity.
now fixed in master too