Assertion failure on adding instrument change in score with parts
Reported version
3.0
Priority
P1 - High
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
This is certainly related to my parts playback patch so I'll probably work on this issue, this page is mostly to describe it.
Steps to reproduce:
1) Create a new score, for example, treble clef.
2) Create parts.
3) Drag an instrument change to any rest in master score.
Result: assertion failure in midimapping.cpp
Not sure whether this issue has any practical implications for scores playback but it would be better to handle such cases correctly.
Fix version
3.5.0
Comments
See also #286961: Instrument changing in the parts causes crash
Issue could be reproduced in 3.3 only, not in earlier version of MuseScore and also not in 3.4.
Can you confirm it still an issue in 3.4?
Indeed the issue doesn't happen anymore.
It is still an issue, it is an assertion failure so happens only in debug builds. This does not affect release builds but may indicate that something goes potentially wrong which may lead to actual problems in some corner cases.
But I don't see a message when debugging?
it needs to be a Debug build, not Release or RelWithDebInfo for those asserts to show
It is not a plain messeg then, but the abrupt end and death of the program
I see the offending assert
Q_ASSERT(p->instruments()->size() == masterPart->instruments()->size());
(inmidimapping.cpp:149
) but I'm wandering why this assert is there is the first place :-(.esp. as this is supposed to happen in parts, which practically always will have less staves then the master score.
So it's actually not related to instrument change?
Well, an instrument change adds an instrument, at least as far as MIDI is concerned
So I guess this assertion is unneeded then?
Fixed in branch master, commit 684df202c6
_fix #286842: fix assertion failure on adding instrument change to score with parts
Ensure that MIDI mapping gets rebuilt after the correct structure
of instruments has been established for all parts._
Automatically closed -- issue fixed for 2 weeks with no activity.