Crash when finishing Setup Wizard with tempo box checked in 3.1 Beta

• Apr 14, 2019 - 10:23
Reported version
3.x-dev
Priority
P0 - Critical
Type
Functional
Frequency
Many
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
Tags

1) Begin the Setup Wizard in 3.1 Beta
2) Check the tempo box on screen with key signatures
3) Finish the Setup Wizard
4) Crash


Comments

stack trace:
1 Ms::Element::parent element.h 177 0xebd7bc
2 Ms::Segment::measure segment.h 129 0xebef58
3 Ms::Segment::tick segment.cpp 218 0x950b24
4 Ms::Score::setTempo score.cpp 3333 0x949633
5 Ms::MuseScore::getNewFile file.cpp 762 0x664282
6 Ms::MuseScore::newFile file.cpp 797 0x66491b
7 Ms::MuseScore::cmd musescore.cpp 5947 0x50c01e
8 Ms::MuseScore::cmd musescore.cpp 5735 0x50adf8
9 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 855 0x40bddd
10 QMetaObject::activate(QObject *, int, int, void * *) 0x68a9338a
11 QActionGroup::hovered(QAction *) 0x26894db2
12 QActionGroup::qt_static_metacall(QObject *, QMetaObject::Call, int, void * *) 0x2689573c
13 QMetaObject::activate(QObject *, int, int, void * *) 0x68a9338a
14 QAction::activate(QAction::ActionEvent) 0x26893e0e
15 QAbstractButton::setIconSize(QSize const&) 0x2696f56d
16 QAbstractButton::mouseReleaseEvent(QMouseEvent *) 0x2696f7a5
17 QToolButton::mouseReleaseEvent(QMouseEvent *) 0x26a428ce
18 QWidget::event(QEvent *) 0x268d5ff8
19 QToolButton::event(QEvent *) 0x26a42964
20 QApplicationPrivate::notify_helper(QObject *, QEvent *) 0x26897bdc
...

Interesting bug. In MuseScore::getNewFile(), we are calling setTempo() with a first argument of 0. I think most likely this used to cause the compiler to called the version of setTempo() whose first argument is the "tick", which was formerly an int. But now that "tick" is a Fraction instead of an int, it seems the compiler is preferring the version of setTempo() whose first argument is a pointer to a Segment.

Presumably the fix is to change the 0 to a Fraction zero. or for that matter pass in the segment we just took the trouble to grab.

As per the tooltip in QtCrteator, the score->setTempo(0, tempo); is the fraction variant void Score::setTempo(const Fraction& tick, qreal tempo) though. This may be fake...

I have to imagine the rules for deciding on which conversion to apply are complex enough that you could easily get different results from compiler to compiler, much less between compiler and IDE or between two IDE's.

Still, maybe using the segment version is better still? We have the segment...

Fix version
3.1.0