Playback of a score starting with a volta fails and leads to crash
2.3.1 version / Windows10
By working around this thread (https://musescore.org/en/node/274658), I found that the crash (when launching playback, or when pressing the "Rewind to the start position" button with this score: Miller Medley SCORE.mscz ) does not occur in early February 2018 before that several commits, concerning the improvements of the handling of voltas and repeats, were merged.
In other words, it works with this commit: b88c0ef
but crashes with this one: 20914dd
See with this single measure11, the "culprit": minimal.mscz
I can not reproduce from scratch from now.
However, without knowing whether this can be related, I notice an unexpected behavior (although the probability of this use case is near or equal to zero)
Therefore, from this test file ( volta1.mscz ) or that one ( volta1 (1).mscz ) with simple voltas, it is impossible that the playback starts at the beginning of the file with the measure including a volta. It begins obligatorily after, as if the measure with the volta was ignored.
I leave it to a minor priority for the moment being the probability of use.
Comments
It is still causing a crash, so is at least major
And happens since 2.2
Yes, of course, I agree, the attached file causes a crash. But the relation of cause and effect, being unable to reproduce from scratch from now, despite the mentioned unexpected behavior, was not clearly established. Whence my prudence!
Here's an older version of that score, last saved with 2.0.2, not with 2.3.1 like the score in the initial post.
And here an even older, last saved with MuseScore 2.0.0. Both crash in 2.2 and later
As noted in the thread form which that score came, something seems very wrong with the volta itself - upon read, it shows as being attached to notes (startElement and endElement are both of type ChordRest), and the crash is an assertion failure due to that fact. Not sure what about the volta made this happen.
The volta in question got saved with an anchor value of 0, which translates to Anchor::SEGMENT. Voltas are supposed to have an anchor value of Anchor::MEASURE, and it should not be possible to change this. We can easily set the anchor of a volta to Anchor::MEASURE after reading all of its properties, thus overriding any anchor value that it may have had in the file.
That "Miller Medley SCORE_2.mscz "had originally been created with a 2.0 developemt version, 1efc609, (shortly before?) the 1st 2.0 beta. Not sure we need to care about fixing this?
But then again we read that file properly prior to 2.2.
And the issue about files starting with a volta not playing back is something that should get fixed. But indeed is enough of a corner case that it doesn't need to get fixed for 2.x anymore
We're really looking at 2 different issues here, playback of scores starting with a volta and voltas that are not on measure boundaries for some strange reason
Came up again in: https://musescore.org/en/node/291268
From scratch:
1) Load this test file: test volta.mscz
2) Launch playback
Result: nothing
(by selecting the G measure 3, the playback starts but stop after)
3) Now, extend the volta 1 until the volta 2 (so, over the measure 3)
File at this step: test volta1.mscz
4) Launch playback
-------------> Crash
Of course it shouldn't crash, but voltas are (alternative) endings of (simple) repeats, so having that at the beginning of a score could be seen as misuse, and the system taking revenge for that.
See also: #289643: Crash when launching playback in presence of unexpected voltas
The fix for #291342: Crash on playing an empty score partially fixes this issue avoiding a crash. However it is not really clear what should be done to the repeat list itself in the cases like presented in this issue.
https://github.com/musescore/MuseScore/pull/6248 Seems to handle the start volta fine, but there might still be an issue with the skipped end volta (currently the last measure is added to the playback list in the last test build I have lying around) will further investivate.
Adjusted the above PR to now also correctly skip the volta at section end.
Fixed in branch 3.x, commit 246fc0df50
fix #274690 skip volta at end of section
Automatically closed -- issue fixed for 2 weeks with no activity.