-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MU4 Issue] crash/fail-assert when add measure in empty part #13291
Comments
Damn it :) |
@lyrra I don't think that the linked commit is the one at fault. I just reverted it and the crash still occurs |
My bad, I meant what commit that was used for test. |
Ah no worries! Also its really really helpful if you follow the issue templates. Also it would be great if you could put the backtrace in a dropdown so as to not make issues long and hard to read for team members. Last thing, can you change the title to 'Crash when you add measure in empty part' :) |
Reproducing this is easy enough and it's not hard to see why it happens, the question is what the correct behaviour is - logically you can't add measures if a score has no staves, even if it did anything you wouldn't see the result in the current part score...v3 doesn't appear to even allow "empty" parts so it's not an issue there. The fix I tried that worked was to modify Selection::updateSelectedElements() to return early if
But that just makes it look like the command does nothing (actually it does work, and you can see it on the full score or other parts that actually have instruments assigned). |
#13298 should fix the crash at least |
tested with commit: 5377cef
Assertion hit:
Assertion failed: staffEnd > staffStart && staffEnd <= _score->nstaves(), file src/engraving/libmscore/select.cpp, line 662
backtrace:
#2 0x00007ffff567540f in __assert_fail_base (fmt=0x7ffff57de128 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=0x555557a4b0d8 "staffEnd > staffStart && staffEnd <= _score->nstaves()", file=0x555557a4ae88 "src/engraving/libmscore/select.cpp", line=662,
function=) at assert.c:92
#3 0x00007ffff5684662 in __GI___assert_fail (assertion=0x555557a4b0d8 "staffEnd > staffStart && staffEnd <= _score->nstaves()",
file=0x555557a4ae88 "src/engraving/libmscore/select.cpp", line=662,
function=0x555557a4b040 "void mu::engraving::Selection::setRange(mu::engraving::Segment*, mu::engraving::Segment*, mu::engraving::staff_idx_t, mu::engraving::staff_idx_t)")
at assert.c:101
#4 0x00005555559e0724 in mu::engraving::Selection::setRange (this=0x55555f9b8430, startSegment=0x0, endSegment=0x0, staffStart=0, staffEnd=0)
at src/engraving/libmscore/select.cpp:662
#5 0x000055555596d9ae in mu::engraving::Score::selectAdd (this=0x55555f9ad340, e=0x55555f6ba650) at src/engraving/libmscore/score.cpp:3425
#6 0x000055555596d58f in mu::engraving::Score::select (this=0x55555f9ad340, e=0x55555f6ba650, type=mu::engraving::SelectType::ADD, staffIdx=0)
at src/engraving/libmscore/score.cpp:3350
#7 0x000055555640ff97 in mu::notation::NotationInteraction::doSelect (this=0x55555d378410, elements=std::vector of length 1, capacity 1 = {...}, type=mu::engraving::SelectType::ADD,
staffIndex=0) at src/notation/internal/notationinteraction.cpp:738
#8 0x000055555641fab8 in mu::notation::NotationInteraction::addBoxes (this=0x55555d378410, boxType=mu::notation::BoxType::Measure, count=1, beforeBoxIndex=-1)
at src/notation/internal/notationinteraction.cpp:3334
#9 0x000055555641f744 in mu::notation::NotationInteraction::addBoxes (this=0x55555d378410, boxType=mu::notation::BoxType::Measure, count=1,
target=mu::notation::AddBoxesTarget::AtEndOfScore) at src/notation/internal/notationinteraction.cpp:3292
#10 0x0000555556405f93 in mu::notation::NotationActionController::addBoxes (this=0x555558b7b640, boxType=mu::notation::BoxType::Measure, count=1,
target=mu::notation::AddBoxesTarget::AtEndOfScore) at src/notation/internal/notationactioncontroller.cpp:1369
#11 0x0000555556405da3 in mu::notation::NotationActionController::addMeasures (this=0x555558b7b640, actionData=..., target=mu::notation::AddBoxesTarget::AtEndOfScore)
at src/notation/internal/notationactioncontroller.cpp:1358
The text was updated successfully, but these errors were encountered: