Creating a 4-or-higher tuplet on a 512th or an 8-or-higher tuplet on a 256th crashes Musescore
S2 - Critical
Steps to reproduce the bug:
1) Create a 512-th note or rest
2) select the 512th and go to Add->Tuplet->Quadruplet (anything with a higher ratio, like quintuplet or sextuplet will also work. Triplets however do work as intended, creating 1024th-triplets.)
3) when trying to split the 512th into the x-tuplet, musescore will crash instead.
Expected behavior: Creation of the appropriate tuplet, or an error message reading that the entered note value is too short (like what happens when trying to tuplet a 1024th)
Actual behavior: Musescore tries to create the tuplet, but crashes.
This bug was tested on (OS: macOS 10.16, Arch.: x86_64, MuseScore version (64-bit): 22.214.171.1248020600, revision: 3224f34)
Confirmed, same version, but on Windows 11.
Might be related to #319867: Crash when inserting notes of very short durations (256th or shorter)
And made possible via #43906: Support for entering 256th, 512th and 1024th notes/rests, so since 3.5
1 Ms::Fraction::reduce fraction.h 102 0xf348f5
2 Ms::Fraction::operator/= fraction.h 190 0xf34afc
3 Ms::Fraction::operator/ fraction.h 212 0x105f617
4 Ms::Score::cmdCreateTuplet edit.cpp 2788 0x982f67
5 Ms::ScoreView::cmdCreateTuplet scoreview.cpp 4364 0x65325f
6 Ms::ScoreView::cmdTuplet scoreview.cpp 4355 0x653205
7 Ms::ScoreView::cmdTuplet scoreview.cpp 4429 0x6536fe
8 Ms::ScoreView::::operator()(Ms::ScoreView *, const QByteArray &) const scoreview.cpp 2628 0x645153
9 std::_Function_handler>::_M_invoke(const std::_Any_data &, Ms::ScoreView *&&, const QByteArray &) std_function.h 297 0x662a1f
10 std::function::operator()(Ms::ScoreView *, QByteArray const&) const std_function.h 687 0x10cb44d
11 Ms::ScoreView::cmd scoreview.cpp 2890 0x64ae61
12 Ms::ScoreView::cmd scoreview.cpp 2089 0x642547
13 Ms::MuseScore::cmd musescore.cpp 6617 0x433e80
14 Ms::MuseScore::cmd musescore.cpp 6044 0x4307ca
15 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 610 0x5eef8d
16 void doActivate(QObject *, int, void * *) 0x68b978bb
17 Ms::ScoreTab::actionTriggered moc_scoretab.cpp 226 0x60e3f8
18 Ms::ScoreTab::qt_static_metacall moc_scoretab.cpp 111 0x60de67
19 void doActivate(QObject *, int, void * *) 0x68b978bb
20 QActionGroupPrivate::_q_actionTriggered() 0x327b4cc2
A "Division by 0" error
0, as both,
which does then bring up that "Tuplet too short" dialog
Not sure though how or whether at all this fits into the master branch (which will become MuseScore 4 shortly).
And no further 3.x is planned (but I'd still add the above fix to https://github.com/musescore/MuseScore/pull/9000)
the master branch crashes at the same spot and for the same reason (division by zero) but the above mentioned conde change can't get applied there.
musescore also crashes due to floating point exception trying to create a 6-or-higher tuplet on a dotted 512th
And probably on some more double-, triple- or quadruple-dotted short durations vs. high tuplet values too
In reply to And probably on some more… by Jojo-Schmitz
The above code change prevents that crash to, but also prevents a 4- and 5-let on a dotted 512th too, which would not crash.
I guess loosing those is no big harm vs. the prevented crashes.
Also the 2nd commit to https://github.com/musescore/MuseScore/pull/11560