Crash with first note of measure set to beam middle and nothing to beam to
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Few
Severity
S2 - Critical
Reproducibility
Once
Status
closed
Regression
No
Workaround
Yes
Project
See discussion in https://musescore.org/en/node/281149.
I'm setting the Reproducibility to Once until it can be created from scratch.
This 2.3.2 score cannot be opened in version 3. There is a stack trace in the linked post.
Fix version
3.0.1
Comments
Here is a four measure, single instrument score that also illustrates this problem. Interestingly, if you use MuseScore 2.3.2 to delete measure 3, MuseScore 3.0.0 does not crash on the resulting file.
In reply to Here is a four measure,… by Nancy Bachmann…
I suspect you used save selection to create this score. It crashes, but if I try to enter the exact notes from scratch it doesn't crash. Can you confirm this?
The smaller score will most definitely make trouble shooting easier though.
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...
In reply to (No subject) by Marc Sabatella
Note that Version 3.0.0 also crashes if the last eight note in a series is set to beam middle.
In reply to Note that Version 3.0.0 also… by Nancy Bachmann…
_...crashes if the last eight note...is set to beam middle...
Not true. All final eighth notes in a group of connected eighth notes must be set to beam middle, or it cannot connect to the previous note.
In reply to _...crashes if the last… by mike320
Here is a two measure example. All eighth notes have the beam property set to Auto except the last note in measure one, which is set to Middle. This file crashes under 3.0.0.
see https://github.com/musescore/MuseScore/pull/4533, all sample files provided here load without a crash with that patch applied
In reply to Here is a two measure… 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.
came up again in https://musescore.org/en/node/281189
Related to #280108: Copying voice 2 notes with beams causes crash? See that issue for differences.
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
Automatically closed -- issue fixed for 2 weeks with no activity.
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...
In reply to I'm almost there... I've… by songchao
Well, I've made a PR that can fix another similar issue described in #285100: Crash when moving beam if first note of beam is in the first measure and other notes of beam are in the second measure. But that PR won't fix this issue, i.e., the case where a half note is in previous measure, as described in [#284646].
See https://github.com/musescore/MuseScore/pull/4782.
Fixed in branch master, commit f263133fd8
fix #281154: Crash with first note of measure set to beam middle and nothing to beam to
Fixed in branch master, commit ef34d972bf
_Merge pull request #4782 from songchaow/fix_cross_measure
fix #281154: Crash with first note of measure set to beam middle and …_
Fixed in branch 3.0.5, commit 2b732a4dfc
_Merge pull request #4782 from songchaow/fix_cross_measure
fix #281154: Crash with first note of measure set to beam middle and …_
Automatically closed -- issue fixed for 2 weeks with no activity.