Crash with first note of measure set to beam middle and nothing to beam to

• Jan 3, 2019 - 20:14
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Few
Severity
S2 - Critical
Reproducibility
Once
Status
closed
Regression
No
Workaround
Yes
Project
Tags

See discussion in https://musescore.org/en/node/281149.

I'm setting the Reproducibility to Once until it can be created from scratch.

Lord_Nelson_Mass_4_0.mscz

This 2.3.2 score cannot be opened in version 3. There is a stack trace in the linked post.


Comments

Title Cross staff beams cause causes version 2.3.2 score not to open in version 3. Crash opening score with first note of measure set to beam middle and nothing to beam to

Thanks for the analysis! I can crash in one note :-). Just enter a single eighth note into measure 1, voice 2 (nothing else anywhere else) and set it to beam middle - no import required. Crash happens because we are trying to find the previous note in that voice to link to and aren't checking to be sure one exists before going further. Doesn't happen in voice 1 because the findCR() function actually returns the measure rest at the end of the score and we try to beam to that (!).

BTW< workaround is to not set beam middle unnecessarily - the sample score here has the first note of measure 3 set to beam middle even though it shouldn't be. But of course, we shouldn't crash either. Fix should be mostly a matter of checking for null before referencing prevCR in layout.cpp / createBeams(), but also, making sure we don't try to beam the first note of the score to the last :-) I'm not at a place where I can easily do this myself at the moment, if someone wants to pick up an easy bug fix...

Title Crash opening score with first note of measure set to beam middle and nothing to beam to Crash with first note of measure set to beam middle and nothing to beam to

In reply to by Nancy Bachmann…

@Nancy Bachmann Nelson, auto for the first eighth notes in these groups is actually "middle beam." If you right click the time signature and look at Time signature properties, you will see that by default (automatic) the eighth note on beat 4 is joined to the upbeat of beat 3. To confirm this, change the dotted half note to a half note followed by two eighth notes and you will see that the beams automatically join, therefore the beam is set to middle. The confusing thing in this is discussion is that in you sample score the beam looks like a start beam because there is no previous note for it to connect to. MuseScore can always tell the difference though.

Status PR created fixed

Fixed in branch master, commit 915e2472b4

fix #281154: Crash with first note of measure set to beam middle and nothing to beam to

Fixed in branch master, commit 26aedcf0e7

Merge pull request #4533 from Jojo-Schmitz/middle-beam

fix #281154: Crash with first note of measure set to beam middle and nothing to beam to

Fixed in branch 3.0.1, commit 77d97d96ec

Merge pull request #4533 from Jojo-Schmitz/middle-beam

fix #281154: Crash with first note of measure set to beam middle and nothing to beam to

Status closed active

I'm going to reopen this and call what is being reported in https://musescore.org/en/node/284646 the same issue. The problem is that the first 8th note in measure 87 has been set to middle beam, with nothing to beam to. Putting the beam into edit mode and trying to move the beam leads to a crash, which is essentially the same as this issue.

I'm almost there...
I've found the root cause: Score::createBeams(Measure* measure) will create a new beam and replace it for the beam that is being dragged.
And all the chords under the old beam will be removed to the new beam.
So the old beam becomes invalid, which is still being dragged by mouse.
Hopefully I'll come up with a fix in a couple of hours...

Fix version
3.0.1