Crash on advancing to next chord symbol with no chord symbol entered

• Mar 21, 2020 - 11:44
Reported version
3.x-dev
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

1) Open last nightly: OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.5.0.10628, revision: 6c1e675
2) Enter a quarter note and a chord symbol
3) Navigate with Space bar.
Result: Sometimes the program shuts down after two keystrokes, sometimes a little more (here, on the GIF, at the beginning of the second measure).
Other times, you have to go back and forth over two measures with Space and Shift + Space, etc.
In short, there is something unstable.

See:

Video_2020-03-21_122540.gif


Comments

Title Chord symbol playback: Instability and crash with Space bar Crash on advancing to next chord symbol with no chord symbol entered
Priority P0 - Critical

I did some investigation, and it appeatrs to me this is not related to chord symbol playback at all - the playback code is not involved, and I can reproduce the crash in a nightly from before the chord symbol code was merged. The crash seems to occur during Harmony::endEdit(), we try to force a layout of the current chord symbol, which is actually empty since we pressed space twice without typing anything. During the endCmd() at the end of that forced layout, the current element ('this") is being deleted and turned to garbage, and a crash then becomes all but inevitable.

Based on this analysis, I'm guessing the actual culprit is actually https://github.com/musescore/MuseScore/pull/5570, to fix #295544: Actions applied during text editing more automatically revert on return to normal mode. This changed the management of the undo stack during text editing, and thus behavior of endCmd().

Status PR created fixed

Fixed in branch master, commit 1edcf0d2d3

_fix #302643: crash on advancing to next chord symbol with no text entered

Ensures that text elements are deleted after the entire text editing
process is finished. Previously elements were deleted on next
Score::update() call which is dangerous since it may happen to be
called several times on finishing text editing.

Also take care to remove the deleted element from selection to
prevent potential crashes on undo/redo operations (e.g. with lyrics)_

Fix version
3.5.0