Summary: | krita-4.2.8.2 crash on exit | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Andreas Sturmlechner <asturm> |
Component: | General | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | alvin, amy, asturm, halla, info.themeditationcenter, portnov, raghu, rikmills, robert.goedl76, yztkz |
Priority: | NOR | Keywords: | drkonqi |
Version: | 4.2.8 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/graphics/krita/commit/c936b8a489a5139ed36fb8ec56a5bd07ff542bba | Version Fixed In: | |
Attachments: |
New crash information added by DrKonqi
New crash information added by DrKonqi |
Description
Andreas Sturmlechner
2020-02-12 00:54:25 UTC
Created attachment 125883 [details]
New crash information added by DrKonqi
krita (4.2.8) using Qt 5.14.1
Same crash as the previous one, more debug symbols.
-- Backtrace (Reduced):
#7 0x00007f409b87a98e in QGestureManager::cleanupCachedGestures (this=this@entry=0x559ca0e8b050, target=target@entry=0x559ca225b170, type=<optimized out>) at kernel/qgesturemanager.cpp:170
#8 0x00007f409b86a6f8 in QWidget::~QWidget (this=0x559ca225b170, __in_chrg=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qmap.h:534
#9 0x00007f409b86abc9 in QWidget::~QWidget (this=0x559ca225b170, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1408
#10 0x00007f409ae8eeac in QObjectPrivate::deleteChildren (this=this@entry=0x559ca3b8daa0) at kernel/qobject.cpp:2123
#11 0x00007f409b86a9d6 in QWidget::~QWidget (this=0x559ca3b8da60, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1530
Interestingly, a laptop that consumes all the binary packages produced by the system (binhost) where this report is coming from, does not exhibit the same issue. So maybe this is hinged on local config (which exists from way back on the binhost). I suspect that it's a build issue... It's not something I can reproduce in any case. Yes, I'll experiment with it some more and re-open this once I can be sure it is not a downstream cause. Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone! *** Bug 418530 has been marked as a duplicate of this bug. *** Okay, it's an issue that's new in Qt 5.14, but now that neon is updated, I can reproduce it and try to find a workaround. Git commit b26525b369bf6cdf6cd4bb8c39aa4d0c783470cc by Boudewijn Rempt. Committed on 08/03/2020 at 13:38. Pushed by rempt into branch 'master'. "Work around" a bug in Qt 5.14 where Krita crashes on exit M +4 -0 plugins/extensions/pykrita/plugin/plugin.cpp https://invent.kde.org/kde/krita/commit/b26525b369bf6cdf6cd4bb8c39aa4d0c783470cc Git commit ea079899c0007ab63386f56fdbdc32d2da6786d6 by Boudewijn Rempt. Committed on 08/03/2020 at 13:38. Pushed by rempt into branch 'krita/4.2'. "Work around" a bug in Qt 5.14 where Krita crashes on exit (cherry picked from commit b26525b369bf6cdf6cd4bb8c39aa4d0c783470cc) M +4 -0 plugins/extensions/pykrita/plugin/plugin.cpp https://invent.kde.org/kde/krita/commit/ea079899c0007ab63386f56fdbdc32d2da6786d6 Created attachment 128631 [details]
New crash information added by DrKonqi
krita (4.2.9) using Qt 5.12.8
- What I was doing when the application crashed:
Just opened and closed Krita. Along with this application I had Firefox and Clementine running and nothing else.
- Custom settings of the application:
There was no custom settings, it was a fresh install.
-- Backtrace (Reduced):
#11 0x00007f62a05ce908 in QWidget::~QWidget() () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007f62a05cee1d in QWidget::~QWidget() () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007f629fba201e in QObjectPrivate::deleteChildren() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007f62a05cec29 in QWidget::~QWidget() () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
[...]
#16 0x00007f629fba201e in QObjectPrivate::deleteChildren() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
Yes, with 5.12: https://bugs.launchpad.net/ubuntu/+source/krita/+bug/1874096 This might be relevant: https://www.riverbankcomputing.com/static/Docs/PyQt5/gotchas.html#crashes-on-exit According to that stackoverflow link, this bug should be fixed in PyQt 5.14, which is the one that I have installed, and I don't have any crashes on exit. packages.ubuntu.org says that eoan has 5.12, which is buggy and shows this problem. Curiously, we build our binaries with 5.13.1, which according that article is also buggy, but our binaries don't show the issue. Anyway, not much we can do about it -- it isn't our bug. For practical purposes I am not overly bothered where blame for the crash lies, as long as there is an effective fix. As the launchpad bug backtrace with Qt 5.12.8 is the same as the original backtrace here with Qt 5.14.1, which was fixed (or worked around) with: https://invent.kde.org/graphics/krita/-/commit/ea079899c0007ab63386f56fdbdc32d2da6786d6 extending that fix to cover Qt 5.12 seems a logical step. I can confirm after a rebuild with that applied for Ubuntu 20.04 focal, that it does indeed fix the crash on exit. So I will consider applying that as a bugfix stable release update for Krita in 20.04 Thanks :) *** Bug 422974 has been marked as a duplicate of this bug. *** *** Bug 424559 has been marked as a duplicate of this bug. *** *** Bug 438842 has been marked as a duplicate of this bug. *** Reopening this bug because, with PyQt 5.15.4, PtQt5_sip 12.9 and SIP 6.1, this arose again. Git commit a6296beb25c98d9a4b5a136e0088959bf51d550a by L. E. Segovia. Committed on 18/06/2021 at 15:38. Pushed by lsegovia into branch 'master'. Apply the PyKrita workaround to Qt 5.12 This should've been done previously but it was marked as UPSTREAM. M +2 -2 plugins/extensions/pykrita/plugin/plugin.cpp https://invent.kde.org/graphics/krita/commit/a6296beb25c98d9a4b5a136e0088959bf51d550a Could there be a more proper way to fix this? Perhaps we should explicitly unload the KritaPyQtPlugin before destructing KisApplication? As far as I understand it, this is a race condition inside PyQt5 related to the order of destruction of Python-based QObject instances. Since the call that trigger the crash is the destruction of the plugin itself (which in turn stops the Python engine, etc... as your stacktrace shows), I believe only the PyQt5 authors can solve it. In my understanding, it is not so much of the random destruction order or QObject's, but that all QObject's in Python has to be destructed before QCoreApplication. PyQt already solved it if the QCoreApplication is created from the Python side, by ensuring all QObject's destruction before QCoreApplication. but since in our case QCoreApplication is not created from Python, their solution doesn't do anything for us. In our case, the KritaPyQtPlugin destructor (and thus PyKrita::finalize) is called during the destructor of QCoreApplication, which might be triggering UB? So I wonder if the proper way to clean up is to call PyKrita::finalize earlier, perhaps we can use the QCoreApplication::aboutToQuit signal? Git commit a0c29913114164ff3f2ba4e255ccee1c52cb3e86 by Alvin Wong. Committed on 19/06/2021 at 08:32. Pushed by alvinwong into branch 'master'. Fix PyKrita cleanup using qApp::aboutToQuit to prevent crash Suspecting that we can't have Python clean up its QObject's inside QCoreApplication's destructor, but must be done before it. M +10 -5 plugins/extensions/pykrita/plugin/plugin.cpp https://invent.kde.org/graphics/krita/commit/a0c29913114164ff3f2ba4e255ccee1c52cb3e86 Git commit c936b8a489a5139ed36fb8ec56a5bd07ff542bba by Alvin Wong. Committed on 22/06/2021 at 09:58. Pushed by alvinwong into branch 'master'. Disable PyKrita cleanup again to prevent crash Cleaning up on qApp::aboutToQuit still causes crashes for some, see: https://invent.kde.org/graphics/krita/-/commit/a0c29913114164ff3f2ba4e255ccee1c52cb3e86#note_260688 M +3 -1 plugins/extensions/pykrita/plugin/plugin.cpp https://invent.kde.org/graphics/krita/commit/c936b8a489a5139ed36fb8ec56a5bd07ff542bba *** Bug 436724 has been marked as a duplicate of this bug. *** Git commit 86a38621fbbf96edf489a0efd2b9c24c123e2051 by Dmitry Kazakov. Committed on 03/08/2021 at 08:57. Pushed by dkazakov into branch 'krita/4.3'. Disable finalizing of the PyQt to prevent crash on exit M +4 -5 plugins/extensions/pykrita/plugin/plugin.cpp https://invent.kde.org/graphics/krita/commit/86a38621fbbf96edf489a0efd2b9c24c123e2051 |