Musescore closes without warning

• Feb 15, 2025 - 16:31

this is so confusing! whenever i paste something into a measure, i press 6 on my keyboard, then 7 and then it closes without warning! if i haven't saved in a while then i would have to redo everything!

other information that might not be necessary:
i use the most latest version of musescore 4.4.4
i notice this happening when i'm editing the guitar in my score
picture isn't related to the problem lol

Attachment Size
Screenshot 2025-02-15 113034.png 10.6 KB

Comments

"picture isn't related to the problem lol"
So please attach the score (.mscz file) so we can investigate and help you.

In reply to by subaccomg

Confirmed.

This scenario is enough: test.mscz
scenario.jpg

  1. Copy-paste the first measure in the second (a third measure is a necessary condition, otherwise no crash)
  2. Press 6
  3. Press 7
    ... Crash

Out of curiosity, what is your purpose in typing the 6 and 7 keys, which are used to determine the choice of duration before (generally) inputting notes.

In reply to by cadiz1

Stack trace:


MuseScore4.exe!std::vector>::size() Line 1873 C++
> MuseScore4.exe!mu::engraving::Segment::element(unsigned __int64 track) Line 615 C++
MuseScore4.exe!mu::engraving::findLinkedChord(mu::engraving::Chord * c, mu::engraving::Staff * nstaff) Line 5530 C++
MuseScore4.exe!mu::engraving::Score::undoAddElement(mu::engraving::EngravingItem * element, bool addToLinkedStaves, bool ctrlModifier, mu::engraving::EngravingItem * elementToRelink) Line 6495 C++
MuseScore4.exe!mu::engraving::Score::addChord(const mu::engraving::Fraction & tick, mu::engraving::TDuration d, mu::engraving::Chord * oc, bool genTie, mu::engraving::Tuplet * tuplet) Line 406 C++
MuseScore4.exe!mu::engraving::Score::changeCRlen(mu::engraving::ChordRest * cr, const mu::engraving::Fraction & dstF, bool fillWithRest) Line 1767 C++
MuseScore4.exe!mu::engraving::Score::changeCRlen(mu::engraving::ChordRest * cr, const mu::engraving::TDuration & d) Line 1639 C++
MuseScore4.exe!mu::engraving::Score::padToggle(mu::engraving::Pad p, bool toggleForSelectionOnly) Line 3327 C++
MuseScore4.exe!mu::notation::NotationNoteInput::padNote(const mu::engraving::Pad & pad) Line 459 C++
MuseScore4.exe!mu::notation::NotationActionController::padNote(const mu::engraving::Pad & pad) Line 832 C++
MuseScore4.exe!mu::notation::NotationActionController::registerPadNoteAction::__l2::::operator()() Line 2338 C++
[External Code]
MuseScore4.exe!muse::actions::IActionsDispatcher::reg::__l2::::operator()(const std::string & __formal, const muse::actions::ActionData & __formal) Line 56 C++
[External Code]
MuseScore4.exe!muse::actions::ActionsDispatcher::doDispatch(const std::map,std::less,std::allocator>>>,std::less,std::allocator,std::less,std::allocator>>>>>> & clients, const std::string & actionCode, const muse::actions::ActionData & data) Line 118 C++
MuseScore4.exe!muse::actions::ActionsDispatcher::dispatch(const std::string & actionCode, const muse::actions::ActionData & data) Line 68 C++
MuseScore4.exe!muse::actions::ActionsDispatcher::dispatch(const std::string & actionCode) Line 46 C++
MuseScore4.exe!muse::shortcuts::ShortcutsController::activate(const std::string & sequence) Line 44 C++
MuseScore4.exe!muse::shortcuts::ShortcutsInstanceModel::doActivate(const QString & seq) Line 89 C++
MuseScore4.exe!muse::shortcuts::ShortcutsInstanceModel::activate(const QString & seq) Line 58 C++
MuseScore4.exe!muse::shortcuts::ShortcutsInstanceModel::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 93 C++
MuseScore4.exe!muse::shortcuts::ShortcutsInstanceModel::qt_metacall(QMetaObject::Call _c, int _id, void * * _a) Line 170 C++
[External Code]
MuseScore4.exe!main(int argc, char * * argv) Line 206 C++
[External Code]

In reply to by cadiz1

First obvious fix is

diff --git a/src/engraving/dom/edit.cpp b/src/engraving/dom/edit.cpp
index 1632c0c396..2d1b3f15bf 100644
--- a/src/engraving/dom/edit.cpp
+++ b/src/engraving/dom/edit.cpp
@@ -5527,7 +5527,7 @@ static Chord* findLinkedChord(Chord* c, Staff* nstaff)
     }
     Measure* nm = nstaff->score()->tick2measure(s->tick());
     Segment* ns = nm->findSegment(s->segmentType(), s->tick());
-    EngravingItem* ne = ns->element(dtrack);
+    EngravingItem* ne = ns ? ns->element(dtrack) : nullptr;
     if (!ne || !ne->isChord()) {
         return 0;
     }

But that may not be enough or too late.
Next it fails at an assertion, which means only in Debug mode

            Chord* c1 = findLinkedChord(cr1, score->staff(staffIdx));
            Chord* c2 = findLinkedChord(cr2, score->staff(staffIdx + sm));
 
            IF_ASSERT_FAILED(c1) {
                return;
            }

There may be something else going on, also.
In the three measure score by cadiz1, select the 2nd measure instead. Now hit "6". On my system the first quarter note is changed into a half note. The other notes are pushed one beat to the right. There is now a note on beat one of measure three. I would have expected two half notes to appear in measure two. So a result, I'm not surprised there is a crash when you try to make that measure (2) a whole note, by pushing 7. What about the extra note in the next measure?
And why press 6 first anyway? Even if by mistake. I might press a note instead of a measure.

Do you still have an unanswered question? Please log in first to post your question.