Crash when undoing after deleting all measures

• Oct 7, 2014 - 05:37
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Steps:

  • Create a new piano score.
  • In the first measure, add notes for two voices (see the attached score).
  • Do "Ctrl+A" to select all.
  • Do "Ctrl+Delete" to delete all measures.
  • Do "Ctrl+Z" to undo.

MuseScore crashes.

Config: MuseScore e4004d6 on Xubuntu 14.10.

Attachment Size
test-undo.mscz 1.66 KB

Comments

I tried several times with your file, and from scratch. Expected behavior and no crash for me after undo (Windows7, and same commit e4004d6)

I can reproduce "sometimes" with the given file, but so far not if I try to reproduce one just like it. It seems sporadic. When it occurs, the crash is in Beam::pagePos(), on a call to Element::pageX(). The parent of the beam is a system, but the parent of the system seems to be garbage rather than a valid page element.

I'm kind of guessing we deleted the page prematurely and the address given is sometimes still valid and sometimes not.

Indeed, Marc, you hit the target. The page was deleted in function Score::doLayout() at line 1335 of libmscore/layout.cpp, therefore the parent() of the system is now garbage.
Attached the log from AddressSanitizer, commit 50a69211 Linux Mint 17.

Attachment Size
delete_all_undo_crash.txt 8.91 KB