Segmentation fault on adding lyrics

• Jan 24, 2014 - 18:36
Type
Functional
Severity
S2 - Critical
Status
closed
Project

I upgraded from the GIT this morning and compile with install. New version is rev: 391e02c

With the new version, on trying to add lyrics, I get a segmentation fault.

The segmentation fault occurs with both ctrl+L and Add/text/lyrics.

I created a new score (piano) with just four notes in it. Adding a lyric causes crash, just as before.

Here is the console output:-

/home/turtle$ mscore
false
QDateTime("") QDateTime("Fri Jan 24 11:50:47 2014")
internal error: shortcut not found

cannot find shortcut
TextStyleType not found
Articulation::setSubtype: empty subtype
Articulation::setSubtype: empty subtype
setDynamicType: other
Marker::read type 0
Marker::read type 1
Marker::read type 2
Marker::read type 3
Marker::read type 4
Marker::read type 5
Marker::read type 6
QWidget::setMinimumSize: (inspector/Ms::Inspector) Negative sizes (-331,0) are not possible
QWidget::setMinimumSize: (inspector/Ms::Inspector) Negative sizes (-331,0) are not possible
loop toggled 0 - 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 2067, resource id: 0, major code: 2 (ChangeWindowAttributes), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 2069, resource id: 0, major code: 20 (GetProperty), minor code: 0
expand voice: found Rest 4/4
addClone Rest at 480 1/4
addClone Rest at 960 1/2
expand voice: found Rest 1/4
expand voice: found Rest 1/2
addClone at 1440, 480
addClone Rest at 1440 1/4
expand voice: found Rest 1/4
Segmentation fault
/home/turtle$


Comments

Not just lyrics - also staff text, rehearsal marks, and presumably other types of text. Debugger shows abort() is being called, but I can't see a call stack. If I had to guess, I'd start by assuming this is related to the recent in text handling (replacing FreeSerifMScore with FreeSerif & using Bravura as a fallback font for music symbols). And I might further guess this is work in progress and will fix itself soon...

Tried setting breakpoints and single stepping where I could, but it seems the attempt to add the text is succeeding as far through the code as the debugger lets me step, and the abort happens after control returns to the Qt event loop (?). Which makes we wonder if the change is related to the change to Qt 5.2 on Windows. Except that I am thinking turtlevt is on Linux.

Can't be related to the recent change to Qt 5.2.0 for Windows, as it happens on dfabf91 too, and that still uses Qt 5.1.1 (and no newer nightly build is available, strangely)

No, unfortunately it does not fix the crash when entering lyrics, I've just tried.
It doesn't fix the crash with systems and staff text either

Trying to add a staff text or lyrics ends with
...
Debug: select element type 0(state 0) staff 1
Debug: MuseScore::cmd
Debug: ===startCmd()
Debug: UndoStack::beginMacro 0x22a0f4b0, UndoStack 0x218b43c0
Debug: ScoreView::cmd
Debug: select element type 0(state 1) staff 1
Debug: UndoStack::endMacro 0
Debug: 0x22c42d40 exitState
Debug: ===startCmd()
Debug: UndoStack::beginMacro 0x22f54058, UndoStack 0x218b43c0
Fatal: ASSERT: "!isEmpty()" in file C:/Qt/5.2.0/mingw48_32/include/QtCore/qlist.h, line 288
So it looks like that PR might be the right way to fix it, but is at the wrong spot?

Haven't yet got it to show me a full stack trace

The stack trace should be this one:
Breakpoint 2, QList<Ms::TFragment>::first (this=0x24614550) at C:/Qt/5.2.0/mingw48_32/include/QtCore/qlist.h:288
288 inline const T& first() const { Q_ASSERT(!isEmpty()); return at(0); }
(gdb) bt
#0 QList<Ms::TFragment>::first (this=0x24614550) at C:/Qt/5.2.0/mingw48_32/include/QtCore/qlist.h:288
#1 0x00a89d03 in QList<Ms::TFragment>::front (this=0x24614550) at C:/Qt/5.2.0/mingw48_32/include/QtCore/qlist.h:304
#2 0x00a79e57 in Ms::TLine::y (this=0x24614550) at C:/Git_packages/MuseScore/libmscore/simpletext.h:103
#3 0x0076fbae in Ms::SimpleText::cursorRect (this=0x23fb70e8)
at C:\Git_packages\MuseScore\libmscore\simpletext.cpp:564
#4 0x00770a04 in Ms::SimpleText::layout (this=0x23fb70e8) at C:\Git_packages\MuseScore\libmscore\simpletext.cpp:706
#5 0x00679614 in Ms::Text::layout1 (this=0x23fb70e8) at C:\Git_packages\MuseScore\libmscore\text.cpp:230
#6 0x00711ac4 in Ms::Lyrics::layout (this=0x23fb70e8) at C:\Git_packages\MuseScore\libmscore\lyrics.cpp:195
#7 0x00771059 in Ms::SimpleText::startEdit (this=0x23fb70e8, pt=...)
at C:\Git_packages\MuseScore\libmscore\simpletext.cpp:772
#8 0x0067c8e1 in Ms::Text::startEdit (this=0x23fb70e8, view=0x23aa4198, p=...)
at C:\Git_packages\MuseScore\libmscore\text.cpp:614
#9 0x0057ca47 in Ms::ScoreView::startEdit (this=0x23aa4180) at C:\Git_packages\MuseScore\mscore\editelement.cpp:71
#10 0x00401842 in Ms::ScoreView::qt_static_metacall (_o=0x23aa4180, _c=QMetaObject::InvokeMetaMethod, _id=13,
_a=0x28cebc) at C:\Git_packages\MuseScore\build.debug\mscore\moc_scoreview.cpp:189
#11 0x68a167bb in ZN11QMetaObject8activateEP7QObjectiiPPv ()
from C:\Git_packages\MuseScore\win32install\bin\Qt5Core.dll
#12 0x00000001 in ?? ()
#13 0x00000018 in ?? ()
#14 0x23dda188 in ?? ()
#15 0x68c90da0 in ZN24QAbstractDeclarativeData9destroyedE ()

In particular, the crash seems to be happening at line 564 of libmscore\simpletext.cpp.

Ciao,
ABL

Changing line 564 of libmscore\simpletext.cpp back to
qreal y = _cursor.line * h;
like it was before 95bf389ff, in addition to the change from PR #666 seems to fix the crash

Actually it seems to be 2 independent crashes, the 1st when the cursor gets created, the 2md when the first character gets entered.

Updated from Git this morning (yes! I am using Linux :-) ) and recompiled.

I am now able to add lyrics. Thanks everyone for the fix.