Crash on startup with Qt 5.14

• Jan 13, 2020 - 19:26
Reported version
3.3
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

Yes, I know that officially Qt 5.14 is not supported, but some distros are moving on to it as default. With this Qt version MuseScore crashes on startup (after the splash screen is displayed) with the following assert and backtrace:

ASSERT: "!d->isWidget" in file qtcore-5.14.9999/src/corelib/kernel/qobject.cpp, line 2109

#0 ff4de93a4 in raise () from /lib64/libc.so.6
#1 0x00007ffff4dd2536 in abort () from /lib64/libc.so.6
#2 0x00007ffff53f850d in qt_message_fatal (context=..., message=...)
at qtcore-5.14.9999/src/corelib/global/qlogging.cpp:1894
#3 QMessageLogger::fatal (this=this@entry=0x7fffffffcd90,
msg=msg@entry=0x7ffff56e74e8 "ASSERT: \"%s\" in file %s, line %d")
at qtcore-5.14.9999/src/corelib/global/qlogging.cpp:893
#4 0x00007ffff53f7405 in qt_assert (assertion=assertion@entry=0x7ffff57dc6b8 "!d->isWidget",
file=file@entry=0x7ffff57db4f8 "qtcore-5.14.9999/src/corelib/kernel/qobject.cpp", line=line@entry=2109)
at qtcore-5.14.9999/src/corelib/global/qlogging.h:90
#5 0x00007ffff5417a94 in QObject::setParent (this=, parent=)
at qtcore-5.14.9999/src/corelib/kernel/qobject.cpp:2106
#6 QObject::setParent (this=, parent=)
at qtcore-5.14.9999/src/corelib/kernel/qobject.cpp:2106
#7 0x0000555555cbfdbd in Ms::Workspace::readGlobalMenuBar (this=0x55555780f250)
at MuseScore-3.3.4/mscore/workspace.cpp:932
#8 0x0000555555cc15f0 in Ms::Workspace::read (this=0x55555780f250, e=...)
at MuseScore-3.3.4/mscore/workspace.cpp:877
#9 0x0000555555cbc6c4 in std::function::operator()(Ms::XmlReader&) const (
__args#0=..., this=0x7fffffffd2f0)
at /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/include/g++-v9/bits/std_function.h:685
#10 Ms::WorkspacesManager::readWorkspaceFile(QString const&, std::function)
(path=..., readWorkspace=...)
at MuseScore-3.3.4/mscore/workspace.cpp:661
#11 0x0000555555cc0f40 in Ms::Workspace::read (this=0x55555780f250)
at /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/include/g++-v9/new:174
#12 0x0000555555cc3cab in Ms::MuseScore::changeWorkspace (this=0x555558583070, p=0x55555780f250,
first=first@entry=true)
at MuseScore-3.3.4/mscore/workspace.cpp:223
#13 0x00005555558ee4b2 in main (argc=, av=)
at MuseScore-3.3.4/mscore/musescore.cpp:7760

System: Gentoo Linux 64-bit
Portage installed Qt version 5.14
GCC version 9.2.0 (Gentoo 9.2.0-r3 p4)


Comments

Not sure whether my earlier comment got accepted because of embedded URLs.

The problem seems to be that QObject::setParent() (which is not virtual) asserts if called for an object that is actually a QWidget. The attached patch fixes this by ensuring that QWidget::setParent() is called instead for the QMenu. There are two places where this happens, but only the call in Workspace::readGlobalMenuBar() appears to crash.

Attachment Size
musescore-3.4.4-qt5.14-crash.patch 1.51 KB

Hey, jmarten.

What exactly the reason of crash?

And why QMenuBar::clear() isn't enough? Did you tested it without 827 and 828?

Please, move local variable from the if condition.

Fix version
3.4.2