Crash after adding text then exiting edit mode with no text

• Dec 29, 2018 - 20:22
Reported version
3.0
Priority
P1 - High
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
  • default score
  • click first rest
  • Ctrl+T
  • Esc without entering text

Result: you can see that the empty text element still exists and is selected according to Inspector, even though it has been removed from the score. Probably multiple ways to crash at this point, one is to press Alt+Right.


Comments

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.0.0.4839, revision: cf1f5ce

I cannot reproduce the crash right now (Alt + Right, or a few others). Only with debug build maybe.

Interesting, for me it crashes reliably on the actual release as well as my own builds. I take it, though, that after pressing Esc you still see the Inspector showing the text still selected?

Which text? I didn't enter any and your instructions didn't imply that? So no, nothing is seen after Esc.

Oh, yes, Inspector still shows the text part and I can easily imaging this to cause a crash later. Id doesn't for me though (Self built, MinGW)

Right - when you press Ctrl+T, t creates an empty text element, and it is selected, so the status bar and Inspector reflect that fact. When you hit Esc, the text element is removed from the score but remains selected, as shown in both the Inspector and status bar, and for me at least, the crash ln Alt+Right is reproducible in the release. Anyhow, originally this was blocking me from completing something else, but I got past that.

crashes like this don't surprise me too much if they are only sometimes reproducible.

The easy fix is to make sure we deselect this empty text element. What I don't know is if there are deeper problems too though - like if there are other pointers to it somewhere, if it is truly gone or somehow still represented on the "undo" stack, etc.

Status PR created fixed

Fixed in branch master, commit 82b16643cb

_fix #280878: adding vector empty check in function Ms::Segment::nextAnnotation(Ms::Element * e).

Fixed issue #280878 by adding vector empty check in function Ms::Segment::nextAnnotation(Ms::Element * e)._