Crash on paste if a tied-to note would cross a barline
Mac OS X 10.10.1
GIT commit: 7a67e63
Using attached score, and showing screen shots of each step:
1. In the second measure of rehearsal mark B on the Trumpet 1 instrument select the combination of the tied eighth-quarter A natural and the following octave up A half note (see attached screenshot).
2. Cut the selection using Command-X. This produces rests to replace the cut notes (see attached screenshot).
3. Select the quarter rest at the end of the measure and paste using Command-V. Crashes for me every time.
Score attached.
Attachment | Size |
---|---|
Screen Shot 2014-12-15 at 10.57.12 AM.png | 16.81 KB |
Screen Shot 2014-12-15 at 10.58.39 AM.png | 14.19 KB |
Put a Lid On It.mscz | 25.05 KB |
Comments
Confirmed. Problem occurs specifically if the tied-to note ends up crossing a barline, it seems.
Looks like a simple fix, will try.
I'm wrong about simple. At least, it's not the simple fix I thought it might be. It relates more to other issues with cross-barline copy/paste, so perhaps someone else who worked on those might be better able to assess this.
This issue occured on November 7.
This Nigthly is correct: https://github.com/musescore/MuseScore/commit/4ba889bf01f0d0ebe973fba48…
Not this one: https://github.com/musescore/MuseScore/commit/93e1d5b737d277716d95159fe…
The culprit is most likely on the previous commit, here: https://github.com/musescore/MuseScore/pull/1360
It was to fix this issue: #35851: Crash when pasting measures in another measure with different actual duration
I add the shortened file where appears this issue:
minimal Lid on.mscz
Ok, I will investigate what I broke with my PR.
I will post back when I have some results.
it seems the problem lies in the tie and the crash happens when updating the selection.
The segment of the ending chord referenced by the tie is 0.
Still investigating what is happening in detail.
Edit:
I think I found what I did wrong. Before that commit, the first part of the chord re-wrote the previous chord, by adding the chordrest over the old pointer. Now the code is cloning the chord and then adding it by using a different pointer. Therefore, the tie linked to the old chord pointer is now pointing to a leaked memory object (still existing, but unreachable except for this pointer). I will try to amend this in the following days; I already had to handle separately the very first part of the pasted chord, the correction should be easy, hopefully :-)
Proposed PR:
https://github.com/musescore/MuseScore/pull/1551
If in the sample file the second tied note is substituted by a rest and the tie by a slur, the same set of steps generates a crash. The PR takes into account also this second case.
Fixed in eddaefa56b
Automatically closed -- issue fixed for 2 weeks with no activity.