Summary: | Lokalize Crash when changing the window style | ||
---|---|---|---|
Product: | [Applications] lokalize | Reporter: | Xavier Besnard <xavier.besnard> |
Component: | general | Assignee: | 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
If this is reproducible, could you check which was your previous style and which style you changed it to? and also if you ran lokalize from KDE session or gnome/other one? how did other kde apps behave? yes i can reproduce this changing from oxygento cleanlooks then back to oxygen This bug is a particular case of BUG #271494. Still valid for KDE SC 4.8.4. 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. (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) (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. (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. :) 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...
Hmm, not really reproduceable, now it's working fine. I'll submit the patch to Qt. 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... cool! so, should i close this bug entry now? The Qt-4.8 patch isn't in yet (I just updated it), but yeah, we can close this as "upstream". 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 :) |