Saving a score with text line and re-opening causes crash

• Oct 28, 2013 - 11:09
Type
Functional
Severity
S2 - Critical
Status
closed
Project
Tags

1. Download this file .
2. Open in TuxGuitar 1.2.
3. Remove all instruments, except 'E. Guitar 4'.
4. 'Save'.
5. Open in MuseScore.
6. Drag Text line from palette to first note.
7. 'Save'.
8. 'Close'.
9. Open the mscz.

Result: Crash.

Note: See attached log. It is also reproducible if you skip the TuxGuitar steps.

Using MuseScore 2.0 Nightly Build (6df1e21) - Mac 10.7.5.


Comments

Two (or more) bugs seem to be acting together in this case.

1- When inserting a line (textline, ottava, etc..), i.e. a spanner with anchor ANCHOR_SEGMENT, the code is setting tick2 even if at tick equal to tick2 there is no actual segment (lines 226-231 of libmscore\cmd.cpp). Therefore, when saving the file, the endSpanner tag for that spanner is not written, and when loading back the file the ending position is automatically set to the end of the score (since tick2 = -1). And here comes into action the second bug:

2- When the line is read back, if a multimeasure rest is the final object of the score, as in the case of the E. Guitar4 part in this sample, the instruction at line 466 of libmscore\line.cpp
m = score()->tick2measure(t);
gives a measure m with parent = 0. This gives a system sys= 0, which causes the crash when it is accessed at line 546 of libmscore\line.cpp:
qreal y = (*sys)->>staves()->isEmpty() ? 0.0 : (*sys)->staffYpage(staffIdx());

3- A similar problem happens if you try to drop the text line over the rest in the first bar: in this case the crash happens at the same line of libmscore\line.cpp, since in this case the measure is set at line 461 (m = score()->tick2measure(t);) and the presence of the multimeasure rest (in the part) gives back a measure with system = 0.

Status (old) active needs info

Given that the mutli-measure rest bug (issue ##23863) has now been fixed, is this now fixed? Or at least a non-critical bug?

Status (old) needs info active

Unfortunately, this is an independent bug.
This bug could probably be partially solved by using tick2measureMM(t) instead of tick2measure(t), but the problem of non-existent endSpanner segment would still remain and the textline upon reopening would span over the full score.

Hi MarkRS

I don't think you do have to register - there is a link below the sheet music saying 'Download Guitar Pro Tab'.

Normally, it probably would be preferred to upload everything pertaining to the subject for improved presentation and accessibility, but I avoid doing it with these kinds of files because I didn't author them and they are often copyrighted.

Thanks!

You can download the gp3 file from that page by using the second button (the gray one), not the first button (i.e. the green one). It worked for me with Firefox (Firefox 26.0) under Windows 8.
See attached image.
I think the same crash happens for a file created from scratch:

  1. Open attached mscz file (text_line_example.mscz, created in 1.3)
  2. Drag Text line from palette to first note (the G half note)
  3. Save (or Save as...)
  4. Close the score
  5. Open the just saved mscz file -> Crash

Windows 8, commit 30e0623 (debug build).

Attachment Size
text_line_example.mscz 1.6 KB
button.png 95.28 KB

I don't see a crash using the file and steps from #7. But nor does it work correctly. Upon reload, the text line is gone, and the stems have flipped on the notes, at least until a Ctrl+A or other operation that forces a relayout.