CRASH if select entire chordrest and then press Alt->up or Alt->down

• Feb 19, 2017 - 08:40
Reported version
3.0
Type
Functional
Severity
S2 - Critical
Status
closed
Project

on latest 3.0-dev fcc5123 if select entire chordrest, and then press Alt->up or Alt->down, then SEGFAULT:

1 Ms::ScoreElement::isRest scoreElement.h 315 0xdb9380
2 Ms::ScoreView::cmd scoreview.cpp 2887 0x411c83
3 Ms::MuseScore::cmd musescore.cpp 4989 0x49eac2
4 Ms::MuseScore::cmd musescore.cpp 4539 0x49c728
5 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 733 0x68a554
6 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a08842
7 Ms::ScoreTab::actionTriggered moc_scoretab.cpp 182 0x690663
8 Ms::ScoreTab::qt_static_metacall moc_scoretab.cpp 95 0x690398
9 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a08842
10 ZN12QActionGroup7hoveredEP7QAction 0x61dc5295
11 ?? 0x248cfdd8
12 ZN7QAction8activateENS_11ActionEventE 0x61dc4248
13 ?? 0x1ebccd78
14 ?? 0x219d3300
15 ZN7QThread18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv 0x68a67dd0
16 ZN7QThreadD2Ev 0x6889aa20
17 ZN7QObject11customEventEP6QEvent 0x68a06850
18 ZN26QAbstractDynamicMetaObjectD2Ev 0x68a06820
19 ZN7QObject10timerEventEP11QTimerEvent 0x68a06830
20 ZN7QObject10childEventEP11QChildEvent 0x68a06840

in ScoreView::cmd, el gets assigned to NULL in line 2886 but then dereference in while loop's test:

      else if (cmd == "up-chord") {
            Element* el = score()->selection().element();
            if (el && (el->isNote() || el->isRest()))
                  cmdGotoElement(score()->upAlt(el));
            el = score()->selection().element();
            while (el->isRest() && toRest(el)->isGap() && el->voice() != 0) {
                  el = score()->upAlt(el);
                  cmdGotoElement(el);
                  }
            }

Nothing happens in 2.1.

I would suggest the solution should be to have the following behavior for pressing Alt->up or Alt->down for a chordrest: Change the selection into the top or bottom note.

Attached is the simplest .mscx you need to reproduce.

Attachment Size
c-octave-chord.mscx 3.88 KB

Comments

Status (old) active fixed
Status active fixed

Fixed in branch master, commit 2e112abcff

fix #175216, fix #269114: Crash with shortcut alt+arrow up/down if more than one element or nothing is selected
Fix other related issues with the up-chord/down-chord commands
Prevent crash when adjusting the grips of ties