Bug 271494

Summary: Lokalize Crash when changing the window style
Product: [Applications] lokalize Reporter: Xavier Besnard <xavier.besnard>
Component: generalAssignee: Nick Shaforostoff <shafff>
Status: RESOLVED UPSTREAM    
Severity: crash CC: aspotashev, cfeck, faure
Priority: NOR    
Version: 1.4   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch for Qt-4.8 qmdisubwindow

Description Xavier Besnard 2011-04-22 16:48:30 UTC
Application: lokalize (1.2)
KDE Platform Version: 4.6.2 (4.6.2)
Qt Version: 4.7.2
Operating System: Linux 2.6.38-7-generic i686
Distribution: Ubuntu 11.04

-- Information about the crash:
- What I was doing when the application crashed: Lokalize Crash when changing the window style. 

Configuration: Desktop Effect: Off, ACER D351h with Natty Kubuntu, updated dayly

-- Backtrace:
Application: Lokalize (lokalize), signal: Segmentation fault
[Current thread is 1 (Thread 0xb77ca930 (LWP 3366))]

Thread 5 (Thread 0xb43b4b70 (LWP 3367)):
#0  0x00c6ad41 in clock_gettime (clock_id=1, tp=0xb43b4000) at ../sysdeps/unix/clock_gettime.c:116
#1  0x0310fdd8 in do_gettime () at tools/qelapsedtimer_unix.cpp:123
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#3  0x031dc4f2 in updateCurrentTime (this=0x870cfa4, tm=...) at kernel/qeventdispatcher_unix.cpp:339
#4  QTimerInfoList::timerWait (this=0x870cfa4, tm=...) at kernel/qeventdispatcher_unix.cpp:442
#5  0x031dad32 in timerSourcePrepareHelper (src=<value optimized out>, timeout=0xb43b40dc) at kernel/qeventdispatcher_glib.cpp:136
#6  0x031dadcd in timerSourcePrepare (source=0x870cf70, timeout=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:169
#7  0x015c3fd4 in g_main_context_prepare (context=<value optimized out>, priority=0xb43b414c) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:2761
#8  0x015c4e63 in g_main_context_iterate (context=0x870c638, block=1, dispatch=1, self=<value optimized out>) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:3071
#9  0x015c5524 in g_main_context_iteration (context=0x870c638, may_block=1) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:3154
#10 0x031db577 in QEventDispatcherGlib::processEvents (this=0x8ba5330, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#11 0x031ad289 in QEventLoop::processEvents (this=0xb43b4290, flags=...) at kernel/qeventloop.cpp:149
#12 0x031ad522 in QEventLoop::exec (this=0xb43b4290, flags=...) at kernel/qeventloop.cpp:201
#13 0x030b72a0 in QThread::exec (this=0x855afa0) at thread/qthread.cpp:492
#14 0x0318efdb in QInotifyFileSystemWatcherEngine::run (this=0x855afa0) at io/qfilesystemwatcher_inotify.cpp:248
#15 0x030b9da2 in QThreadPrivate::start (arg=0x855afa0) at thread/qthread_unix.cpp:320
#16 0x00a08e99 in start_thread (arg=0xb43b4b70) at pthread_create.c:304
#17 0x0131373e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 4 (Thread 0xb3ac5b70 (LWP 3368)):
#0  0x008d3416 in __kernel_vsyscall ()
#1  0x00a0d48c in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0x013213fd in __pthread_cond_wait (cond=0x86e32a0, mutex=0x86e3288) at forward.c:139
#3  0x030ba467 in wait (this=0x8d499c8, mutex=0x8d499c4, time=4294967295) at thread/qwaitcondition_unix.cpp:88
#4  QWaitCondition::wait (this=0x8d499c8, mutex=0x8d499c4, time=4294967295) at thread/qwaitcondition_unix.cpp:160
#5  0x03bc1a62 in QFileInfoGatherer::run (this=0x8d499bc) at dialogs/qfileinfogatherer.cpp:214
#6  0x030b9da2 in QThreadPrivate::start (arg=0x8d499bc) at thread/qthread_unix.cpp:320
#7  0x00a08e99 in start_thread (arg=0xb3ac5b70) at pthread_create.c:304
#8  0x0131373e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 3 (Thread 0xb32c4b70 (LWP 3369)):
#0  0x01321621 in pthread_mutex_unlock (mutex=0x85a37c4) at forward.c:184
#1  0x015c35e6 in g_main_context_acquire (context=<value optimized out>) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:2541
#2  0x015c4dde in g_main_context_iterate (context=0x85a37c0, block=1, dispatch=1, self=<value optimized out>) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:3035
#3  0x015c5524 in g_main_context_iteration (context=0x85a37c0, may_block=1) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:3154
#4  0x031db577 in QEventDispatcherGlib::processEvents (this=0x8daa7e8, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#5  0x031ad289 in QEventLoop::processEvents (this=0xb32c4290, flags=...) at kernel/qeventloop.cpp:149
#6  0x031ad522 in QEventLoop::exec (this=0xb32c4290, flags=...) at kernel/qeventloop.cpp:201
#7  0x030b72a0 in QThread::exec (this=0x8d47b08) at thread/qthread.cpp:492
#8  0x0318efdb in QInotifyFileSystemWatcherEngine::run (this=0x8d47b08) at io/qfilesystemwatcher_inotify.cpp:248
#9  0x030b9da2 in QThreadPrivate::start (arg=0x8d47b08) at thread/qthread_unix.cpp:320
#10 0x00a08e99 in start_thread (arg=0xb32c4b70) at pthread_create.c:304
#11 0x0131373e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 2 (Thread 0xb2ac3b70 (LWP 3370)):
#0  0x008d3416 in __kernel_vsyscall ()
#1  0x00a0d48c in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0x013213fd in __pthread_cond_wait (cond=0x8584fb8, mutex=0x8584fa0) at forward.c:139
#3  0x030ba467 in wait (this=0x8584ec0, mutex=0x8584730, time=4294967295) at thread/qwaitcondition_unix.cpp:88
#4  QWaitCondition::wait (this=0x8584ec0, mutex=0x8584730, time=4294967295) at thread/qwaitcondition_unix.cpp:160
#5  0x00bef7e0 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x8584ea8, th=0x8d47070) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#6  0x00bf247c in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0x8584688, th=0x8d47070) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80
#7  0x00bef42b in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0x8584ea8, th=0x8d47070) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356
#8  0x00bf256a in ThreadWeaver::WorkingHardState::applyForWork (this=0x8584688, th=0x8d47070) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#9  0x00bef373 in ThreadWeaver::WeaverImpl::applyForWork (this=0x8584ea8, th=0x8d47070, previous=0x9610640) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#10 0x00bf0f9e in ThreadWeaver::ThreadRunHelper::run (this=0xb2ac32f4, parent=0x8584ea8, th=0x8d47070) at ../../../threadweaver/Weaver/Thread.cpp:87
#11 0x00bf105b in ThreadWeaver::Thread::run (this=0x8d47070) at ../../../threadweaver/Weaver/Thread.cpp:142
#12 0x030b9da2 in QThreadPrivate::start (arg=0x8d47070) at thread/qthread_unix.cpp:320
#13 0x00a08e99 in start_thread (arg=0xb2ac3b70) at pthread_create.c:304
#14 0x0131373e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 1 (Thread 0xb77ca930 (LWP 3366)):
[KCrash Handler]
#7  QCoreApplication::notifyInternal (this=0xbfe9c850, receiver=0x95f2c50, event=0xbfe9bc44) at kernel/qcoreapplication.cpp:719
#8  0x0366b662 in sendEvent (style=0x8e3c6a0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#9  QApplication::setStyle (style=0x8e3c6a0) at kernel/qapplication.cpp:1568
#10 0x0366b8e0 in QApplication::setStyle (style=...) at kernel/qapplication.cpp:1616
#11 0x033be2d8 in updateWidgetStyle (this=0x8559970, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfe9bd8c) at ../../qguiplatformplugin_kde/qguiplatformplugin_kde.cpp:357
#12 KQGuiPlatformPlugin::qt_metacall (this=0x8559970, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfe9bd8c) at ./qguiplatformplugin_kde.moc:74
#13 0x031b46ba in QMetaObject::metacall (object=0x8559970, cl=QMetaObject::InvokeMetaMethod, idx=5, argv=0xbfe9bd8c) at kernel/qmetaobject.cpp:237
#14 0x031c44ff in QMetaObject::activate (sender=0x8554a00, m=0x6f9804, local_signal_index=1, argv=0x0) at kernel/qobject.cpp:3287
#15 0x0056ee77 in KGlobalSettings::kdisplayStyleChanged (this=0x8554a00) at ./kglobalsettings.moc:117
#16 0x0056eef5 in KGlobalSettings::Private::applyGUIStyle (this=0x8558e48) at ../../kdeui/kernel/kglobalsettings.cpp:922
#17 0x0056f248 in KGlobalSettings::Private::kdisplaySetStyle (this=0x8558e48) at ../../kdeui/kernel/kglobalsettings.cpp:1049
#18 0x00570020 in KGlobalSettings::Private::_k_slotNotifyChange (this=0x8558e48, changeType=2, arg=0) at ../../kdeui/kernel/kglobalsettings.cpp:842
#19 0x0057055b in KGlobalSettings::qt_metacall (this=0x8554a00, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0xbfe9bfcc) at ./kglobalsettings.moc:100
#20 0x00836acd in QDBusConnectionPrivate::deliverCall (this=0x8572368, object=0x8554a00, msg=..., metaTypes=..., slotIdx=14) at qdbusintegrator.cpp:942
#21 0x008411d7 in QDBusCallDeliveryEvent::placeMetaCall (this=0x92ae7d8, object=0x8554a00) at qdbusintegrator_p.h:103
#22 0x031c33b7 in QObject::event (this=0x8554a00, e=0x92ae7d8) at kernel/qobject.cpp:1226
#23 0x03667d24 in QApplicationPrivate::notify_helper (this=0x850d9c0, receiver=0x8554a00, e=0x92ae7d8) at kernel/qapplication.cpp:4462
#24 0x0366c8ce in QApplication::notify (this=0xbfe9c850, receiver=0x8554a00, e=0x92ae7d8) at kernel/qapplication.cpp:3862
#25 0x005423ca in KApplication::notify (this=0xbfe9c850, receiver=0x8554a00, event=0x92ae7d8) at ../../kdeui/kernel/kapplication.cpp:311
#26 0x031ae0bb in QCoreApplication::notifyInternal (this=0xbfe9c850, receiver=0x8554a00, event=0x92ae7d8) at kernel/qcoreapplication.cpp:731
#27 0x031b1c79 in sendEvent (receiver=0x0, event_type=0, data=0x84d5f50) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#28 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x84d5f50) at kernel/qcoreapplication.cpp:1372
#29 0x031b1e0d in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1265
#30 0x031db3c4 in sendPostedEvents (s=0x850fd00) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#31 postEventSourceDispatch (s=0x850fd00) at kernel/qeventdispatcher_glib.cpp:277
#32 0x015c4aa8 in g_main_dispatch (context=0x850fc70) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:2440
#33 g_main_context_dispatch (context=0x850fc70) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:3013
#34 0x015c5270 in g_main_context_iterate (context=0x850fc70, block=22894624, dispatch=1, self=<value optimized out>) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:3091
#35 0x015c5524 in g_main_context_iteration (context=0x850fc70, may_block=1) at /build/buildd/glib2.0-2.28.6/./glib/gmain.c:3154
#36 0x031db53c in QEventDispatcherGlib::processEvents (this=0x84d5aa8, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#37 0x0371b775 in QGuiEventDispatcherGlib::processEvents (this=0x84d5aa8, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#38 0x031ad289 in QEventLoop::processEvents (this=0xbfe9c7b4, flags=...) at kernel/qeventloop.cpp:149
#39 0x031ad522 in QEventLoop::exec (this=0xbfe9c7b4, flags=...) at kernel/qeventloop.cpp:201
#40 0x031b1ecc in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#41 0x036658e7 in QApplication::exec () at kernel/qapplication.cpp:3736
#42 0x080726c9 in main (argc=-1075197872, argv=0x8154248) at ../../../lokalize/src/main.cpp:119

Possible duplicates by query: bug 247902.

Reported using DrKonqi
Comment 1 Christoph Feck 2011-04-22 17:25:05 UTC
If this is reproducible, could you check which was your previous style and which style you changed it to?
Comment 2 Nick Shaforostoff 2011-04-22 21:58:56 UTC
and also if you ran lokalize from KDE session or gnome/other one?
how did other kde apps behave?
Comment 3 Nick Shaforostoff 2011-04-30 20:23:50 UTC
yes  i can reproduce this changing from oxygento cleanlooks then back to oxygen
Comment 4 Alexander Potashev 2012-07-29 13:20:14 UTC
This bug is a particular case of BUG #271494. Still valid for KDE SC 4.8.4.
Comment 5 David Faure 2012-08-06 15:09:32 UTC
Alexander: this bug *is* 271494 :-)

I couldn't reproduce it (with KDE 4.9). Maybe because I don't actually use lokalize so it was simple opened and I clicked "create project" just to get an empty view.

Or maybe it got fixed meanwhile.
Comment 6 Alexander Potashev 2012-08-06 18:25:17 UTC
(In reply to comment #5)
> Alexander: this bug *is* 271494 :-)

I think, we shouldn't close any of these two bugs to let more people see at least one of them in their TO-DO lists.

> 
> I couldn't reproduce it (with KDE 4.9). Maybe because I don't actually use
> lokalize so it was simple opened and I clicked "create project" just to get
> an empty view.
> 
> Or maybe it got fixed meanwhile.

Can you try opening a translation file in Lokalize too? (anyfile.po)
Comment 7 David Faure 2012-08-06 21:02:32 UTC
(I just meant that "This bug is a particular case of BUG #271494" was a funny comment, in 271494 itself).

Yep, bug reproduced after opening a .po file.
Valgrind says, err... interesting...
It crashes when accessing a deleted QMenu due to QMdiSubWindow::event temporarily changing the subwindow from maximized to normal in order to handle the style change, and then maximizing again. Making the subwindow non-maximized, activates it, which makes LokalizeMainWindow::slotSubWindowActivated remove an xmlgui client, which deletes its menus.
And since, at the top of all this, Qt is looping over the list of all initial widgets (QApplication::allWidgets), it crashes when arriving at that now-deleted QMenu.

==19915== Invalid read of size 8
==19915==    at 0x8CF6F18: QWidget::windowType() const (qwidget.h:935)
==19915==    by 0x8CEBE6E: QApplication::setStyle(QStyle*) (qapplication.cpp:1581)
==19915==    by 0x8CEC0D9: QApplication::setStyle(QString const&) (qapplication.cpp:1631)
==19915==    by 0x11BC0429: KQGuiPlatformPlugin::updateWidgetStyle() (qguiplatformplugin_kde.cpp:357)
==19915==    by 0x11BBD9D8: KQGuiPlatformPlugin::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (qguiplatformplugin_kde.moc:51)
==19915==    by 0x9CAA611: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3548)
==19915==    by 0x5FE2EA0: KGlobalSettings::kdisplayStyleChanged() (kglobalsettings.moc:131)
==19915==    by 0x5FE1C67: KGlobalSettings::Private::applyGUIStyle() (kglobalsettings.cpp:937)
==19915==    by 0x5FE271B: KGlobalSettings::Private::kdisplaySetStyle() (kglobalsettings.cpp:1084)
==19915==    by 0x5FE185E: KGlobalSettings::Private::_k_slotNotifyChange(int, int) (kglobalsettings.cpp:848)
==19915==    by 0x5FE2D4D: KGlobalSettings::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (kglobalsettings.moc:77)
==19915==    by 0x5FE2E41: KGlobalSettings::qt_metacall(QMetaObject::Call, int, void**) (kglobalsettings.moc:116)
==19915==    by 0x87ED698: QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&, QList<int> const&, int) (qdbusintegrator.cpp:947)
==19915==    by 0x87F96CF: QDBusCallDeliveryEvent::placeMetaCall(QObject*) (qdbusintegrator_p.h:103)
==19915==    by 0x9CA51E0: QObject::event(QEvent*) (qobject.cpp:1195)
==19915==    by 0x8CF3ED7: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4551)
==19915==    by 0x8CF1513: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:3933)
==19915==    by 0x5FAC2BE: KApplication::notify(QObject*, QEvent*) (kapplication.cpp:311)
==19915==    by 0x9C8BD39: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:915)
==19915==    by 0x8CE4D54: QCoreApplication::sendEvent(QObject*, QEvent*) (in /d/qt/4/qt-4.8/lib/libQtGui.so.4.8.2)
==19915==    by 0x9C8D173: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (qcoreapplication.cpp:1563)
==19915==    by 0x9C8CD94: QCoreApplication::sendPostedEvents(QObject*, int) (qcoreapplication.cpp:1456)
==19915==    by 0x8DBFCD4: QCoreApplication::sendPostedEvents() (qcoreapplication.h:236)
==19915==    by 0x9CC7BB3: postEventSourceDispatch(_GSource*, int (*)(void*), void*) (qeventdispatcher_glib.cpp:279)
==19915==    by 0xF09158C: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3000.1)
==19915==    by 0xF091D87: <event loop>
==19915==  Address 0x112289e0 is 32 bytes inside a block of size 40 free'd
==19915==    at 0x4C28706: operator delete(void*) (vg_replace_malloc.c:457)
==19915==    by 0x9276831: QMenu::~QMenu() (qmenu.cpp:1421)
==19915==    by 0x609F853: KMenu::KMenuPrivate::~KMenuPrivate() (kmenu.cpp:124)
==19915==    by 0x609F8D1: KMenu::KMenuPrivate::~KMenuPrivate() (kmenu.cpp:125)
==19915==    by 0x609FAB9: KMenu::~KMenu() (kmenu.cpp:167)
==19915==    by 0x609FAFD: KMenu::~KMenu() (kmenu.cpp:168)
==19915==    by 0x60E9218: KXMLGUIBuilder::removeContainer(QWidget*, QWidget*, QDomElement&, QAction*) (kxmlguibuilder.cpp:253)
==19915==    by 0x60FB6F6: KXMLGUI::ContainerNode::destruct(QDomElement, KXMLGUI::BuildState&) (kxmlguifactory_p.cpp:348)
==19915==    by 0x60FB7CA: KXMLGUI::ContainerNode::destructChildren(QDomElement const&, KXMLGUI::BuildState&) (kxmlguifactory_p.cpp:372)
==19915==    by 0x60FB593: KXMLGUI::ContainerNode::destruct(QDomElement, KXMLGUI::BuildState&) (kxmlguifactory_p.cpp:327)
==19915==    by 0x60FB7CA: KXMLGUI::ContainerNode::destructChildren(QDomElement const&, KXMLGUI::BuildState&) (kxmlguifactory_p.cpp:372)
==19915==    by 0x60FB593: KXMLGUI::ContainerNode::destruct(QDomElement, KXMLGUI::BuildState&) (kxmlguifactory_p.cpp:327)
==19915==    by 0x60FB7CA: KXMLGUI::ContainerNode::destructChildren(QDomElement const&, KXMLGUI::BuildState&) (kxmlguifactory_p.cpp:372)
==19915==    by 0x60FB593: KXMLGUI::ContainerNode::destruct(QDomElement, KXMLGUI::BuildState&) (kxmlguifactory_p.cpp:327)
==19915==    by 0x60F6007: KXMLGUIFactory::removeClient(KXMLGUIClient*) (kxmlguifactory.cpp:452)
==19915==    by 0x441F88: LokalizeMainWindow::slotSubWindowActivated(QMdiSubWindow*) (lokalizemainwindow.cpp:169)
==19915==    by 0x446992: LokalizeMainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (lokalizemainwindow.moc:133)
==19915==    by 0x9CAA611: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3548)
==19915==    by 0x925BE12: QMdiArea::subWindowActivated(QMdiSubWindow*) (moc_qmdiarea.cpp:215)
==19915==    by 0x9255935: QMdiAreaPrivate::emitWindowActivated(QMdiSubWindow*) (qmdiarea.cpp:1084)
==19915==    by 0x9253BAF: QMdiAreaPrivate::_q_processWindowStateChanged(QFlags<Qt::WindowState>, QFlags<Qt::WindowState>) (qmdiarea.cpp:753)
==19915==    by 0x925B9B1: QMdiArea::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qmdiarea.cpp:112)
==19915==    by 0x9CAA611: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3548)
==19915==    by 0x926E498: QMdiSubWindow::windowStateChanged(QFlags<Qt::WindowState>, QFlags<Qt::WindowState>) (moc_qmdisubwindow.cpp:151)
==19915==    by 0x926539A: QMdiSubWindowPrivate::setActive(bool, bool) (qmdisubwindow.cpp:1440)
==19915==    by 0x926A82C: QMdiSubWindow::eventFilter(QObject*, QEvent*) (qmdisubwindow.cpp:2727)
==19915==    by 0x9C8BFD8: QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) (qcoreapplication.cpp:1025)
==19915==    by 0x8CF3EAE: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4547)
==19915==    by 0x8CF3BD9: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:4516)
==19915==    by 0x5FAC2BE: KApplication::notify(QObject*, QEvent*) (kapplication.cpp:311)
==19915==    by 0x9C8BD39: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:915)
==19915==    by 0x8CE4D54: QCoreApplication::sendEvent(QObject*, QEvent*) (in /d/qt/4/qt-4.8/lib/libQtGui.so.4.8.2)
==19915==    by 0x8D572E4: QWidgetPrivate::show_helper() (qwidget.cpp:7551)
==19915==    by 0x8D56C79: QWidgetPrivate::show_recursive() (qwidget.cpp:7422)
==19915==    by 0x8D580AD: QWidgetPrivate::showChildren(bool) (qwidget.cpp:7859)
==19915==    by 0x8D570F5: QWidgetPrivate::show_helper() (qwidget.cpp:7498)
==19915==    by 0x8D57C19: QWidget::setVisible(bool) (qwidget.cpp:7773)
==19915==    by 0x926495D: QMdiSubWindowPrivate::setNormalMode() (qmdisubwindow.cpp:1300)
==19915==    by 0x926BCA0: QMdiSubWindow::changeEvent(QEvent*) (qmdisubwindow.cpp:3013)
==19915==    by 0x8D59BD0: QWidget::event(QEvent*) (qwidget.cpp:8613)
==19915==    by 0x926B758: QMdiSubWindow::event(QEvent*) (qmdisubwindow.cpp:2914)
==19915==    by 0x8CF3ED7: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4551)
==19915==    by 0x8CF3BD9: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:4516)
==19915==    by 0x5FAC2BE: KApplication::notify(QObject*, QEvent*) (kapplication.cpp:311)
==19915==    by 0x9C8BD39: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:915)
==19915==    by 0x8CE4D54: QCoreApplication::sendEvent(QObject*, QEvent*) (in /d/qt/4/qt-4.8/lib/libQtGui.so.4.8.2)
==19915==    by 0x8DB9E78: QWidget::setWindowState(QFlags<Qt::WindowState>) (qwidget_x11.cpp:1851)
==19915==    by 0x8D4B6FB: QWidget::showNormal() (qwidget.cpp:3192)
==19915==    by 0x926B036: QMdiSubWindow::event(QEvent*) (qmdisubwindow.cpp:2801)
==19915==    by 0x8CF3ED7: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4551)

Well, now it's clear why it crashes.
What's less clear is how to fix it :-)

Maybe with a special mode "ignore subwindow activation" during the handling of StyleChange in a derived QMdiSubWindow::event().

The alternative is a ton of QPointers in QApplication::setStyle(), not sure about the performance, nor if this will be accepted in Qt.
Comment 8 Alexander Potashev 2012-08-06 21:15:04 UTC
(In reply to comment #7)
> (I just meant that "This bug is a particular case of BUG #271494" was a
> funny comment, in 271494 itself).

ROFL!!!
I meant BUG #251445 actually. :)
Comment 9 David Faure 2012-08-26 09:42:02 UTC
Created attachment 73480 [details]
Patch for Qt-4.8 qmdisubwindow

This patch for Qt-4.8 fixes the crash, but after changing widget styles, the contents of the active tab showing the .po file, becomes empty until switching tabs back and forth.
Easy enough for the user to work around, but I wonder if this means the Qt patch is buggy, or lokalize is doing something weird. Maybe the lokalize author(s) can debug this more easily...
Comment 10 David Faure 2012-08-26 09:58:33 UTC
Hmm, not really reproduceable, now it's working fine. I'll submit the patch to Qt.
Comment 11 David Faure 2012-08-26 10:03:39 UTC
https://codereview.qt-project.org/33556
Comment 12 David Faure 2013-03-25 13:40:04 UTC
Finally, after much debugging on Windows (yay, fun), the fix is in for Qt 5.1:
https://codereview.qt-project.org/47214

I'll look into the Qt-4.8 fix again now...
Comment 13 Nick Shaforostoff 2013-03-25 14:16:56 UTC
cool! so, should i close this bug entry now?
Comment 14 David Faure 2013-03-25 16:01:53 UTC
The Qt-4.8 patch isn't in yet (I just updated it), but yeah, we can close this as "upstream".
Comment 15 David Faure 2013-03-28 16:15:34 UTC
https://codereview.qt-project.org/33556 is finally in. It only took 7 months for me to manage to get the fix into Qt 4.8.x :)