Deleting multiline text in frames cause crash

• May 17, 2015 - 13:04
Type
Functional
Severity
S2 - Critical
Status
closed
Project
Tags

1. Download attached file.
2. Double click on the text to edit it.
3. Select multiple lines:
select.jpg
4. Press [DEL] or [← Backspace]
5. Crash.

Windows, 8911cdd

Attachment Size
Chrystus Pan wniebowstępuje.mscz 13.34 KB

Comments

I can reproduce, but so far, only with this particular score. Something seems wrong with the text here - I don't always get a crash, but when I do delete lines, the empty lines remain. Anything unusual about how it was created? Were any pre-release builds involved?

I can reproduce from scratch, but I did not yet understood (I hope soon...!) all the ins and outs of this issue. Tricky and weird issue!

The steps:
1) Create new score, or open this file: 7 test scratch.mscz
2) Add an horizontal frame
3) In this frame, add text
4) Leave a gap between the first line of text and the followings. Like this.
text.jpg
5) Now, remove this gap -> Escape
Inexpected result:
Inexpected.jpg

6) Return to the previous step ( #4) -> select ABC / ABC / JKL (see attached image below)
If you hit DEL, all the text frame disappears, and if you hit Backspace -> Crash
Sometimes, you receive the reverse result! Do not know why!
scratch 1.jpg

Some variations according to the context and the content of the text!

- With this file: 8 test scratch.mscz ,
you need to select the four ABC (after the gap always), sometimes select three ABC is sufficient! -> DEL or Backspace -> you receive a crash (or all text is deleted, or the two in same time!)

- To finish, with this file (different letters), all the steps works fine! 6 test scratch.mscz

Note that a part of this issue (step #5) fails also with a vertical frame,
Vertical frame.jpg
and "seems" work with frame text. Seems because sometimes not apparently.
Arhhh... once and for all, very unstable! :(
text frame.jpg

Well, I advance...
For the step #5, the conditions are:
Same letters: in the first text line, in second text line (after the gap), and in the last text line.
See this file to check: new test scratch.mscz
Indeed, you may replace in the third line ( D E F) by an other (A B C): no incidence, in the sense that it fails.
But if you replace the last line (A B C) by (D E F), it works...
For the explanation of the crash, I continue... at least I try!

So, now, I can reproduce constantly the crash.
1) Open this file: 1new test scratch-2.mscz
2) Switch to text edit mode to be at the start of the second text line
Text Edit .jpg
3) BackSpace
BackSpace.jpg
4) BEFORE escape, select three text lines: 2,3,4 (if you select only two lines, no issue...)
Select before Escape.jpg
5) Hit DEL or BackSpace

Result: crash, or all text deleted (or the two) : it depends, according to the "mood" of the file for an unknown reason (or due to the instability created by this issue?)
crash.jpg

To summarize, it seems that this part (step #5 always) of this issue - see image below - is crucial (but not the only one?) in the occurrence of the crash? This is my understanding for now.
step 5.jpg

An additional element of reflection:

Open this file: 7 test scratch.mscz

At the step # 5 (remove the gap between the first and the second text line -> Escape), you receive this.
ABC.jpg
So, as you see, the third line, besides the fact that it has not at the expected location, is the same as the second one (and the first also?)
Consequently, following the steps of the comment # 5: crash (or all text deleted) after DEL or BackSpace

- Now, open this file: 7 test scratch bis.mscz
First result: the third line is always in a bad place. But this text line is different from the second (and the first also?)
JKL.jpg
Result after the same steps in comment #5: it works!

I don't know if it's anywise related (if not, sory for misleading):

1. Enter some multiline text;
2. Select and copy it
3. Paste below
Wired.jpg
Effect: The whole text is pasted in one line. When you click outside textbox, line breaks appear as should.

After further investigation (always tricky and consuming time!), it seems that one must distinguish two related issues.

A) First, there is a very former issue that I can always reproduce in the time since a year (and probably before) e.g. with this Nightly: 56177c3, and these steps:

1) New score
2) Insert horizontal frame
3) Add text (the conditions are four similar text lines, with three letters minimum by line), but in contrast with the "second" issue (evocated in a second point below), adding a gap between the first and the second text line is not necessary to create this issue
1 may 19.jpg
4) So, select the last three text lines -> BackSpace
Result: correct, in the sense of these lines are deleted, and the first remains.

5) But, if you continue by: Escape -> Undo -> Re-select the same three last lines -> Del
Result: all the text frame is deleted (the four lines) and crash after Undo
may 19 crash.jpg
Note that if you reverse the scenario at the step #4: Begin to hit Del -> Escape -> Undo -> Re-select -> BackSpace -> Undo -> Crash

B) The "second" issue (remove the gap between the first and second text line -> Escape, with an inexpected result), see also comment #2, occurs very latest. I see a change around February 17-18.
first abc.jpg
second abc.jpg
E.g, I receive a correct result with this Nightly on February 16: 91a2d01
February 16.jpg
After checking, but I am not sure of that at all, this commit might be involved? https://github.com/musescore/MuseScore/commit/db79435ebdfe3d681dc9d2686…
To fix: #47636: Text in Text-Frames not being seen in parts