Chord symbol playback: copy-paste results in crash

• Mar 22, 2020 - 09:30
Reported version
3.x-dev
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.5.0.10628, revision: 6c1e675

1) Open this test file: copy paste.mscz
2) Copy-paste the C chord in measure 5 (G note)
3) Eg in toolbar, press "Rewind to start position" (or "Start Playback")

Result: the program shuts down.


Comments

Priority P0 - Critical

For me there was no crash right away, but the copied chord did not play back, and it eventually crashed as I kept poking around. It appears that when copying the chord symbol, the playback information was not copied correctly. I am investigating a fix.

Status PR created fixed

Fixed in branch master, commit b50a5543c1

_fix #302690: crash after copying chord symbol

Resolves: https://musescore.org/en/node/302690

Currently, a crash can occur after copying a chord symbol.
The Harmony object contains a RealizedHarmony object,
which contains a pointer back to the Harmony object,
but the copy constructor for Harmony does not set the pointer.
This ends up yielding an invalid pointer by the time the copy completes.
This fix makes sure to set the pointer correctly.
It also copies the "play" property,
otherwise copied chord symbols would not play by default.

Fix version
3.5.0