Crash when opening score with a duplicate Glissando

• May 25, 2016 - 10:33
Reported version
2.1
Type
Functional
Severity
S2 - Critical
Status
closed
Project

https://musescore.org/en/node/61681#comment-507081and the score provided there (attached here now too)

Crashes in 2.0.3 and master, stack trace in the latter:
1 QVector::append qvector.h 629 0xcda245
2 QVector::push_back qvector.h 252 0xcda541
3 Ms::Note::addSpannerBack note.h 413 0xc3f4d2
4 Ms::Note::read note.cpp 1082 0x7c7194
5 Ms::Chord::read chord.cpp 965 0x806df7
6 Ms::Measure::read measure.cpp 1637 0x7a45c7
7 Ms::Score::readStaff scorefile.cpp 327 0x7eb282
8 Ms::Score::read scorefile.cpp 963 0x7ef79d
9 Ms::MasterScore::read1 scorefile.cpp 925 0x7ef4ad
10 Ms::MasterScore::loadCompressedMsc scorefile.cpp 777 0x7ee52e
11 Ms::MasterScore::loadMsc scorefile.cpp 824 0x7ee9ca
12 Ms::readScore file.cpp 2030 0x59ee36
13 Ms::MuseScore::readScore file.cpp 328 0x58fde6
14 Ms::MuseScore::openScore file.cpp 309 0x58fcb2
15 Ms::MuseScore::loadFiles file.cpp 290 0x58f974
16 Ms::MuseScore::cmd musescore.cpp 4273 0x499f78
17 Ms::MuseScore::cmd musescore.cpp 4145 0x49969c
18 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 825 0x68d9e2
19 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a07a62
20 ZN12QActionGroup7hoveredEP7QAction 0x1a025295
...

In the 2nd score I've manually remove the 2 glissandos, it loads without crashing

Attachment Size
Wicked 4.0.mscz 50.71 KB
Wicked 4.0-fixed.mscz 50.48 KB

Comments

I wouldn't be surprised that MuseScore crashes with a bad file. The same glissando is written twice for 1 note and doesn't have an end.

Is there any way to reproduce this from scratch?
As far as I have tested, I can't reproduce the effect.

Actually 2 fixes needed,
1st prevent the creation of such duplicates, this would be the hard part, as we don't know how to reproduce.
2nd don't crash on loading such a duplicate, but (silently?) ignore it (and don't save again). This might be easier, 'just' detect that an id has been used, and if so skip that element.