Bug 1170872 - Qt creator is crashing with a segmentation fault since Tumbleweed 20200427
Qt creator is crashing with a segmentation fault since Tumbleweed 20200427
Status: RESOLVED UPSTREAM
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other
Current
x86-64 openSUSE Factory
: P5 - None : Critical (vote)
: ---
Assigned To: E-mail List
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-29 23:57 UTC by Marcelo Jimenez
Modified: 2020-04-30 18:47 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Good profiles.xml file (2.66 KB, application/xml)
2020-04-30 18:45 UTC, Marcelo Jimenez
Details
Bad profiles.xml file (19.62 KB, application/xml)
2020-04-30 18:47 UTC, Marcelo Jimenez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcelo Jimenez 2020-04-29 23:57:03 UTC
Qt creator is crashing with a segmentation fault  since Tumbleweed 20200427.

$ qtcreator                 
ConnectionServer error: "QLocalSocket: Remote closed" "/tmp/QtCreator-FprlYw/ClangBackEnd-23944"
[1]    23944 segmentation fault (core dumped)  qtcreator

Any clues, workarounds?
Regards.
Comment 1 Fabian Vogt 2020-04-30 13:17:48 UTC
It's working fine here, can you provide a backtrace?

zypper install --plus-content debug libqt5-creator-debuginfo
gdb -ex r -ex thread apply all bt -ex q --args qtcreator
Comment 2 Marcelo Jimenez 2020-04-30 14:28:11 UTC
Sure! Sorry for not posting before.

(gdb) bt
#0  0x00007fffe8e49a0d in QtSupport::BaseQtVersion::qtVersionString (this=0x0) at baseqtversion.cpp:1220
#1  0x00007fffe83b9957 in Android::AndroidConfig::ndkPathFromQtVersion (this=0x5555562b0560, version=...) at androidconfigurations.cpp:1023
#2  0x00007fffe83b9ba6 in Android::AndroidConfig::ndkLocation (this=0x5555562b0560, qtVersion=0x0) at androidconfigurations.cpp:913
#3  0x00007fffe83b65a9 in Android::AndroidConfigurations::updateAutomaticKitList () at androidconfigurations.cpp:1334
#4  0x00007fffe837d39f in Android::Internal::AndroidPlugin::kitsRestored (this=0x555555b81ad0) at androidplugin.cpp:181
#5  0x00007ffff6b169fe in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc8d0, r=0x555555b81ad0, this=0x55555639b5f0)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394
#6  doActivate<false> (sender=0x555556282a00, signal_index=9, argv=0x7fffffffc8d0) at kernel/qobject.cpp:3870
#7  0x00007fffe91a9d34 in ProjectExplorer::KitManager::restoreKits () at kitmanager.cpp:410
#8  0x00007fffe921d228 in ProjectExplorer::ProjectExplorerPlugin::restoreKits (this=<optimized out>) at projectexplorer.cpp:2022
#9  0x00007ffff6b0ea19 in QObject::event (this=0x5555556b61f0, e=0x5555570cae20) at kernel/qobject.cpp:1339
#10 0x00007ffff77adcaf in QApplicationPrivate::notify_helper (this=this@entry=0x5555555bcf60, receiver=receiver@entry=0x5555556b61f0, 
    e=e@entry=0x5555570cae20) at kernel/qapplication.cpp:3684
#11 0x00007ffff77b6df0 in QApplication::notify (this=0x7fffffffd3e0, receiver=0x5555556b61f0, e=0x5555570cae20) at kernel/qapplication.cpp:3430
#12 0x00007ffff6ae2002 in QCoreApplication::notifyInternal2 (receiver=0x5555556b61f0, event=0x5555570cae20)
    at ../../include/QtCore/../../src/corelib/kernel/qobject.h:153
#13 0x00007ffff6ae4794 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5555555b1bf0)
    at kernel/qcoreapplication.cpp:1832
#14 0x00007ffff6b39573 in postEventSourceDispatch (s=0x555555700420) at kernel/qeventdispatcher_glib.cpp:277
#15 0x00007ffff511e6e8 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#16 0x00007ffff511ea70 in ?? () from /usr/lib64/libglib-2.0.so.0
#17 0x00007ffff511eaff in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#18 0x00007ffff6b38bee in QEventDispatcherGlib::processEvents (this=0x555555702790, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#19 0x00007ffff6ae0b9b in QEventLoop::exec (this=this@entry=0x7fffffffd0d0, flags=..., flags@entry=...)
    at ../../include/QtCore/../../src/corelib/global/qflags.h:136
#20 0x00007ffff6ae8972 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#21 0x0000555555560012 in main (argc=<optimized out>, argv=<optimized out>) at main.cpp:709

Tell me if you need anything else.

Thank you for your quick reply.

Regards,
Marcelo.
Comment 3 Marcelo Jimenez 2020-04-30 14:36:30 UTC
I am not sure if it is related or helps, but since it looks like a null pointer in AndroidConfig, here is my AndroidConfigurations section in ~/.config/QtProject/QtCreator.ini:

[AndroidConfigurations]
AntLocation=/usr/bin/ant
AutomatiKitCreation=true
KeystoreLocation=
MakeExtraSearchDirectory=
NDKLocation=
OpenJDKLocation=/usr/lib64/jvm/java-1.8.0-openjdk
PartitionSize=1024
SDKLocation=
SDKManagerToolArgs=@Invalid()
ToolchainHost=
Comment 4 Marcelo Jimenez 2020-04-30 15:07:54 UTC
(In reply to Fabian Vogt from comment #1)
> It's working fine here, can you provide a backtrace?
> 
> zypper install --plus-content debug libqt5-creator-debuginfo

# zypper install --plus-content debug libqt5-creator-debuginfo
The flag --plus-content is not known.

So I installed libqt5-creator-debuginfo "manually"
'libqt5-creator-debuginfo' is already installed.
No update candidate for 'libqt5-creator-debuginfo-4.12.0-1.1.x86_64'. The highest available version is already installed.

> gdb -ex r -ex thread apply all bt -ex q --args qtcreator

I don't know why, but that command did not post the backtrace.

The backtrace you requested is actually a full backtrace, so I did it manually and I'll post it now:

Thread 7 (Thread 0x7fffc8fb3700 (LWP 22929)):
#0  0x00007ffff6573acf in __GI___poll (fds=0x7fffc0004e60, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff511e9de in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ffff511eaff in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ffff6b38bee in QEventDispatcherGlib::processEvents (this=0x7fffc0000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007ffff6ae0b9b in QEventLoop::exec (this=this@entry=0x7fffc8fb2da0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136
#5  0x00007ffff690b5ce in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#6  0x00007ffff690c698 in QThreadPrivate::start (arg=0x555556f11ea8) at thread/qthread_unix.cpp:342
#7  0x00007ffff5f9cefa in start_thread (arg=<optimized out>) at pthread_create.c:477
#8  0x00007ffff657e3bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7fffc97b4700 (LWP 22928)):
#0  0x00007ffff6573acf in __GI___poll (fds=0x7fffbc004e60, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff511e9de in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ffff511eaff in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ffff6b38bee in QEventDispatcherGlib::processEvents (this=0x7fffbc000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007ffff6ae0b9b in QEventLoop::exec (this=this@entry=0x7fffc97b3da0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136
#5  0x00007ffff690b5ce in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#6  0x00007ffff690c698 in QThreadPrivate::start (arg=0x555556c78b30) at thread/qthread_unix.cpp:342
#7  0x00007ffff5f9cefa in start_thread (arg=<optimized out>) at pthread_create.c:477
#8  0x00007ffff657e3bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7fffc9fb5700 (LWP 22926)):
#0  0x00007ffff6573acf in __GI___poll (fds=0x7fffc4006e70, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff511e9de in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ffff511eaff in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ffff6b38bee in QEventDispatcherGlib::processEvents (this=0x7fffc4007400, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007ffff6ae0b9b in QEventLoop::exec (this=this@entry=0x7fffc9fb4da0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136
--Type <RET> for more, q to quit, c to continue without paging--
#5  0x00007ffff690b5ce in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#6  0x00007ffff690c698 in QThreadPrivate::start (arg=0x5555560c86a0) at thread/qthread_unix.cpp:342
#7  0x00007ffff5f9cefa in start_thread (arg=<optimized out>) at pthread_create.c:477
#8  0x00007ffff657e3bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7ffff0af6700 (LWP 22906)):
#0  0x00007ffff6573acf in __GI___poll (fds=0x7fffe4011970, nfds=4, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff511e9de in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ffff511eaff in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ffff6b38bee in QEventDispatcherGlib::processEvents (this=0x7fffe4000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007ffff6ae0b9b in QEventLoop::exec (this=this@entry=0x7ffff0af5d70, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136
#5  0x00007ffff690b5ce in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#6  0x00007ffff2b13507 in ?? () from /usr/lib64/libQt5DBus.so.5
#7  0x00007ffff690c698 in QThreadPrivate::start (arg=0x7ffff2b95da0) at thread/qthread_unix.cpp:342
#8  0x00007ffff5f9cefa in start_thread (arg=<optimized out>) at pthread_create.c:477
#9  0x00007ffff657e3bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7ffff2977700 (LWP 22901)):
#0  0x00007ffff6573acf in __GI___poll (fds=0x7ffff2976ca8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff4b41772 in ?? () from /usr/lib64/libxcb.so.1
#2  0x00007ffff4b4243a in xcb_wait_for_event () from /usr/lib64/libxcb.so.1
#3  0x00007ffff2c47ab0 in QXcbEventQueue::run (this=0x5555555e16a0) at qxcbeventqueue.cpp:228
#4  0x00007ffff690c698 in QThreadPrivate::start (arg=0x5555555e16a0) at thread/qthread_unix.cpp:342
#5  0x00007ffff5f9cefa in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007ffff657e3bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ffff4b16800 (LWP 22895)):
#0  0x00007fffe88eba0d in QtSupport::BaseQtVersion::qtVersionString (this=0x0) at baseqtversion.cpp:1220
#1  0x00007fffe83b8957 in Android::AndroidConfig::ndkPathFromQtVersion (this=0x5555562b0a30, version=...) at androidconfigurations.cpp:1023
#2  0x00007fffe83b8ba6 in Android::AndroidConfig::ndkLocation (this=0x5555562b0a30, qtVersion=0x0) at androidconfigurations.cpp:913
#3  0x00007fffe83b55a9 in Android::AndroidConfigurations::updateAutomaticKitList () at androidconfigurations.cpp:1334
--Type <RET> for more, q to quit, c to continue without paging--
#4  0x00007fffe837c39f in Android::Internal::AndroidPlugin::kitsRestored (this=0x555555b83240) at androidplugin.cpp:181
#5  0x00007ffff6b169fe in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc8d0, r=0x555555b83240, this=0x555556390980) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394
#6  doActivate<false> (sender=0x555555ec8dd0, signal_index=9, argv=0x7fffffffc8d0) at kernel/qobject.cpp:3870
#7  0x00007fffe91a9d34 in ProjectExplorer::KitManager::restoreKits () at kitmanager.cpp:410
#8  0x00007fffe921d228 in ProjectExplorer::ProjectExplorerPlugin::restoreKits (this=<optimized out>) at projectexplorer.cpp:2022
#9  0x00007ffff6b0ea19 in QObject::event (this=0x5555556b9d10, e=0x5555570cb590) at kernel/qobject.cpp:1339
#10 0x00007ffff77adcaf in QApplicationPrivate::notify_helper (this=this@entry=0x5555555bcf60, receiver=receiver@entry=0x5555556b9d10, e=e@entry=0x5555570cb590) at kernel/qapplication.cpp:3684
#11 0x00007ffff77b6df0 in QApplication::notify (this=0x7fffffffd3e0, receiver=0x5555556b9d10, e=0x5555570cb590) at kernel/qapplication.cpp:3430
#12 0x00007ffff6ae2002 in QCoreApplication::notifyInternal2 (receiver=0x5555556b9d10, event=0x5555570cb590) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:153
#13 0x00007ffff6ae4794 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5555555b1bf0) at kernel/qcoreapplication.cpp:1832
#14 0x00007ffff6b39573 in postEventSourceDispatch (s=0x5555556ffba0) at kernel/qeventdispatcher_glib.cpp:277
#15 0x00007ffff511e6e8 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#16 0x00007ffff511ea70 in ?? () from /usr/lib64/libglib-2.0.so.0
#17 0x00007ffff511eaff in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#18 0x00007ffff6b38bee in QEventDispatcherGlib::processEvents (this=0x555555701f10, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#19 0x00007ffff6ae0b9b in QEventLoop::exec (this=this@entry=0x7fffffffd0d0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136
#20 0x00007ffff6ae8972 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#21 0x0000555555560012 in main (argc=<optimized out>, argv=<optimized out>) at main.cpp:709
(gdb)
Comment 5 Fabian Vogt 2020-04-30 17:18:49 UTC
Found a corresponding bug report upstream:

https://bugreports.qt.io/browse/QTCREATORBUG-23963

Apparently it's caused by a project with certain incompatible metadata.
Comment 6 Marcelo Jimenez 2020-04-30 18:06:51 UTC
When I start QT Creator, it does not open any project or sessions, it shows me a  session list from which I can choose from. I don't think that it parses all my projects. The link upstream does not resolve the issue as I have no way to find out what is the configuration or project that is causing it.
Comment 7 Marcelo Jimenez 2020-04-30 18:28:05 UTC
The following patch is a workaround for the crash. QT Creator is able to start after avoiding dereferencing a null pointer.

The real issue is why QtSupport::QtKitAspect::qtVersion(k) returned a null pointer.

diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp
index a574c4c123..73c7648f47 100644
--- a/src/plugins/android/androidconfigurations.cpp
+++ b/src/plugins/android/androidconfigurations.cpp
@@ -1331,7 +1331,11 @@ void AndroidConfigurations::updateAutomaticKitList()
 
     for (auto k: androidKits) {
         if (k->value(Constants::ANDROID_KIT_NDK).isNull() || k->value(Constants::ANDROID_KIT_SDK).isNull()) {
-            k->setValueSilently(Constants::ANDROID_KIT_NDK, currentConfig().ndkLocation(QtSupport::QtKitAspect::qtVersion(k)).toString());
+               const BaseQtVersion *bQtV = QtSupport::QtKitAspect::qtVersion(k);
+               if (!bQtV) {
+                       continue;
+               }
+            k->setValueSilently(Constants::ANDROID_KIT_NDK, currentConfig().ndkLocation(bQtV).toString());
             k->setValue(Constants::ANDROID_KIT_SDK, currentConfig().sdkLocation().toString());
         }
     }
Comment 8 Marcelo Jimenez 2020-04-30 18:45:45 UTC
Created attachment 837229 [details]
Good profiles.xml file
Comment 9 Marcelo Jimenez 2020-04-30 18:47:03 UTC
Created attachment 837230 [details]
Bad profiles.xml file
Comment 10 Marcelo Jimenez 2020-04-30 18:47:23 UTC
After some bruteforcing, I found that substituting the file ~/.config/QtProject.new/qtcreator/profiles.xml with a newly generated one does enable the bogus qtcreator to start.

I will attach both files so that any developer interested is able to find the diff.