Crash on load if percussion staff with no drumset uses custom notehead
Steps to reproduce: try to open file
Expected behavior: file opens
Actual behavior: Musescore crashes
Operating system: Windows 7 Home Premium
I've read the instructions for creating a new issue, but being new to Musescore, I'm out of my depth. If you'll please see: https://musescore.org/en/node/305107 , I've been advised to create a new issue here.
Here's the stack trace another user created:
1 Ms::Drumset::noteHeads drumset.h 74 0xfcb832
2 Ms::Note::noteHead note.cpp 863 0x99da62
3 Ms::Note::stemUpSE note.cpp 999 0x99e0a0
4 Ms::Stem::layout stem.cpp 110 0xa26337
5 Ms::Stem::setLen stem.cpp 131 0xa26549
6 Ms::Chord::layoutStem1 chord.cpp 1499 0x8b8f7a
7 Ms::Score::getNextMeasure layout.cpp 2730 0x966e3c
8 Ms::Score::collectLinearSystem layoutlinear.cpp 177 0xb50d01
9 Ms::Score::layoutLinear layoutlinear.cpp 192 0xb50d98
10 Ms::Score::doLayoutRange layout.cpp 4498 0x971ecc
11 Ms::Score::update cmd.cpp 302 0xa9a776
12 Ms::Score::update score.h 750 0xea573a
13 Ms::readScore file.cpp 2491 0x4c3b22
14 Ms::MuseScore::readScore file.cpp 383 0x4b04dc
15 Ms::MuseScore::dropEvent musescore.cpp 2906 0x419f1c
16 QWidget::event(QEvent *) 0x2a935f18
17 QMainWindow::event(QEvent *) 0x2aa24feb
18 QApplicationPrivate::notify_helper(QObject *, QEvent *) 0x2a8f7bdc
19 QApplication::notify(QObject *, QEvent *) 0x2a8ffb04
20 QCoreApplication::forwardEvent(QObject *, QEvent *, QEvent *) 0x68a68fe8
Comments
Crash confirmed (and stack trace actually mine ;-))
but doesn't prevent you from using MuseScore at all, just that one score, so not a Blocker
The crash comes because there is a percussion staff that has lost its drumset definition, and a custom notehead is called for. No immediate crash without the custom notehead it seems, but the staff won't make sense either, and will likely cause problems later.
Not sure the best way to deal with these problems is. It's easy to make a staff lose its drumset, just uncheck "Use drumset" in the Mixer. Why is that even a thing?
It's easy enough to avoid the crash by checking for a null drumset when handling these custom noteheads in Note::noteHead() and returning some reasonable default instead. Probably better to detect load of a percussion staff with no drumset, though, and create a default one?
In reply to The crash comes because… by Marc Sabatella
Is there any chance that one of you pros could possibly go in and alter that notehead, creating a new version that I would be able to work on? As it stands, I can't even open the file to try to incorporate any of the changes you suggest. Thank you!
https://github.com/musescore/MuseScore/pull/6184
It's not really much of a fix, as the drumset is still missing so you'll get bad playback, but at least it allows the score to load and you can set up the drumset again with Change Instrument.
Fixed in branch 3.x, commit 340a120b18
_fix #305293: crash on load of score with missing drumset
Resolves: https://musescore.org/en/node/305293
We have many crashes with a stack trace showing a bad drumset
when calculating a custom notehead.
I don't know how these scores got into this state
(unless the user deliberately unchecked Drumset in the Mixer),
but I know we can prevent the crash
by returning a default notehead when the drumset is missing.
The drumset will still be missing,
so the user will need to do a change isntrument to set it up again,
but it beats a crash._
Fixed in branch 3.x, commit ee46acfd42
_Merge pull request #6184 from MarcSabatella/305293-no-drumset-crash
fix #305293: crash on load of score with missing drumset_
Fixed in branch 3.5beta, commit 82436a1560
_Merge pull request #6184 from MarcSabatella/305293-no-drumset-crash
fix #305293: crash on load of score with missing drumset_
Automatically closed -- issue fixed for 2 weeks with no activity.