Crash saving score with system divider selected

• Nov 30, 2018 - 00:47
Reported version
P1 - High
S2 - Critical

1) load attached score, which has system dividers enabled in Format / Style / System
2) make any change
3) click one of the dividers to select it
4) save

Result: crash (if you don't see this, try opening Timeline, since that's where the crash happens, even though I don't have it open at the time)

Although crash happens in Timeline code, it's not really the fault of that code. Selection is bad. There is one element in the list but it'ss garbage, presumably because the selected divider was deleted and re-generated after the save.

BTW, it's an open question as to whether dividers should be selectable. I had wanted to reposition one, but this doesn't seem to have survived the save (which did complete). This used to work, though - see I'll file that separately.

Attachment Size
hide-instrument.mscz 9.25 KB


I suspect it is still related to #87241: Persistent bug when changing Instrument names - crashes and wipes savedfile at the source of the issues seem to be pointers to deleted objects inside selection. It looks like this problem still should be addressed as soon as possible.

There is also another crash scenario not involving saving:
1. Select a system divider.
2. Switch to Continuous or Single Page view.
3. Switch back to Page view.
4. Click on any element.

FWIW there were a number of similar issues involving having generated elements selected when switching between continuous and page views, also triggered when saving scores in continuous view because that forced a temproary flip to page view first to generate the thumbnail. See for instance #84351: Crash when saving with instrument name selected and continuous view. I recall others but that's the one I found in a quick search. My comment there in indicates I was skeptical of the solution implemented...

Fixed in branch master, commit 79d5bed7d4

Merge pull request #4268 from dmitrio95/87241-corrupted-files-and-selection

fix #87241, fix #279064: Remove invalid pointers to elements from selection and avoid complete data loss in case of crash on saving .mscz file