Crash on paste if a tied-to note would cross a barline

• Dec 15, 2014 - 16:01
Type
Functional
Severity
S2 - Critical
Status
closed
Project

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.


Comments

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

Attachment Size
minimal Lid on.mscz 2.77 KB

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 :-)