Crash on set as style operation if score ends with a frame

• Dec 3, 2019 - 22:23
Reported version
3.3
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

I can reproduce this on Linux in 3.3 and in current master.

1) load attached score
2) position the view so the text in the frame at the end of the score is not in view
3) select the text on the first measure
4) press "Set as style" on the offset in Inspector

Result: crash. For some reason we are trying to position the viewport to that text, not sure why, apparently moveViewPortToLastEdit() is not understanding the actual relevant element is the staff text on the first measure. The crash itself happens in adjustCanvasPosition(), we've passed in the text as the element and staff is 0. Easy fix for crash would be to handle a null staff within adjustCanvasPosition() I guess, but really, we shouldn't be trying to position the viewport to that last text in the first place. I'lve got a little time to investigate right now but then I have to go teach this evening, so I'm not necessarily expecting to have a PR.

Attachment Size
set-as-style-crash.mscz 4 KB

Comments

Status PR created fixed

Fixed in branch master, commit a96b72c2fe

_fix #298061: fix a crash on "set as style" if score ends with a frame

  • Don't pass staff number to adjustCanvasPosition if trying to
    adjust viewport to a frame. This avoids a crash itself.
  • Implement a more robust approach to determine a measure relevant
    to the current edit operation in CmdState. This avoids trying to
    unnecessarily jump to the frame at the end of a score._

Fixed in branch 3.3.4, commit 7684abeccf

_fix #298061: fix a crash on "set as style" if score ends with a frame

  • Don't pass staff number to adjustCanvasPosition if trying to
    adjust viewport to a frame. This avoids a crash itself.
  • Implement a more robust approach to determine a measure relevant
    to the current edit operation in CmdState. This avoids trying to
    unnecessarily jump to the frame at the end of a score._
Fix version
3.3.4