Remove Selected Range (Timewise Delete) of a partial note in another voice leads to crash

• Apr 2, 2019 - 12:13
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 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.1.0.6214, revision: f2f8862

  1. Open the attached score. Click on the sixteenth A note at the start of measure 32 and press Ctrl + Delete.
    Result: Crash.
  2. Reopen the score. Select any of the notes in voice 1, at the beginning of measures 7, 19 or 26 (eighth notes). Press Ctrl + Delete.
    Result: The layout is broken at the start of the system.
  3. Undo the changes. Select any of the notes in voice 1, at the beginning of measure 13 (quarter notes). Press Ctrl + Delete.
    Result: As expected.
Attachment Size
remove_selected_range.mscz 30.01 KB

Comments

Title Remove Selected Range (Timewise Delete) leads to crash Remove Selected Range (Timewise Delete) of a partial note in another voice leads to crash

I've found the cause. The crash happens if the note in voice 2 is split into multiple notes after deleting, and a tie is added between them, in Ms::Score::createCRSequence. The multiple notes' segments are not valid before undoAddCR() in createCRSequence is called. However, when adding the tie in undoAddElement(tie), the invalid segments are used.
(in other cases, the note's duration in voice 2 can still be represented by a single note after deleting some duration, so no splits are required and no crash happens. )
I'll probably write a fix soon afterwards...

Fix version
3.1.0