Easy fingering mode: pressing [Space] causes crash in staff/tablature if notes are in Voice 4 in bottom staff of score

• Sep 21, 2019 - 14:41
Reported version
3.2
Priority
P1 - High
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.3.0.8382, revision: 5fa3c1c

  1. Open the attached score (staff/tab).
  2. Double-click on the first or last fingering in measure 6, or the fingering in measure 8.
  3. Press [Space].
    Result: Crash!

This only happens in staff/tablature. If the tab is deleted the crash doesn't occur.

A similar issue was recently fixed: #292312: Crash press ‘space bar’ in entering fingering mode on TAB stave when note is tied beyond barline .

(Edited 17.31 GMT).

Attachment Size
fingering_crash.mscz 17.45 KB

Comments

Status active needs info

(edited: in fact, I see two other measures with similar problem. Further investigation needed)

Title Easy fingering mode: [Space] on tied note causes crash in staff/tablature Easy fingering mode: pressing [Space] causes crash in staff/tablature
Status needs info active
Title Easy fingering mode: pressing [Space] causes crash in staff/tablature Easy fingering mode: pressing [Space] causes crash in staff/tablature if notes are in Voice 4 in TAB staff

Well, tricky and unexpected problem.
I think I have understood the basics (at least, I can reproduce from scratch , the essential)
Basically, and at this point in my checks and understanding, there is a problem with voice 4 in the TAB staff (whether their content is the same or different, no matter, since these are no linked staffs here).

So:

1) Load this test file: default test.mscz

2) Double-click first fingering and continue to enter some others by pressing Space bar
Result: you get a crash when you arrive in the fourth measure (with a note voice 4 in TAB staff)

And so, you get it immediately if there is a note in voice 4 in TAB staff first: test voice 4 first.mscz

  • No matter if in standard staff, the notes are in voice 2 or 3: same result
    • No problem apparently if standard staff in voice 4 and when entering fingerings in TAB staff: fingerings tab.mscz

Just one observation to deepen things.

If you delete the note (fret in the TAB, first measure, from the second file attached yesterday, so now: voice 4 rest.mscz ), it does not solve the problem.
Because the rest in voice 4 remains watermarked, and therefore perfectly visible if you tick "Show rests" in Advanced style properties: voice 4 rest shown.mscz

Once this is done, this rest in voice 4 must be removed, and now the problem no longer occurs: voice 4 rest remove.mscz

Title Easy fingering mode: pressing [Space] causes crash in staff/tablature if notes are in Voice 4 in TAB staff Easy fingering mode: pressing [Space] causes crash in staff/tablature if notes are in Voice 4 in bottom staff of score

Keeping in mind that the underyling navigation in the "fingering mode" is really the Alt+Right shortcut, many issues with this code can be looked at separately from fingering itself.

So, ignoring the fingering for now, using the default_test example above, try clicking the second whoe note on the top staff then using Alt+Right to navigate. You'll see navigation doing normal things - barline, note in bar 3, barline, note in bar 4 - and then, instead of going to the barline in that same bar, navigation jumps down to the tab staff. This is unexpected, and I think probably why the crash happens, because we're now trying to add a fingering to the wrong staff.

A little more poking around, and I arrive at this conclusion: the navigation is wrong any time there is more than one staff, you are navigating a staff other than bottom staff, and there is a note or rest in voice 4 of the bottom staff of the score. In that case, the note in voice 4 on the bottom staff "steals" the navigation. This is merely annoying under normal circumstances, but leads to a crash in this particular case where you have hit "space" in fingering mode (it actually doesn't crash with Alt+Right, but you can hear that the voice 4 note is selected).

Status PR created fixed

Fixed in branch master, commit 954485d04e

_fix #294727: crash in fingering mode with notes in voice 4 on last staff

This was reported original as a crash in fingering entry,
but the underlying problem is in navigation,
When we have run out of notes in the current segment on the current staff,
we should move on to the next segment,
but Segment:nextElementOfSegment() was erroneously finding a note or rest
in voice 4 of the last system.
That is because the loop through the tracks was not handling the end condition properly.
We find an element but don't check that it is on the right staff.
This change simply adds the missing check._

Fix version
3.3.0