Entering an articulation/ornament after the deletion of a linked staff in a file with part causes crash

• Jul 22, 2015 - 08:00
Type
Functional
Severity
S2 - Critical
Status
closed
Project
Tags

MuseScore 2.0.2 / Windows 7

1) Open the Guitar + Tablature template, or create a score with two linked staves, or open this file (recorder, linked staves, and part): test file recorder.mscz

2) "I" -> select staff 2 -> Remove -> Ok

3) Select the note (E)

4) In the Articulations & Ornaments palette, double-click on any element (except bend, don't know why), eg the accent symbol

Result: crash

5) Reopen the same file (which has crashed) -> Restore session -> No

6) (so, your file has always two linked staves): select the E top staff -> add the accent symbol (double-click or drag and drop)

Result:
mutiliple accent.jpg

7) Undo -> add an accent, but by selecting the E in the second staff
8) Undo -> add again an accent in the same second staff, or in the first one

Result: crash

- Remarks:

Considering the previous image (with multiples accents), I suspect this issue is related by a way on another with this other reported bug. https://musescore.org/fr/node/70146

I cannot reproduce for now exactly the same from scratch, but it's by making tests with the attached file in this reported bug that I have discovered this issue and presented here.

- Note again that the creation/presence of a part before the deletion of the linked staff is a condition sine qua non to receive these crashes and other unexpected result.


Comments

After cheking, it's a very former issue.
I can reproduce exactly the same result(s) since more a year with this Nightly on June 2014: c24022f, even the issue (?) with multiples accents.
See:
flute.jpg

Thanks, it looks like you have probably identified the original cause fo the corrupted file in #70146: Explosive accents on Guitar part with linked tab staff.

We now have several different reports of very bad things happening if one either adds or deletes a linked staff to an instrument that has a linked part. We still aren't sure (well, I know *I'm* not sure) what actually makes sense here - should such changes be reflected in the parts as well? What bad things could happen if there are instruments with different numbers of staves in different parts?

I'm not saying we shouldn't thinking this through and work something out. But we might also consider simply disallowing the operation. That is, when selecting a staff that has a linked staff in another score, disable the "Remove" and "Add Linked Staff" buttons. Maybe "Add Staff" too if there turn out to be issues with having different numbers of staves - cross staff notation comes to mind.

And why this issue doesn't occur by selecting a bend in the same articulations & ornaments palette at step #4 ? A particular reason?
Or maybe: It is the exception that proves the rule?! :)

Bends are handled differently from articulations - the are totally different internally.

Anyhow, by the time you remove that staff, the score is in pretty bad shape, probably lots of things would cause crashes. For instance, try entering another note. Or, in some cases, just wait two minutes - see #63226: Crash on autosave after deleting staff from instrument in score with linked parts.

BTW, I could not reproduce a crash using your steps except by loading the file you supplied. I assume I would have needed to generate parts and add a note somewhere between steps 1 & 2 to see a problem.

Well, I can reproduce at will from scratch again.
The complete step #1:
- In the wizard, create a score for an instrument (or via "My First Score") -> add linked staff -> Ok
- Add a note in the first staff -> Generate parts -> New all -> Ok (I try by reversing the operation: Generate parts, then adding a note: I receive the same crash later)

You are now arrived at the step #2 (remove the second staff)

EDIT: "by the time you remove that staff, the score is in pretty bad shape, probably lots of things would cause crashes. For instance, try entering another note"

True! I can entering a note, but not two... (well, I can, but I receive a crash!)

Yes, indeed, if I generate parts, I can get the crash. That was my point - your original step 1 didn't say anything about parts. I just wanted to make sure I understood. We definitely know deleting a staff from an instrument that is included in a linked part causes very bad things to happen. If deleting a staff from an instrument that is *not* included in a link part caused a crash, we'd need to know that as well, as it would be a different (and worse) problem.

"your original step 1 didn't say anything about parts."
Yes, but there was a part in my test file.
And above all, I wrote in "Remarks", at the end of the report.
"Note again that the creation/presence of a part before the deletion of the linked staff is a condition sine qua non to receive these crashes and other unexpected result." :)

I try to make clear and detailed reports. Apparently, I still have some way to go! :(

Status (old) patch (ready to commit) fixed

Fixed in branch master, commit 8bf08c2328

fix #89636 fix #94911 fix #70226 fix #91351: unlink the right staves when deleting a part, or deleting a linked staff. Do not store several times the same staves in linkedStaves

second take

Fixed in branch master, commit c6ccf18398

Merge pull request #2397 from lasconic/fix-89636-and-more

fix #89636 fix #94911 fix #70226 fix #91351: unlink the right staves when deleting a part, or deleting a linked staff. Do not store several times the same staves in linkedStaves