Bug 277925 - KCM crashes when trying to add window-specific window decorator options
Summary: KCM crashes when trying to add window-specific window decorator options
Status: RESOLVED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: win deco (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
: 290238 293388 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-16 22:09 UTC by thomas gahr
Modified: 2012-02-10 18:28 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (9.30 KB, text/plain)
2011-07-16 22:38 UTC, thomas gahr
Details
screenshot of crashing dialog (311.23 KB, image/png)
2011-07-17 11:55 UTC, thomas gahr
Details
New crash information added by DrKonqi (9.01 KB, text/plain)
2011-11-29 16:45 UTC, statement
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thomas gahr 2011-07-16 22:09:14 UTC
Application: kcmshell4 ()
KDE Platform Version: 4.6.95 (4.7 RC2)
Qt Version: 4.8.0
Operating System: Linux 2.6.38.8-35.fc15.x86_64 x86_64
Distribution: "Fedora release 15 (Lovelock)"

-- Information about the crash:
- What I was doing when the application crashed:
right-clicked title bar of some app and went to:
  window decorations->configure decoration...->window-specific overrides
=> KCM crashes as soon as i press "add" button

i tried this with google-chrome several times and once with dolphin and once with a konsole window, it's always the same

- Unusual behavior I noticed:
after the first crash, the position of the context-menu that appears when right-clicking a window's title bar is not positioned relatively to the window but relatively to the top left corner of the screen.

The crash can be reproduced every time.

-- Backtrace:
Application: KDE Control Module (kcmshell4), signal: Aborted
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[KCrash Handler]
#6  0x0000003a52e352d5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x0000003a52e36beb in __GI_abort () at abort.c:93
#8  0x0000003a5a26f624 in qt_message_output (msgType=<optimized out>, buf=<optimized out>) at global/qglobal.cpp:2306
#9  0x0000003a5a26f7df in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg, msg=0x3a5a414e28 "QSharedPointer: pointer %p already has reference counting", ap=0x7fff267d32f8) at global/qglobal.cpp:2352
#10 0x0000003a5a26f984 in qFatal (msg=<optimized out>) at global/qglobal.cpp:2535
#11 0x0000003a5a2baf6f in QtSharedPointer::ExternalRefCountData::setQObjectShared (this=0x1c01460, obj=<optimized out>) at tools/qsharedpointer.cpp:1242
#12 0x00007f1a5d839b2d in ?? () from /usr/lib64/kde4/kwin_oxygen_config.so
#13 0x00007f1a5d838ef1 in ?? () from /usr/lib64/kde4/kwin_oxygen_config.so
#14 0x0000003a5a388efd in QMetaObject::activate (sender=0x27f7e70, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff267d3690) at kernel/qobject.cpp:3593
#15 0x0000003a5b43d8c2 in QAbstractButton::clicked (this=<optimized out>, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:220
#16 0x0000003a5b18274e in QAbstractButtonPrivate::emitClicked (this=0x27f8c80) at widgets/qabstractbutton.cpp:546
#17 0x0000003a5b183a8b in QAbstractButtonPrivate::click (this=0x27f8c80) at widgets/qabstractbutton.cpp:539
#18 0x0000003a5b183cfc in QAbstractButton::mouseReleaseEvent (this=0x27f7e70, e=0x7fff267d3f60) at widgets/qabstractbutton.cpp:1121
#19 0x0000003a5ae1476a in QWidget::event (this=0x27f7e70, event=0x7fff267d3f60) at kernel/qwidget.cpp:8338
#20 0x0000003a5adc41b4 in notify_helper (e=0x7fff267d3f60, receiver=0x27f7e70, this=0x185eda0) at kernel/qapplication.cpp:4495
#21 QApplicationPrivate::notify_helper (this=0x185eda0, receiver=0x27f7e70, e=0x7fff267d3f60) at kernel/qapplication.cpp:4467
#22 0x0000003a5adc9913 in QApplication::notify (this=<optimized out>, receiver=0x27f7e70, e=0x7fff267d3f60) at kernel/qapplication.cpp:4038
#23 0x0000003a62a4c066 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#24 0x0000003a5a37508c in QCoreApplication::notifyInternal (this=0x7fff267d65a0, receiver=0x27f7e70, event=0x7fff267d3f60) at kernel/qcoreapplication.cpp:833
#25 0x0000003a5adc5182 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:231
#26 QApplicationPrivate::sendMouseEvent (receiver=0x27f7e70, event=0x7fff267d3f60, alienWidget=0x27f7e70, nativeWidget=0x27aa090, buttonDown=0x27f7e70, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3153
#27 0x0000003a5ae40745 in QETWidget::translateMouseEvent (this=0x27aa090, event=<optimized out>) at kernel/qapplication_x11.cpp:4473
#28 0x0000003a5ae3f60a in QApplication::x11ProcessEvent (this=0x7fff267d65a0, event=0x7fff267d4820) at kernel/qapplication_x11.cpp:3599
#29 0x0000003a5ae66d4c in x11EventSourceDispatch (s=0x18644c0, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:148
#30 0x0000003a52a427ed in g_main_dispatch (context=0x1860ae0) at gmain.c:2441
#31 g_main_context_dispatch (context=0x1860ae0) at gmain.c:3014
#32 0x0000003a52a42fc8 in g_main_context_iterate (context=0x1860ae0, block=<optimized out>, dispatch=1, self=<optimized out>) at gmain.c:3092
#33 0x0000003a52a4325c in g_main_context_iteration (context=0x1860ae0, may_block=1) at gmain.c:3155
#34 0x0000003a5a3a3aaf in QEventDispatcherGlib::processEvents (this=0x1840790, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#35 0x0000003a5ae66a3e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:207
#36 0x0000003a5a3741c2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#37 0x0000003a5a374417 in QEventLoop::exec (this=0x7fff267d4bf0, flags=...) at kernel/qeventloop.cpp:204
#38 0x0000003a5b281e46 in QDialog::exec (this=0x27aa090) at dialogs/qdialog.cpp:552
#39 0x00007f1a66ab7f0f in ?? () from /usr/lib64/kde4/kcm_kwindecoration.so
#40 0x00007f1a66ab84fc in ?? () from /usr/lib64/kde4/kcm_kwindecoration.so
#41 0x0000003a5a388efd in QMetaObject::activate (sender=0x1bfcc70, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff267d4f90) at kernel/qobject.cpp:3593
#42 0x0000003a5b43d8c2 in QAbstractButton::clicked (this=<optimized out>, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:220
#43 0x0000003a5b18274e in QAbstractButtonPrivate::emitClicked (this=0x1bfccb0) at widgets/qabstractbutton.cpp:546
#44 0x0000003a5b183a8b in QAbstractButtonPrivate::click (this=0x1bfccb0) at widgets/qabstractbutton.cpp:539
#45 0x0000003a5b183cfc in QAbstractButton::mouseReleaseEvent (this=0x1bfcc70, e=0x7fff267d5860) at widgets/qabstractbutton.cpp:1121
#46 0x0000003a5ae1476a in QWidget::event (this=0x1bfcc70, event=0x7fff267d5860) at kernel/qwidget.cpp:8338
#47 0x0000003a5adc41b4 in notify_helper (e=0x7fff267d5860, receiver=0x1bfcc70, this=0x185eda0) at kernel/qapplication.cpp:4495
#48 QApplicationPrivate::notify_helper (this=0x185eda0, receiver=0x1bfcc70, e=0x7fff267d5860) at kernel/qapplication.cpp:4467
#49 0x0000003a5adc9913 in QApplication::notify (this=<optimized out>, receiver=0x1bfcc70, e=0x7fff267d5860) at kernel/qapplication.cpp:4038
#50 0x0000003a62a4c066 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#51 0x0000003a5a37508c in QCoreApplication::notifyInternal (this=0x7fff267d65a0, receiver=0x1bfcc70, event=0x7fff267d5860) at kernel/qcoreapplication.cpp:833
#52 0x0000003a5adc5182 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:231
#53 QApplicationPrivate::sendMouseEvent (receiver=0x1bfcc70, event=0x7fff267d5860, alienWidget=0x1bfcc70, nativeWidget=0x1a585f0, buttonDown=0x1bfcc70, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3153
#54 0x0000003a5ae40745 in QETWidget::translateMouseEvent (this=0x1a585f0, event=<optimized out>) at kernel/qapplication_x11.cpp:4473
#55 0x0000003a5ae3f60a in QApplication::x11ProcessEvent (this=0x7fff267d65a0, event=0x7fff267d6120) at kernel/qapplication_x11.cpp:3599
#56 0x0000003a5ae66d4c in x11EventSourceDispatch (s=0x18644c0, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:148
#57 0x0000003a52a427ed in g_main_dispatch (context=0x1860ae0) at gmain.c:2441
#58 g_main_context_dispatch (context=0x1860ae0) at gmain.c:3014
#59 0x0000003a52a42fc8 in g_main_context_iterate (context=0x1860ae0, block=<optimized out>, dispatch=1, self=<optimized out>) at gmain.c:3092
#60 0x0000003a52a4325c in g_main_context_iteration (context=0x1860ae0, may_block=1) at gmain.c:3155
#61 0x0000003a5a3a3aaf in QEventDispatcherGlib::processEvents (this=0x1840790, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#62 0x0000003a5ae66a3e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:207
#63 0x0000003a5a3741c2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#64 0x0000003a5a374417 in QEventLoop::exec (this=0x7fff267d64f0, flags=...) at kernel/qeventloop.cpp:204
#65 0x0000003a5b281e46 in QDialog::exec (this=0x1a585f0) at dialogs/qdialog.cpp:552
#66 0x0000003a5e607b6c in kdemain () from /usr/lib64/libkdeinit4_kcmshell4.so
#67 0x0000003a52e2139d in __libc_start_main (main=0x4006c0, argc=12, ubp_av=0x7fff267d6db8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff267d6da8) at libc-start.c:226
#68 0x00000000004006f1 in _start ()

Reported using DrKonqi
Comment 1 thomas gahr 2011-07-16 22:38:43 UTC
Created attachment 61930 [details]
New crash information added by DrKonqi

kcmshell4 () on KDE Platform 4.6.95 (4.7 RC2) using Qt 4.8.0

silly me, forgot to install the necessary debug-packages. so a more useful crash report here...

-- Backtrace (Reduced):
#6  0x0000003a52e352d5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x0000003a52e36beb in __GI_abort () at abort.c:93
[...]
#11 0x0000003a5a2baf6f in QtSharedPointer::ExternalRefCountData::setQObjectShared (this=0x16fe030, obj=<optimized out>) at tools/qsharedpointer.cpp:1242
#12 0x00007fb502eebb2d in internalFinishConstruction (ptr=0x1731600, this=) at /usr/include/QtCore/qsharedpointer_impl.h:373
#13 internalConstruct (ptr=0x1731600, this=) at /usr/include/QtCore/qsharedpointer_impl.h:349
Comment 2 Martin Flöser 2011-07-17 06:26:53 UTC
Looks for me like a crash in Oxygen -> reassign
Comment 3 Hugo Pereira Da Costa 2011-07-17 09:57:31 UTC
would need kde-workspace debug packages too, to get symbols to e.g.

#13 0x00007f1a5d838ef1 in ?? () from /usr/lib64/kde4/kwin_oxygen_config.so

Also, I'm confused about "Window decorations->configure decoration...->window-specific overrides". Here I don't have a "Window decoration" item in the right click menu of windows title bars. 

Any chance you provide a screenshot of the relevant menu ? 

Thanks !
Comment 4 thomas gahr 2011-07-17 11:54:40 UTC
Sorry, I forgot to mention the menu entry I was selecting - it was "configure window behaviour..." then the other ones.
I'll create an attachment with a screenshot of the relevant dialog for you.

The crash report with the missing symbols can be found in comment #1

I attached gdb to kcmshell4 and provoked the crash again and saw that the last line from oxygen sources in the call stack was the line marked with (*) in the following snippet:
(in file kdebase-workspace-4.6.95/kdebase-workspace-4.6.95/kwin/clients/oxygen/config/oxygenexceptionlistwidget.cpp:116)

[...]
    void ExceptionListWidget::add( void )
    {

        // map dialog
(*)        QSharedPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) );
        dialog->setException( _defaultConfiguration );
[...]

the abort-signal is raised at the line:
(file tools/qsharedpointer.cpp:1242)

  qFatal("QSharedPointer: pointer %p already has reference counting", obj);

So without any great experience in working with QSharedPointer - could this be fixed by simply using
QScopedPointer<ExceptionDialog>
instead of
QSharedPointer<ExceptionDialog>
?

Sorry for providing no patch but I have not set up an environment to build kde from sources to try the fix...

Cheers,
Thomas
Comment 5 thomas gahr 2011-07-17 11:55:59 UTC
Created attachment 61939 [details]
screenshot of crashing dialog
Comment 6 Hugo Pereira Da Costa 2011-07-17 13:38:33 UTC
@thomas
thanks for all the details.
I'll see what I can do about changing the pointer use.
Note that I'm using Qt 4.7.3 and can't reproduce.
It might well be a problem/regression with Qt 4.8 in fact.

PS: can you reproduce the bug if you run the same thing via systemsettings (kde control center) ? (Workspace Appearance -> window decoration -> etc.) ? 

Thx for the feedback.
Comment 7 Hugo Pereira Da Costa 2011-07-17 13:49:51 UTC
Git commit 73da3a77f2041ac3de44842a162243c036fd32f9 by Hugo Pereira Da Costa.
Committed on 17/07/2011 at 15:47.
Pushed by hpereiradacosta into branch 'master'.

use QWeakPointer (and explicit deletion, if needed) instead of QSharedPointer
CCBUG: 277925

M  +16   -13   kwin/clients/oxygen/config/oxygenexceptionlistwidget.cpp

http://commits.kde.org/kde-workspace/73da3a77f2041ac3de44842a162243c036fd32f9
Comment 8 Hugo Pereira Da Costa 2011-07-17 13:51:30 UTC
Git commit 322ea13d89950d6be282297bb03ff2265c8f5946 by Hugo Pereira Da Costa.
Committed on 17/07/2011 at 15:47.
Pushed by hpereiradacosta into branch 'KDE/4.7'.

use QWeakPointer (and explicit deletion, if needed) instead of QSharedPointer
CCBUG: 277925

M  +16   -13   kwin/clients/oxygen/config/oxygenexceptionlistwidget.cpp

http://commits.kde.org/kde-workspace/322ea13d89950d6be282297bb03ff2265c8f5946
Comment 9 Hugo Pereira Da Costa 2011-07-17 13:52:17 UTC
ok. That should fix it, hopefully.
Keep me posted.
Comment 10 thomas gahr 2011-07-17 18:27:24 UTC
Yes, the bug can be reproduced when opening the dialog from within system settings.

I'm setting up a kde build environment right now as I'm sick of not being able to hack around and debug properly. This means I'm pulling master atm and will hopefully be able to test your fix later today.

I was thinking about a Qt regression as well since there seems to be nothing wrong about the usage of QSharedPointer at this place with ExceptionDialog (which makes the fix more of a workaround anyway), should be interesting to see if the problem still exists with my build from sources since I guess the version used for building kde (with kdesrc script) is not exactly the same as the one packaged as an .rpm on fedora. I'll also have a look if I can reproduce the bug in a simple test-case mimicking your ExceptionDialog class so I can find out if it is really Qt-related.

Maybe I will poke around in Qt's git repository to see commits that affect qsharedpointer.cpp and give git-bisect a try...
Comment 11 Hugo Pereira Da Costa 2011-07-21 14:23:04 UTC
I agree that my fix is more a workaround than an actual fix. 
Would be happy to roll it back.
Comment 12 thomas gahr 2011-07-23 20:40:46 UTC
OK, it seems you CAN roll back your fix...
After building KDE from sources didn't quite work out the way I hoped it would and time is precious for me atm (exams), I just downgraded my system's Qt install from 4.8TP down to 4.7.3 and the bug is gone. So it seems clear to me that this is a regression in Qt.
Sorry for the noise!
Comment 13 Hugo Pereira Da Costa 2011-07-25 15:10:59 UTC
ok. So reverting and closing. Hopefully this will get fix in later versions of QT4.8.
Comment 14 Hugo Pereira Da Costa 2011-08-08 08:50:32 UTC
Git commit e09d5da632c65bf5c073f823a0c0ef0dcdc13068 by Hugo Pereira Da Costa.
Committed on 25/07/2011 at 17:04.
Pushed by hpereiradacosta into branch 'master'.

git pull Revert "use QWeakPointer (and explicit deletion, if needed)
instead of QSharedPointer"

This reverts commit 73da3a77f2041ac3de44842a162243c036fd32f9.
CCBUG: 277925

M  +13   -16   kwin/clients/oxygen/config/oxygenexceptionlistwidget.cpp

http://commits.kde.org/kde-workspace/e09d5da632c65bf5c073f823a0c0ef0dcdc13068
Comment 15 Hugo Pereira Da Costa 2011-08-08 14:05:08 UTC
Git commit ff09bd1b56f0e442bfed5d8c2b1c77079a7dbcc7 by Hugo Pereira Da Costa.
Committed on 25/07/2011 at 17:08.
Pushed by hpereiradacosta into branch 'KDE/4.7'.

Revert "use QWeakPointer (and explicit deletion, if needed) instead of QSharedPointer"

This reverts commit 322ea13d89950d6be282297bb03ff2265c8f5946.
CCBUG: 277925

M  +13   -16   kwin/clients/oxygen/config/oxygenexceptionlistwidget.cpp

http://commits.kde.org/kde-workspace/ff09bd1b56f0e442bfed5d8c2b1c77079a7dbcc7
Comment 16 statement 2011-11-29 16:45:16 UTC
Created attachment 66194 [details]
New crash information added by DrKonqi

systemsettings (1.0) on KDE Platform 4.7.3 (4.7.3) using Qt 4.8.0

- What I was doing when the application crashed:

I just want to manage window-settings for firefox (removing buttons) but this is impossible (crash every time)

-- Backtrace (Reduced):
#6  0x0000003168e36285 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x0000003168e37b9b in __GI_abort () at abort.c:91
[...]
#11 0x0000003173ebce2f in QtSharedPointer::ExternalRefCountData::setQObjectShared (this=0x26e0460, obj=<optimized out>) at tools/qsharedpointer.cpp:1242
#12 0x00007fcca845e621 in internalFinishConstruction (ptr=0x2e7dff0, this=<synthetic pointer>) at /usr/include/QtCore/qsharedpointer_impl.h:381
#13 internalConstruct (ptr=0x2e7dff0, this=<synthetic pointer>) at /usr/include/QtCore/qsharedpointer_impl.h:357
Comment 17 Hugo Pereira Da Costa 2011-12-31 11:02:03 UTC
*** Bug 290238 has been marked as a duplicate of this bug. ***
Comment 18 Marco 2012-01-18 21:21:41 UTC
*** This bug has been confirmed by popular vote. ***
Comment 19 Diego 2012-01-19 07:44:25 UTC
i confirm this bug,i'm on Arch with kde 4.7.4 and have the same issue on Qt 4.8.0.
This behavior isn't solved.
Comment 20 Hugo Pereira Da Costa 2012-01-19 09:06:06 UTC
its now fixed (well work-around, since the actual bug is in Qt), in kde/4.8 and in master.
Comment 21 Christoph Feck 2012-02-10 18:28:43 UTC
*** Bug 293388 has been marked as a duplicate of this bug. ***