Bug 311336 - Crash due to KMessageWidget::resizeEvent change in KDE 4.9.4
Summary: Crash due to KMessageWidget::resizeEvent change in KDE 4.9.4
Alias: None
Product: kdelibs
Classification: Unclassified
Component: kdeui (show other bugs)
Version: 4.9.4
Platform: Archlinux Packages Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: kdelibs bugs
: 311663 (view as bug list)
Depends on:
Reported: 2012-12-08 12:20 UTC by Martin Blumenstingl
Modified: 2012-12-26 15:02 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.5

GDB log (122.96 KB, text/plain)
2012-12-08 12:21 UTC, Martin Blumenstingl
gdb bt -80 of my kate crashed. (Includes some qt4 debugging symbols) (11.67 KB, text/plain)
2012-12-21 06:54 UTC, Diane Trout

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Blumenstingl 2012-12-08 12:20:59 UTC
After updating to KDE 4.9.4 cantata (code.google.com/p/cantata/source/list - I built SVN trunk manually) crashes.
No other application here is affected.

Downgrading kdelibs to Arch's 4.9.3-2 package fixes the crash.
Reverting da46ff64c3ef531816864f7b367b416b8e6807c4 also fixes this issue.

I attached an incomplete backtrace of the crash (looks like some infinite loop).

Reproducible: Always
Comment 1 Martin Blumenstingl 2012-12-08 12:21:36 UTC
Created attachment 75708 [details]
GDB log
Comment 2 Martin Blumenstingl 2012-12-08 12:23:41 UTC
cantata shows the KWallet password dialog at startup - I guess that's where the KMessageWidget comes from.
Comment 3 Dominik Haumann 2012-12-09 13:43:53 UTC
Yes, it recursively calls KMessageWidgetPrivate::updateSnapShot (kmessagewidget.cpp:166).
Comment 4 Martin Blumenstingl 2012-12-09 13:48:58 UTC
cantata has a small wrapper around KMessageWidget.
It seems to crash when cantata calls "animatedShow()" of KMessageWidget here:
    if (!parentWidget()->isVisible()) {
    } else {

Removing animatedShow() fixes the cantata startup.

BTW: I was wrong, it was not the KWallet dialog.
Cantata has a message widget at the top of the mainwindow (in their UI file) - it seems to crash there.
Comment 5 Martin Blumenstingl 2012-12-09 13:49:20 UTC
I will try to provide a testcase later (if required).
Comment 6 Anne-Marie Mahfouf 2012-12-09 15:53:41 UTC
yes a test case is important, thanks in advance
Comment 7 Christoph Feck 2012-12-14 02:06:53 UTC
*** Bug 311663 has been marked as a duplicate of this bug. ***
Comment 8 Milian Wolff 2012-12-15 15:53:45 UTC
see bug 311663 for a reproducible test case using kate.
Comment 9 Will Stephenson 2012-12-20 07:48:21 UTC
Same  infinite updateSnapshot, render, resize event crash is triggered in kdenlive, using 4.10b2 kdelibs. Aurelien, care to have a look at it?
Comment 10 Diane Trout 2012-12-21 06:51:56 UTC
I was getting this, or a very similar bug with:

kate +NUM file

My kate source tree HEAD is 0c152cd1504db69f2594a8c23cb79ca77a40ac49
Comment 11 Diane Trout 2012-12-21 06:54:20 UTC
Created attachment 75951 [details]
gdb bt -80 of my kate crashed. (Includes some qt4 debugging symbols)
Comment 12 Aurelien Gateau 2012-12-21 16:40:30 UTC
Review request to fix this bug: https://git.reviewboard.kde.org/r/107835/
Comment 13 Diane Trout 2012-12-25 02:15:38 UTC
At least for me git revision 3a328b66287f6144a82d0812eb93257858f21800 doesn't crash and does successfully tell me that my file doesn't exist. 

My actual path to trigger the bug was start kate, then use the command like to tell a currently open kate to open a new file. I was defaulting to using emacs/vims flags to indicate line numbers, not -l num, so as far as kate was concerned I was givint it a filename that didn't exist.
Comment 14 Aurelien Gateau 2012-12-26 15:02:17 UTC
Git commit 98721989fd887b45df02d0f1937cc04ef0df71ab by Aurélien Gâteau.
Committed on 21/12/2012 at 17:32.
Pushed by gateau into branch 'KDE/4.9'.

Fix infinite recursion from resizeEvent

Calling QWidget::render() from resizeEvent() was a bad idea:
QWidget::render() activates all layouts of the window owning the widget
to paint, causing KMessageWidget::resizeEvent() to be called again,
starting an infinite recursion.
REVIEW: 107835
FIXED-IN: 4.9.5

M  +8    -6    kdeui/widgets/kmessagewidget.cpp