Bug 321576 - kwin crashed when changing the Colors Scheme.
Summary: kwin crashed when changing the Colors Scheme.
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 4.10.4
Platform: Mageia RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/111...
Keywords: drkonqi
: 321644 321719 322077 322308 322398 322535 322552 323556 325673 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-06-24 19:39 UTC by Shlomi Fish
Modified: 2013-10-05 17:43 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11
thomas.luebking: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shlomi Fish 2013-06-24 19:39:08 UTC
Application: kwin (4.10.4)
KDE Platform Version: 4.10.4
Qt Version: 4.8.4
Operating System: Linux 3.9.7-desktop-1.mga4 x86_64
Distribution: "Mageia 4"

-- Information about the crash:
- What I was doing when the application crashed:

I was changing the colour scheme in System Settings → Application Appearance → Colors to "Zion".

- Unusual behavior I noticed:

I briefly saw all the windows from all the virtual desktops.

- Custom settings of the application:

I have different widgets per desktop.

-- Backtrace:
Application: KWin (kwin), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
38		cmpq $-4095, %rax	/* Check %rax for error.  */
[Current thread is 1 (Thread 0x7f023eb92780 (LWP 2854))]

Thread 3 (Thread 0x7f021e1ca700 (LWP 2858)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f023ac66207 in QTWTF::TCMalloc_PageHeap::scavengerThread() () from /lib64/libQtScript.so.4
#2  0x00007f023ac66239 in QTWTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /lib64/libQtScript.so.4
#3  0x00007f02393c3d18 in start_thread (arg=0x7f021e1ca700) at pthread_create.c:308
#4  0x00007f023e3c57cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:110
#5  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f021ebe1700 (LWP 3602)):
[KCrash Handler]
#5  __memcmp_sse4_1 () at ../sysdeps/x86_64/multiarch/memcmp-sse4.S:74
#6  0x00007f023965500b in qstrcmp(QByteArray const&, QByteArray const&) () from /lib64/libQtCore.so.4
#7  0x00007f0239dcf883 in KConfig::isGroupImmutableImpl(QByteArray const&) const () from /lib64/libkdecore.so.5
#8  0x00007f0239dd8df2 in KConfigGroup::KConfigGroup(KSharedPtr<KSharedConfig> const&, char const*) () from /lib64/libkdecore.so.5
#9  0x00007f0239f1e4c3 in KSycocaPrivate::KSycocaPrivate() () from /lib64/libkdecore.so.5
#10 0x00007f0239f1e703 in KSycoca::KSycoca() () from /lib64/libkdecore.so.5
#11 0x00007f0239f1edcb in KSycoca::self() () from /lib64/libkdecore.so.5
#12 0x00007f0239f23a11 in KSycocaFactory::KSycocaFactory(KSycocaFactoryId) () from /lib64/libkdecore.so.5
#13 0x00007f0239eaebae in KServiceTypeFactory::KServiceTypeFactory() () from /lib64/libkdecore.so.5
#14 0x00007f0239eaeee3 in KServiceTypeFactory::self() () from /lib64/libkdecore.so.5
#15 0x00007f0239eaf31f in KServiceTypeProfiles::ensureParsed() [clone .part.14] () from /lib64/libkdecore.so.5
#16 0x00007f0239eb0e19 in KServiceTypeProfile::hasProfile(QString const&) () from /lib64/libkdecore.so.5
#17 0x00007f0239eb2fae in KServiceTypeTrader::query(QString const&, QString const&) const () from /lib64/libkdecore.so.5
#18 0x00007f023e76426e in QtConcurrent::StoredConstMemberFunctionPointerCall2<QList<KSharedPtr<KService> >, KServiceTypeTrader, QString const&, QString, QString const&, QString>::runFunctor() () from /lib64/libkdeinit4_kwin.so
#19 0x00007f023e765bd6 in QtConcurrent::RunFunctionTask<QList<KSharedPtr<KService> > >::run() () from /lib64/libkdeinit4_kwin.so
#20 0x00007f023964723d in QThreadPoolThread::run() () from /lib64/libQtCore.so.4
#21 0x00007f02396535ec in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4
#22 0x00007f02393c3d18 in start_thread (arg=0x7f021ebe1700) at pthread_create.c:308
#23 0x00007f023e3c57cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:110
#24 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f023eb92780 (LWP 2854)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f0239652094 in QMutexPrivate::wait(int) () from /lib64/libQtCore.so.4
#2  0x00007f023964e2a5 in QMutex::lockInternal() () from /lib64/libQtCore.so.4
#3  0x00007f0239eb0e11 in KServiceTypeProfile::hasProfile(QString const&) () from /lib64/libkdecore.so.5
#4  0x00007f0239eb2fae in KServiceTypeTrader::query(QString const&, QString const&) const () from /lib64/libkdecore.so.5
#5  0x00007f023e76cd30 in KWin::Scripting::queryScriptsToLoad() () from /lib64/libkdeinit4_kwin.so
#6  0x00007f023e76d924 in KWin::Scripting::start() () from /lib64/libkdeinit4_kwin.so
#7  0x00007f023e76dac5 in KWin::Scripting::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /lib64/libkdeinit4_kwin.so
#8  0x00007f023976562f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /lib64/libQtCore.so.4
#9  0x00007f023e6c8faa in KWin::Workspace::slotReconfigure() () from /lib64/libkdeinit4_kwin.so
#10 0x00007f023e6cf08a in KWin::Workspace::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /lib64/libkdeinit4_kwin.so
#11 0x00007f023976562f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /lib64/libQtCore.so.4
#12 0x00007f023976493c in QObject::event(QEvent*) () from /lib64/libQtCore.so.4
#13 0x00007f02388e530c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQtGui.so.4
#14 0x00007f02388e978a in QApplication::notify(QObject*, QEvent*) () from /lib64/libQtGui.so.4
#15 0x00007f023deb10f6 in KApplication::notify(QObject*, QEvent*) () from /lib64/libkdeui.so.5
#16 0x00007f023975020e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /lib64/libQtCore.so.4
#17 0x00007f0239780e32 in QTimerInfoList::activateTimers() () from /lib64/libQtCore.so.4
#18 0x00007f0239780fe8 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#19 0x00007f023898616f in QEventDispatcherX11::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtGui.so.4
#20 0x00007f023974ef5f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#21 0x00007f023974f1e8 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#22 0x00007f0239753fd8 in QCoreApplication::exec() () from /lib64/libQtCore.so.4
#23 0x00007f023e6efb4a in kdemain () from /lib64/libkdeinit4_kwin.so
#24 0x00007f023e2f7ba5 in __libc_start_main (main=0x400720 <main>, argc=3, ubp_av=0x7fff5a6e8bc8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff5a6e8bb8) at libc-start.c:258
#25 0x0000000000400751 in _start ()

This bug may be a duplicate of or related to bug 305361.

Possible duplicates by query: bug 306405.

Reported using DrKonqi
Comment 1 Thomas Lübking 2013-06-24 20:04:26 UTC
It's because effects.cpp EffectsHandlerImpl::reconfigure() calls KServiceTypeTrader::query() threaded - as scritpting did (and now still does in parallel, causing this crash because KConfigGroup is not *sigh*  ;-)
Comment 2 Thomas Lübking 2013-06-26 17:36:33 UTC
*** Bug 321644 has been marked as a duplicate of this bug. ***
Comment 3 Thomas Lübking 2013-06-28 17:40:58 UTC
*** Bug 321719 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Lübking 2013-07-08 17:15:35 UTC
Git commit a2bab28a2ce61b8714349665b553cab8d5888fa7 by Thomas Lübking.
Committed on 02/07/2013 at 21:06.
Pushed by luebking into branch 'master'.

don't query effects threaded

calls sycoca/kconfiggroup...
FIXED-IN: 4.11
REVIEW: 111374

M  +1    -0    kwin/effects.cpp

http://commits.kde.org/kde-workspace/a2bab28a2ce61b8714349665b553cab8d5888fa7
Comment 5 Thomas Lübking 2013-07-13 11:46:59 UTC
*** Bug 322308 has been marked as a duplicate of this bug. ***
Comment 6 Hrvoje Senjan 2013-07-14 23:11:35 UTC
@Thomas, fix safe for 4.10 backport?
Comment 7 Martin Flöser 2013-07-15 06:38:28 UTC
> fix safe for 4.10 backport?
There won't be another 4.10 release
Comment 8 Thomas Lübking 2013-07-15 07:17:55 UTC
Distros can still pick it up*

The patch is safe (just waits until a thread finished, no races expectable) but i've no idea whether it applies.
Maybe remove the empty line below the function to restore line numbers (unless there's a dozen of patches anyway)

*Yes, I kow....
Comment 9 Hrvoje Senjan 2013-07-15 11:47:07 UTC
It would go(?):
@@ -186,6 +186,7 @@ void EffectsHandlerImpl::reconfigure()
     QFutureWatcher<KService::List> *watcher = new QFutureWatcher<KService::List>(this);
     connect(watcher, SIGNAL(finished()), this, SLOT(slotEffectsQueried()));
     watcher->setFuture(QtConcurrent::run(KServiceTypeTrader::self(), &KServiceTypeTrader::query, QString("KWin/Effect"), QString()));
+    watcher->waitForFinished(); // TODO: remove once KConfigGroup is thread safe, bug #321576
 }
 
 void EffectsHandlerImpl::slotEffectsQueried()

@Martin, aware of it ;-)
Patch *to me* seemed like a good candidate for adding to 4.10 packages, that was the intention of the question. Off course, if you two think it's a bad idea, i certainly won't add it.
Comment 10 Martin Flöser 2013-07-15 12:00:21 UTC
> Patch *to me* seemed like a good candidate for adding to 4.10 packages, that
> was the intention of the question. Off course, if you two think it's a bad
> idea, i certainly won't add it.
ah, sorry that was a misunderstanding. Yes, that is a safe and good candidate 
for inclusion.
Comment 11 Thomas Lübking 2013-07-15 16:59:15 UTC
(In reply to comment #9)
> It would go(?):

The patch is correct and trivial enough to be safe, but if you intend to ship it to many ppl. you can do us a favor by 

+    watcher->waitForFinished(); // TODO: remove once KConfigGroup is thread safe, bug #321576
}
-  
 void EffectsHandlerImpl::slotEffectsQueried()

Ie. remove the one line to restore line numbers in backtraces (unless, as mentioned, the file differs from the vanilla anyway)
Comment 12 Thomas Lübking 2013-07-15 17:02:08 UTC
*** Bug 322398 has been marked as a duplicate of this bug. ***
Comment 13 Hrvoje Senjan 2013-07-15 17:32:48 UTC
(In reply to comment #10)
> ah, sorry that was a misunderstanding. 
Well, i guess i could have explained my intention in the first place :-)

>Yes, that is a safe and good
> candidate 
> for inclusion.

Good :-)

(In reply to comment #11)
> (In reply to comment #9)
> > It would go(?):
> 
> The patch is correct and trivial enough to be safe, but if you intend to
> ship it to many ppl. you can do us a favor by 

OK, adjusted, thanks for the hint (haven't thought about that).

Sorry for nagging you, and if this was inappropriate to discuss here. And off course, thanks for the input.

P.S.
(if it matters, distro in question is openSUSE 12.3 - for potential future reports. Though it'll take some time for it to turn up in the update channel)
Comment 14 Thomas Lübking 2013-07-15 18:04:44 UTC
(In reply to comment #13)

> Sorry for nagging you, and if this was inappropriate to discuss here. And
> off course, thanks for the input.

No, i personally consider this the way it should be.
Instead of "risking" a backport, you rather asked on a public channel that's read by the maintainer and all relevant developers (and records the process)

Also the bug is fixed and closed, so any "spam" (actually related discussion) is pretty harmless (there's nothing we still really need to track and no ongoing interrogatio on the issue would be disturbed)
Comment 15 Thomas Lübking 2013-07-18 18:29:26 UTC
*** Bug 322535 has been marked as a duplicate of this bug. ***
Comment 16 Thomas Lübking 2013-07-19 07:01:19 UTC
*** Bug 322552 has been marked as a duplicate of this bug. ***
Comment 17 Thomas Lübking 2013-08-15 18:29:53 UTC
*** Bug 323556 has been marked as a duplicate of this bug. ***
Comment 18 Thomas Lübking 2013-08-28 19:21:51 UTC
*** Bug 322077 has been marked as a duplicate of this bug. ***
Comment 19 Thomas Lübking 2013-10-05 17:43:49 UTC
*** Bug 325673 has been marked as a duplicate of this bug. ***