I would say that the crash is somehow expected: the problem is a tuplet in voice 2 in the second staff of measure 100 with a missing note.
In particular, the tuplet has a ratio of 16/16, but it contains only 15 notes (one was deleted) of duration 1/32.
When summing the note durations, we obtain 15/32; multiplying it by 1/16 (from the ratio) to find the possible baselength duration gives 15/512. This duration is the one causing trouble, since 512th notes are not suported in 2.2.
Once again, the crash happens in TDuration::isValid because the tuplet is an incomplete second voice tuplet.
See https://musescore.org/en/node/271554#comment-831373
In master it seems to graciously exit the sanitize function without sanitizing the tuplet (i.e. isValid returns the expected false instead of crashing).
And the best way to solve the crash is exactly what Marc is proposing in https://musescore.org/en/node/271131 i.e. adding a check t.isValid().
If the fraction is shorter than 1/128 (among other cases of invalid durations), the output of function truncateToFraction is DurationType::V_INVALID, see here: https://github.com/musescore/MuseScore/blob/00c1d417f7e59d578ba2798559a…
therefore in those cases t.fraction() gives "fraction" 0/0; the simple check t.isValid() prevents arithmetic operations on 0/0 indeterminate form.
In master shorter durations are supported, that's why it is not crashing for these files: https://github.com/musescore/MuseScore/blob/287f99ddccdfe04551c2353a396…
It would crash only for properly tailored extremely short tuplet with non-reduced ratio and missing elements (i.e. for computed incomplete tuplet durations which multiplied by the inverse of tuplet ratio would give a denominator > 1024).
That's why the check t.isValid() should go also to master.
See https://github.com/musescore/MuseScore/pull/3730
Since 2.3 release candidate appears to be imminent, I think this fix should go into 2.3.
(It reduces to a simple check that t is not a V_INVALID duration type, so no negative side efffects)
Comments
I would say that the crash is somehow expected: the problem is a tuplet in voice 2 in the second staff of measure 100 with a missing note.
In particular, the tuplet has a ratio of 16/16, but it contains only 15 notes (one was deleted) of duration 1/32.
When summing the note durations, we obtain 15/32; multiplying it by 1/16 (from the ratio) to find the possible baselength duration gives 15/512. This duration is the one causing trouble, since 512th notes are not suported in 2.2.
Seems to have come up again in https://musescore.org/en/node/271554
Once again, the crash happens in TDuration::isValid because the tuplet is an incomplete second voice tuplet.
See https://musescore.org/en/node/271554#comment-831373
In master it seems to graciously exit the sanitize function without sanitizing the tuplet (i.e. isValid returns the expected false instead of crashing).
Not a regression in 2.3, but in 2.2
And the best way to solve the crash is exactly what Marc is proposing in https://musescore.org/en/node/271131 i.e. adding a check t.isValid().
If the fraction is shorter than 1/128 (among other cases of invalid durations), the output of function truncateToFraction is
DurationType::V_INVALID
, see here:https://github.com/musescore/MuseScore/blob/00c1d417f7e59d578ba2798559a…
therefore in those cases t.fraction() gives "fraction" 0/0; the simple check t.isValid() prevents arithmetic operations on 0/0 indeterminate form.
In master shorter durations are supported, that's why it is not crashing for these files:
https://github.com/musescore/MuseScore/blob/287f99ddccdfe04551c2353a396…
It would crash only for properly tailored extremely short tuplet with non-reduced ratio and missing elements (i.e. for computed incomplete tuplet durations which multiplied by the inverse of tuplet ratio would give a denominator > 1024).
That's why the check t.isValid() should go also to master.
https://github.com/musescore/MuseScore/pull/3730
See https://github.com/musescore/MuseScore/pull/3730
Since 2.3 release candidate appears to be imminent, I think this fix should go into 2.3.
(It reduces to a simple check that t is not a V_INVALID duration type, so no negative side efffects)
Fixed in branch master, commit 5836ffb6ce
fix #271161 crashes on certain tuplets due to failure to sanitize; fix proposed by Marc Sabatella
Fixed in branch master, commit 5437513694
Merge pull request #3730 from AntonioBL/tupletcrash
fix #271161 crashes on certain tuplets due to failure to sanitize; fi…
reopen for 2.3
Fixed in branch 2.3, commit fd7ee53f26
fix #271161 crashes on certain tuplets due to failure to sanitize
manualy merged from master, see https://github.com/musescore/MuseScore/pull/3730
Automatically closed -- issue fixed for 2 weeks with no activity.