Crash on next/prev element for certain elements attached to other elements

• Oct 1, 2019 - 03:52
Reported version
3.2
Priority
P1 - High
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

Dmitri pointed out a crash in the "next element" command in a particular case. Investigating I found a number of other ways to force a crash on this command. Also cases where there is no crash, but navigation goes all the way back to the beginning or end of the score.

What they have in common is they involve cases of symbols with parents other than what was expected in the code - symbols attached to other symbols, chord symbols attached to fret diagrams, etc. Also in some of the cases the track of the element was not set correctly. Also, a common thread is that these are elements you cannot actually reach by navigation, only by clicking.

Here is one way to reproduce a crash in 3.2.3:

1) new score
2) add symbol to first measure rest
3) select it
4) Alt+Left

If that doesn't crash, Alt+Right might. if not, try adding text also.

Anyhow, fix coming soon.


Comments

Status PR created fixed

Fixed in branch master, commit 6c51400d46

_fix #295106: crash on next element

There are a number of cases where next element ended up hitting unexpected code paths.
Mostly these involve cases of elements being attached somewhere pther than expected:
symbols attached to rests or to other symbols rather than to notes,
chord symbols attached to fret diagrams.
This change addresses these cases in a few different ways:
1) for symbols to attached to other symbols, or chord symbols attached to fret diagrams,
srt the track correctly (it was -1, causing the the code to not be able to find a next element).
2) for symbols attached to rests, be sure to handle that case in Score::nextElement(),
and also make sure that Segment::nextElement() and Segment::prevElement()
don't assume these elements actually have the segment as parent,
but instead check for that and move on if not._

Fix version
3.3.0