Crash on ending score playback
Reported version
3.0
Type
Functional
Frequency
Few
Severity
S2 - Critical
Reproducibility
Randomly
Status
closed
Regression
Yes
Workaround
No
Project
3.0, latest master, Ubuntu 18.04 LTS, ALSA. Crash ref: EDITOR-S
Reproduce:
open attached score. Play from anywhere, wait for playback to complete.
Result: crash
The stack trace is:
MuseScore3.exe 0x1407bff4e Ms::RepeatList::tick2utick(int) (c:\musescore\libmscore\repeatlist.cpp:224)
1 MuseScore3.exe 0x14068f91b Ms::Score::lastMeasure() (c:\musescore\libmscore\score.cpp:1681)
2 MuseScore3.exe 0x1402e8bff Ms::Seq::process(unsigned int,float *) (c:\musescore\mscore\seq.cpp:775)
Fix version
3.5.1
Comments
Good idea to attach the score...
Hmmm, that crashes in debug build only. Ignore that then...
@TheOtherJThistle it is better to attach the complete crash log here since almost no-one has access to the logs.
I don't know how to fix this, mainly since I can't reproduce it. But I think it would be fixed by updating the RepeatList to use fractions instead of ticks. At the moment, we're converting from fractions to ticks and then doing some arithmetic with that. This leads to inconsistencies appearing, such as us trying to find things at the last tick + 1, which doesn't exist.
Related to, or duplicate of #289857: Crash/assertion failure playing to end of score?
Looks like this one was reported first, though?
Maybe, if it is the same issue
I think they are the same issue, I'll close the other one.
This can be reproduced also when using chord playback with playback behavior "until next chord symbol", or "until measure end" if the chord is in the last measure.
See https://musescore.org/en/node/305134#comment-998256 and https://musescore.org/en/node/305134#comment-998362.
It hits an assert
Q_ASSERT(tick <= lastMeasure()->endTick());
at line 3742 of libmscore/score.cpp.The tick is set at line 476 of mscore/seq.cpp.
Back trace (only relevant part; it is the same for the file in this issue and the case of chord playback):
- 5 0x000055555ed1daf3 in Ms::MasterScore::setPos(Ms::POS, Ms::Fraction) (this=0x62c0000e8200, pos=Ms::POS::CURRENT, tick=...) at libmscore/score.cpp:3742
- 6 0x000055555c91d6dc in Ms::Score::setPos(Ms::POS, Ms::Fraction) (this=0x62c0000e8200, pos=Ms::POS::CURRENT, tick=...) at libmscore/score.h:1451
- 7 0x000055555c91d3b4 in Ms::Score::setPlayPos(Ms::Fraction const&) (this=0x62c0000e8200, tick=...) at libmscore/score.h:897
- 8 0x000055555c8fa057 in Ms::Seq::guiStop() (this=0x7fffc37ec800) at mscore/seq.cpp:477
- 9 0x000055555c8faa2d in Ms::Seq::seqMessage(int, int) (this=0x7fffc37ec800, msg=50, arg=0) at mscore/seq.cpp:507
- 10 0x000055555d230d29 in Ms::Seq::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x7fffc37ec800, _c=QMetaObject::InvokeMetaMethod, _id=7, _a=0x60300079c7b0) at build.debug/mscore/mscoreapp_autogen/EWIEGA46WW/moc_seq.cpp:160
I was able to reproduce your issue:
1) Factory settings
2) New score.
3) new note (any length) in last measure
4) add a sustain pedal to it.
5) play. It should crash when reaching the end.
Proof:
In a debug build or in the Alpha?
In reply to In a debug build or in the… by Jojo-Schmitz
Debug build
That indeed is a know issue, ans since quite long, IIRC ever since the change from tick to fractions
https://github.com/musescore/MuseScore/pull/6248
Fixed in branch 3.x, commit a537674e9a
fix #284887 crash on ending score playback in Debug builds
Automatically closed -- issue fixed for 2 weeks with no activity.