See upstream bug for a full description. Reproducible: Always
@qt, there was some thought that this may be a Qt issue.
Created attachment 334784 [details, diff] Revert the offending commit Adding an arch specific hacky patch to work around the issue at least temporarily
Created attachment 334798 [details, diff] Revert offending commit (complete) Sorry, just noticed my previous patch was incomplete.
Created attachment 335314 [details, diff] Proposal for a qt-core revbump This turns out to be a Qt bug, see https://bugreports.qt-project.org/browse/QTBUG-29082 The attached patch revbumps qt-core to include a patch to workaround the issue by avoiding the problematic code path in QPropertyAnimation.
(In reply to comment #4) Where does that patch come from? Has it been submitted upstream?
(In reply to comment #5) > Where does that patch come from? Has it been submitted upstream? Sorry for the late reply, didn't get the notification. The patch is mine but there's no comment from upstream about a general fix yet.
Well the patch has to be submitted to gerrit (https://codereview.qt-project.org) to be properly reviewed, upstream stopped caring about patches in bugreports a long time ago.
(In reply to comment #7) > Well the patch has to be submitted to gerrit > (https://codereview.qt-project.org) to be properly reviewed, upstream > stopped caring about patches in bugreports a long time ago. ping?
Added a code review https://codereview.qt-project.org/46228
kde 4.10 is very near... I hope qt-core revbump with patch will happen very soon, if you don't want several hundreds duplicate bugreports
I just hit this after upgrading to kde 4.10. Can this patch be applied soon?
This is causing crashes in kde-base/plasma-workspace-4.10.0. If anyone has anything further to add to the comments on the code review, please add them.
*** Bug 456034 has been marked as a duplicate of this bug. ***
As a workaround (which may have unintended consequences, no idea) you can try upgrading to kde-base/plasma-workspace-4.10.0-r1 (kde overlay). This should not trigger the relevant codepath anymore.
I have a related issue with qt-core. I applied this patch, but it didn't fix the problem for me. I changed the optimization flags from -O2 to -Os and that fixed the issue. The -Os fix was mentioned in a bug that was marked a duplicate of this one upstream. I would open this as a separate bug if this wasn't the case. Not sure if the two issues are actually related.
It doesn't look like Qt upstream likes this patch, so we need a better solution.
(In reply to comment #14) > As a workaround (which may have unintended consequences, no idea) you can > try upgrading to kde-base/plasma-workspace-4.10.0-r1 (kde overlay). This > should not trigger the relevant codepath anymore. The proposed patch for kde-base/plasma-workspace-4.10.0-r1 solves the plasma-desktop crash, but then plasma-desktop eats 100% of CPU on my system. Only the recompilation of qt-code with -Os instead of -O2 solved both problems for me.
I confirm that compiling qt-core with -Os instead of -O2 resolves the problem. So this rather looks like a compiler bug. The kde 4.10 release is affected by that (https://bugs.kde.org/show_bug.cgi?id=314610) but KDE bugzilla closed the problem because it is not a kde problem. The only solutions so far seem to be masking kde 4.10 or change -O2 CXXFLAGS in qt-core or bomb the affected kde/qt codepieces with volatile keywords (they are casting stuff around and maybe the compiler interferes with that) or redesign whatever caused the problem. It is like a running gag: KDE releases a "stable" version that immediately crashes like nobody ever tested it once for five minutes.
(In reply to comment #14) > As a workaround (which may have unintended consequences, no idea) you can > try upgrading to kde-base/plasma-workspace-4.10.0-r1 (kde overlay). This > should not trigger the relevant codepath anymore. Now plasma-workspace works again, but after a few minutes, plasma-desktop is constantly hogging one core. My power station operator likes it ;)
*** Bug 456130 has been marked as a duplicate of this bug. ***
Same problem here. amd64 Tried x11-libs/qt-core-4.8.4-r1 but no change. If someone wants more info that will help, let me know.
(In reply to comment #17) > (In reply to comment #14) > > As a workaround (which may have unintended consequences, no idea) you can > > try upgrading to kde-base/plasma-workspace-4.10.0-r1 (kde overlay). This > > should not trigger the relevant codepath anymore. > > The proposed patch for kde-base/plasma-workspace-4.10.0-r1 solves the > plasma-desktop crash, but then plasma-desktop eats 100% of CPU on my system. > > Only the recompilation of qt-code with -Os instead of -O2 solved both > problems for me. OK... added the patch anyway, it's better than full crash. We still need to solve this otherwise though.
(In reply to comment #15) > I have a related issue with qt-core. I applied this patch, but it didn't fix > the problem for me. I changed the optimization flags from -O2 to -Os and > that fixed the issue. What patch did you apply that didn't solve the issue? The patch in plasma-desktop-4.10-r1?
(In reply to comment #18) > I confirm that compiling qt-core with -Os instead of -O2 resolves the > problem. So this rather looks like a compiler bug. Qt's code has an invalid read, there's no compiler bug here. Changing the -O flags just hides the problem away, but it is an invalid read in amd64, x86 and any other platform out there. > The kde 4.10 release is affected by that > (https://bugs.kde.org/show_bug.cgi?id=314610) but KDE bugzilla closed the > problem because it is not a kde problem. > The only solutions so far seem to be masking kde 4.10 or change -O2 CXXFLAGS > in qt-core or bomb the affected kde/qt codepieces with volatile keywords > (they are casting stuff around and maybe the compiler interferes with that) > or redesign whatever caused the problem. Invalid reads are... invalid. There's nothing to interfere with. > It is like a running gag: KDE releases a "stable" version that immediately > crashes like nobody ever tested it once for five minutes. It probably took me more than five minutes to debug the issue, open bug reports, prepare patches, call for a code review, alert packagers... While the quality process definitely failed here (badly) it is far from the situation you describe above.
I successfully emerged plasma-workspace-4.10.0-r1 and it resolved the segmentation fault. I'm not seeing any unusual CPU usage, but my CFLAGS (-O2 -march=native -pipe -ggdb) included debuging that persumable pre-empts the optimization flag. Thanks for the quick work!
*** Bug 456252 has been marked as a duplicate of this bug. ***
Created attachment 338438 [details, diff] Proposed patch for qt-core I have what I believe is a proper patch for this issue. Looking at the implementation as well as other call sites of QMetaObject::metacall, it seems that function requires an array of arguments as its last parameter. This patch fixes the call site in QPropertyAnimationPrivate::updateProperty to create and pass such an array, just as other call sites (e.g. in QDeclarativePropertyPrivate::writeEnumProperty) do. Warned by dilfridge's blog post, I've created this patch before updating to KDE 4.10. Interestingly, even without applying it (and with the unpatched plasma-workspace-4.10.0 installed), I haven't observed any crashes; so I'd appreciate someone who was/is seeing crashes applying it and reporting back (just put it in /etc/portage/patches/x11-libs/qt-core-4.8.4-r2/foo.patch and re-emerge qt-core). What I can say with certainty is that it applies fine, compiles fine, and KDE 4.10 runs fine afterwards. I'd be happy if someone who already has a Qt checkout and contributor account submitted this patch upstream for code review, saving me the trouble to do so ;-)
(In reply to comment #27) After some digging through Qt code, this patch actually looks correct to me too. I'd only not delete the comment and not change constData() to data().
(In reply to comment #27) > I'd > appreciate someone who was/is seeing crashes applying it and reporting back > (just put it in /etc/portage/patches/x11-libs/qt-core-4.8.4-r2/foo.patch and > re-emerge qt-core). I masked plasma-workspace-4.10.0-r1 and emerged the original version to make sure I could still make the crash happen. I then followed the instructions to apply the patch and emerged qt-core. With the patch installed the crash no longer occurs and everything else appears to function correctly.
(In reply to comment #27) > Created attachment 338438 [details, diff] [details, diff] > Proposed patch for qt-core > David E. Narváez already submitted a very similar patch to gerrit a few hours ago. We're waiting for review from upstream devs.
x11-libs/qt-core-4.8.4-r2 installed with CFLAGS="-Os -pipe -march=native" CXXFLAGS="${CFLAGS}" (see the -Os !) and kde-base/plasma-workspace-4.10.0 installed with my usual settings CFLAGS="-O2 -pipe -march=native" Everything's fine again. I won't update for a few weeks now. =)
(In reply to comment #31) > x11-libs/qt-core-4.8.4-r2 > > installed with > > CFLAGS="-Os -pipe -march=native" > CXXFLAGS="${CFLAGS}" > > (see the -Os !) > > and > > kde-base/plasma-workspace-4.10.0 > > installed with my usual settings CFLAGS="-O2 -pipe -march=native" > > > Everything's fine again. I won't update for a few weeks now. =) ACCEPT_KEYWORDS="~amd64" CHOST="x86_64-pc-linux-gnu" CFLAGS="-march=corei7 -O2 -pipe" CXXFLAGS="-march=corei7 -O2 -pipe" Installed all packages with above make.conf settings, including: x11-libs/qt-core-4.8.4-r1 kde-base/plasma-workspace-4.10.0 I ran KDE after removing ~/.kde4. No crashes. I added another system tray to the desktop for a total of 2. Still, no crashes.
(In reply to comment #32) > ACCEPT_KEYWORDS="~amd64" > CHOST="x86_64-pc-linux-gnu" > CFLAGS="-march=corei7 -O2 -pipe" > CXXFLAGS="-march=corei7 -O2 -pipe" > > Installed all packages with above make.conf settings, including: > x11-libs/qt-core-4.8.4-r1 > kde-base/plasma-workspace-4.10.0 > > I ran KDE after removing ~/.kde4. No crashes. I added another system tray to > the desktop for a total of 2. Still, no crashes. There are newer versions from the packages you mention. qt-core-4.8.4-r1 does not exist in the tree anymore and there's also plasma-workspace-4.10.0-r1 which contains patches that are supposed to fix the problem, but they don't. For me, the (temporary) solution was to compile qt-core with -Os and downgrade to plasma-workspace-4.10.0 (mask -r1) to make this work.
(In reply to comment #33) > There are newer versions from the packages you mention. qt-core-4.8.4-r1 > does not exist in the tree anymore and there's also > plasma-workspace-4.10.0-r1 which contains patches that are supposed to fix > the problem, but they don't. > > For me, the (temporary) solution was to compile qt-core with -Os and > downgrade to plasma-workspace-4.10.0 (mask -r1) to make this work. This is the point I was trying to make. I have the versions installed with which the problem is supposed to occur, but doesn't. I'll be masking the new -r2 and -r1 respectively in case the fixes break it for me.
It still is a qt bug. Dunno why we're hacking around with plasma-workspace instead since the bug is already indentified. :/
(In reply to comment #32 and #34) Do you use gcc 4.7 ? It seems the bug doesn't show with such a recent gcc. (note: gcc 4.7 is currently hard-masked)
(In reply to comment #35) > It still is a qt bug. Dunno why we're hacking around with plasma-workspace > instead since the bug is already indentified. :/ Because it's less risky to (try to) provide a workaround in an application than to meddle with a library that is used by a few hundred binaries on your system. I would be very happy if someone wrote a workaround for plasma-workspace that just does not trigger the bug anymore *as a workaround*. That being said, a bugfix for Qt is being developed.
(In reply to comment #36) > (In reply to comment #32 and #34) > > Do you use gcc 4.7 ? It seems the bug doesn't show with such a recent gcc. > > (note: gcc 4.7 is currently hard-masked) Indeed I am. I'm running 4.7.2 as per gcc-config.
Fixed in 4.8.4-r3. Thanks a lot to everyone involved, especially to David E. Narváez for writing the patch and submitting it upstream.
(In reply to comment #39) > Fixed in 4.8.4-r3. I think someone needs to revert this, right? *plasma-workspace-4.10.0-r1 (08 Feb 2013) 08 Feb 2013; Andreas K. Huettel <dilfridge@gentoo.org> +plasma-workspace-4.10.0-r1.ebuild, +files/plasma-workspace-4.10.0-norepeater.patch: Add workaround patch for plasma-workspace crash, see bug 450818 and kde bug 311751 comments 2 and 32.
(In reply to comment #40) > (In reply to comment #39) > > Fixed in 4.8.4-r3. > > I think someone needs to revert this, right? > > *plasma-workspace-4.10.0-r1 (08 Feb 2013) > > 08 Feb 2013; Andreas K. Huettel <dilfridge@gentoo.org> > +plasma-workspace-4.10.0-r1.ebuild, > +files/plasma-workspace-4.10.0-norepeater.patch: > Add workaround patch for plasma-workspace crash, see bug 450818 and kde bug > 311751 comments 2 and 32. Is this the cause of plasma-desktop topping one cpu core? I will mask this version and try again.
(In reply to comment #41) > (In reply to comment #40) > > (In reply to comment #39) > > > Fixed in 4.8.4-r3. > > > > I think someone needs to revert this, right? > > > > *plasma-workspace-4.10.0-r1 (08 Feb 2013) > > > > 08 Feb 2013; Andreas K. Huettel <dilfridge@gentoo.org> > > +plasma-workspace-4.10.0-r1.ebuild, > > +files/plasma-workspace-4.10.0-norepeater.patch: > > Add workaround patch for plasma-workspace crash, see bug 450818 and kde bug > > 311751 comments 2 and 32. > > Is this the cause of plasma-desktop topping one cpu core? I will mask this > version and try again. Yes, and it's gone now. (-r2 = -r0)
I might be doing something wrong but plasma-desktop still crashes at longin. I have the following versions: =kde-base/plasma-workspace-4.10.0-r2 =x11-libs/qt-core-4.8.4-r3
I just compiled kde 4.10 yesterday. And for me it crashes too. But I found the plugin it leading to crash. It is "paste" in the tray. Once activated, the plasma desktop crashes at login. It is same as mentioned in: https://bugs.kde.org/show_bug.cgi?id=311751#c59
(In reply to comment #44) > I just compiled kde 4.10 yesterday. And for me it crashes too. But I found > the plugin it leading to crash. It is "paste" in the tray. Once activated, > the plasma desktop crashes at login. > > It is same as mentioned in: > https://bugs.kde.org/show_bug.cgi?id=311751#c59 Thanks. That solved my issue.