Copy/paste a chord symbol into a fretboard diagram causes a crash

• Sep 18, 2015 - 10:20
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Nightly b376184/ Windows 7

1) New "Guitar" template -> Finish

2) Input two whole notes in the two first measures

3) Add a fretboard diagram (from palette) on the first note

4) Add a chord symbol, ie, C (via Ctrl + K) in this same first measure

5) Copy/paste the fretboard diagram in the second measure

6) Copy/paste the chord symbol (C) in the second measure, not by selecting first the whole note (G), but by selecting the fretboard diagram itself.
Like this:
select chord.jpg
Result: crash
(Test file: copy paste fretboard.mscz )
crash.jpg


Comments

I know of course that this is not the right way to copy/paste a chord symbol.

But I suspect beginners or uninitiated users might be tempted by mistake or nescience of doing the same action (and it is quite tempting to do, as "natural", right?)

I think I have located the time where this action leads to a crash (in August 2014)

So, I note a change in beginning of August 2014.
With this Nightly: cf1da9f, this action works. As expected or unexpected, by this way (selection of the fret diagram) ? Don't know.

See the result: the default position (as on this image) of the C chord symbol after pasting is unexpected for sure.
paste.jpg

It fails on August 4 and causes a crash. After seeing this date, this issue might be a side effect of this commit?
https://github.com/musescore/MuseScore/pull/1086/files
- https://github.com/musescore/MuseScore/pull/1086

Confirmed and stack trace:
0 Ms::SegmentList::first segmentlist.h 40 0xbdf008
1 Ms::Measure::first measure.h 215 0xbe5d88
2 Ms::Measure::findSegment measure.cpp 733 0x7c1627
3 Ms::Measure::undoGetSegment measure.cpp 748 0x7c16e2
4 Ms::Score::undoAddElement undo.cpp 1142 0x75418b
5 Ms::FretDiagram::drop fret.cpp 508 0x8cf330
6 Ms::Score::cmdPaste paste.cpp 832 0x7fda7a
7 Ms::ScoreView::normalPaste scoreview.cpp 2541 0x40e1f7
8 Ms::ScoreView::qt_static_metacall moc_scoreview.cpp 216 0x6b3cae
9 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a655a2
10 ZN19QAbstractTransition9triggeredENS_14QPrivateSignalE 0x68ac3a93
11 ?? 0x201cd9a0
12 ?? 0x202413e8

Apparently in undo.cpp, line 1142 we dereference a NULL pointer, result from calling score->tick2measure(tick) the line before.

Status (old) active patch (ready to commit)

Seems odd that the aforementioned commit would have this side effect, as the bug is elsewhere. The fret diagram itself was being added incorrectly before and maybe it just so happened that the copy/paste code worked better with the incorrect fret diagram.

Anyhow, the following should fix this and affect nothing else:

https://github.com/musescore/MuseScore/pull/2225