Crash when creating tuplet out of note with hyphenated / extended lyric
Pls check this with the attached file:
Open the file , select first note and hit Ctrl-3 to make a triplet.
MuseScore crashes imediately.
GIT commit: f51dc11
Attachment | Size |
---|---|
Rockin_Around_the_Christmas_Tree_4.mscz | 24.13 KB |
Comments
On Vista / f51dc11 does not happen
add more information (OS)
Not on Windows 7 (Enterprise, 64bit) either
Crashes for me on current development build on Ubuntu. The crash occurs trying to draw the current score view, in ScoreView::paint(). I have tracked it down to the root cause: creating the tuplet deletes the note and the lyric attached to it, but the dash is not removed properly. It seems it is deleted but still stays on the list of elements for the page.
Here are steps to reproduce from scratch:
1) my first score
2) enter two quarter notes
3) enter lyrics "hel - lo"
4) click first note
5) ctrl+3
Result: crash
Same thing if you enter a single syllable lyric and an extender (eg, "crash _ _") at step 3 instead of two syllables with hyphen.
EDIT: the fact that we're accessing garbage values (memory that has already been freed) explains why the crash is seen is on some systems but not others. It's basically like an uninitialized variable. But hopefully my description of the cause of the problem is sufficient to allow further debugging even on systems where it doesn't crash.
BTW, I don't think that it is normally "our" job to remove elements from a page's bsp tree when we remove elements. This list is normnally rebuilt from scratch when necessary as far as I know. I think the problem is that in this particular case, it is not - I think it the forcing into note entry mode in Score::cdmCreateTuplet() that ultimately triggers the redraw before we have had a chance to relayout. Probably the solution is to add an explicit call to doLayout() or pehraps just rebuildBspTree() somewhere, like perhaps in Score::removeUnmanaged(), or maybe Score::cmdCreateTuplet() just before we post the "note-input" event.
https://github.com/musescore/MuseScore/pull/2350
Fixed in branch master, commit 0f90c7e4fe
fix #88221: crash on create tuplet with hyphenated lyric
Fixed in branch master, commit eb301e842d
Merge pull request #2394 from lasconic/fix-88221
fix #88221: crash on create tuplet with hyphenated lyric
Fixed in branch 2.0.3, commit 78ea57bb7f
fix #88221: crash on create tuplet with hyphenated lyric
Automatically closed -- issue fixed for 2 weeks with no activity.