Summary: | Filelight crash on directory scan start | ||
---|---|---|---|
Product: | [Applications] filelight | Reporter: | Jaak Ristioja <jaak> |
Component: | general | Assignee: | Martin Sandsmark <martin.sandsmark> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | asturm, sitter, thomas.bettler |
Priority: | NOR | ||
Version: | 22.04.0 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
URL: | https://bugreports.qt.io/browse/QTBUG-109732 | ||
Latest Commit: | https://invent.kde.org/qt/qt/qtbase/commit/9853ce1045834f4f4b94a4745a473a1cda8c60fa | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
emerge_compile_log.txt
emerge_info.txt |
Description
Jaak Ristioja
2022-02-06 09:53:52 UTC
That stacktrace is weird, but the crash is an assert that is removed in qt6: https://code.qt.io/cgit/qt/qtbase.git/commit/?id=ecfda98d1f91c6a7da0d89826558d856cd88e670 It seems like filelight is attempting to quit at the same time (thread 1, we got an ICE message about saving session), were you attempting to log out when it happened? If so I assume there is an issue with QThreadPool not being nice if the application suddenly attempts to quit, which should be better in qt6. If not, could you try running it with the glib event loop off (it's been buggy before), like so: «QT_NO_GLIB=1 filelight». (In reply to Martin Sandsmark from comment #1) > That stacktrace is weird, but the crash is an assert that is removed in qt6: > https://code.qt.io/cgit/qt/qtbase.git/commit/ > ?id=ecfda98d1f91c6a7da0d89826558d856cd88e670 Yes. > It seems like filelight is attempting to quit at the same time (thread 1, we > got an ICE message about saving session), were you attempting to log out > when it happened? No. > If so I assume there is an issue with QThreadPool not being nice if the > application suddenly attempts to quit, which should be better in qt6. > > If not, could you try running it with the glib event loop off (it's been > buggy before), like so: «QT_NO_GLIB=1 filelight». It seems to make not difference whether running with QT_NO_GLIB=1 or QT_NO_GLIB=0 in the environment, or no QT_NO_GLIB environment variable at all. In all these cases I can reproduce the exact same crash when starting to scan. Git commit e873c3bfa2e6f971e1699a5377a0e46c7e363442 by Harald Sitter. Committed on 26/04/2022 at 19:21. Pushed by sitter into branch 'master'. grand qml rewrite this moves the entire main ui (excluding settings) to qtquick from qwidgets. this loses some of the more esoteric kxmlgui features but should be a good path forward on the balance the actual map is still being qpainted, so this isn't super ideal but the plan there is to hopefully use kquickcharts eventually instead of a custom implementation. settings dialog still needs porting but is kept qwidget for now to at least reduce the scope of this port slightly Related: bug 443751, bug 445018, bug 445026, bug 445027 M +2 -1 .kde-ci.yml M +2 -1 CMakeLists.txt M +6 -9 src/CMakeLists.txt M +6 -5 src/Config.h M +1 -1 src/app/CMakeLists.txt M +5 -2 src/fileTree.h M +9 -23 src/main.cpp A +264 -0 src/mainContext.cpp [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] A +81 -0 src/mainContext.h [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] D +0 -587 src/mainWindow.cpp D +0 -118 src/mainWindow.h D +0 -71 src/overviewWidget.cpp D +0 -23 src/overviewWidget.h D +0 -121 src/progressBox.cpp D +0 -48 src/progressBox.h A +14 -0 src/qml/AboutPage.qml [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] A +9 -0 src/qml/Action.qml [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] A +165 -0 src/qml/MapPage.qml [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] A +72 -0 src/qml/OverviewPage.qml [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] A +183 -0 src/qml/main.qml [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] A +13 -0 src/qml/qml.qrc A +906 -0 src/radialMap/item.cpp [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] R +36 -43 src/radialMap/item.h [from: src/radialMap/widget.h - 051% similarity] D +0 -308 src/radialMap/labels.cpp A +42 -0 src/radialMap/labels.h [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] M +20 -8 src/radialMap/map.cpp M +4 -1 src/radialMap/map.h A +17 -0 src/radialMap/radialMap.cpp [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] D +0 -212 src/radialMap/widget.cpp D +0 -395 src/radialMap/widgetEvents.cpp M +10 -1 src/scan.cpp M +8 -3 src/scan.h https://invent.kde.org/utilities/filelight/commit/e873c3bfa2e6f971e1699a5377a0e46c7e363442 (In reply to Harald Sitter from comment #3) > Git commit e873c3bfa2e6f971e1699a5377a0e46c7e363442 by Harald Sitter. That does not seem to fix the issue. I still get the same crash after building the Gentoo package with `git diff v22.04.0..e873c3b` applied as a user patch. Did you perhaps mean to resolve another bug instead? Updating the product version from 21.12.2, because it still happens with 22.04.0 as well, and I forgot to note this in my previous comment. *** Bug 463591 has been marked as a duplicate of this bug. *** I find it suspicious that this only appears to happen on gentoo. Anything about your compile flags being funny maybe? Or maybe Qt was built without a dependency? Created attachment 154920 [details]
emerge_compile_log.txt
no special flags applied
Created attachment 154921 [details]
emerge_info.txt
emerge --info
in my case assert fails due to r->ref being 0 in some thread. as the assert itself isn't helpful and got dropped upstream I investigated and confirm applying the upstream patches solve this issue for me: - https://github.com/qt/qtbase/commit/999c79863c574bdf3e1650a1b0901fdf83a9e0b4 - https://github.com/qt/qtbase/commit/5a4b275a201bfc653a99e8b6ab546573553b79ad (In reply to Thomas Bettler from comment #9) > Created attachment 154921 [details] > emerge_info.txt > > emerge --info I'd be more interested in the information for qtbase. The upstream commit isn't really a good candidate for backporting to Qt5 unfortunately. (In reply to Harald Sitter from comment #11) > (In reply to Thomas Bettler from comment #9) > > emerge --info > > I'd be more interested in the information for qtbase. emerge --info is global, unless user has made overrides for specific packages. Regarding qtbase, it is split in Gentoo with filelight depending on qtcore, qtgui and qtwidgets. Assuming toolchain, CFLAGS etc. are consistent globally, you could still show us `equery u qtcore qtgui qtwidgets` to let us look into your USE flag situation. (to be clear, filelight-22.12.0 - or previous versions - hasn't crashed for me in Gentoo) (In reply to Andreas Sturmlechner from comment #12) > Regarding qtbase, it is split in Gentoo with filelight depending on qtcore, > qtgui and qtwidgets. Assuming toolchain, CFLAGS etc. are consistent > globally, you could still show us `equery u qtcore qtgui qtwidgets` to let > us look into your USE flag situation. $ equery u qtcore qtgui qtwidgets [ Legend : U - final flag setting for installation] [ : I - package is installed with flag ] [ Colors : set, unset ] * Found these USE flags for dev-qt/qtcore-5.15.7: U I + + debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces + + icu : Enable ICU (Internationalization Components for Unicode) support, using dev-libs/icu - - old-kernel : (Restricted to <dev-qt/qtcore-5.15.0) Disable syscalls not available on Linux kernels older than 3.17 - - systemd : Enable native journald logging support - - test : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently) * Found these USE flags for dev-qt/qtgui-5.15.7-r1: U I + + X : Build the XCB platform plugin and enable X11 integration + + accessibility : Add support for accessibility (eg 'at-spi' library) + + dbus : Enable dbus support for anything that needs it (gpsd, gnomemeeting, etc) + + debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces + + egl : Enable EGL integration - - eglfs : Build the EGL Full Screen/Single Surface platform plugin + + evdev : Enable support for input devices via evdev - - gles2-only : Use GLES 2.0 or later instead of full OpenGL - - ibus : Build the IBus input method plugin + + jpeg : Add JPEG image support + + libinput : Enable support for input devices via dev-libs/libinput - - linuxfb : Enable Linux framebuffer support for embedded devices + + png : Add support for libpng (PNG images) - - test : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently) - - tslib : Enable support for touchscreen devices via x11-libs/tslib - - tuio : Build plugin to receive touch events over the TUIO protocol + + udev : Enable virtual/udev integration (device discovery, power and storage device support, etc) + + vnc : Enable VNC (remote desktop viewer) support + + vulkan : Enable support for Vulkan + + wayland : Provide dev-qt/qtwayland to ensure Qt applications can be run as Wayland clients * Found these USE flags for dev-qt/qtwidgets-5.15.7: U I + + X : Add support for X11 + + dbus : Enable dbus support for anything that needs it (gpsd, gnomemeeting, etc) + + debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces - - gles2-only : Use GLES 2.0 or later instead of full OpenGL + + gtk : Build the GTK platform theme plugin + + png : Add support for libpng (PNG images) - - test : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently) I do wonder... Reading the code this may legitimately fail the assert in the code paths we are hitting. The reason it only happens for you is because you build with debug perhaps? Yes, possibly. Right, I can reproduce the crash with a -debug build. Git commit 95647dc3c5045724c0cc6218ec459e92bb45ed3e by Harald Sitter. Committed on 01/01/2023 at 15:55. Pushed by sitter into branch 'master'. work around bug in QThreadPool::tryStart(std::function) the underlying code doesn't correctly set up ref counting before passing the internally created runnable to QThreadPoolPrivate. this later results in failed assertions about the ref counting. instead create a qrunnable of our function so we can use tryStart(QRunnable) which has correct ref counting code. this prevents crashing when used with full on debug builds of Qt M +6 -1 src/localLister.cpp https://invent.kde.org/utilities/filelight/commit/95647dc3c5045724c0cc6218ec459e92bb45ed3e Git commit 83d15a5a71bf189627c28dd2eb2e2a9f41863648 by Harald Sitter. Committed on 01/01/2023 at 16:10. Pushed by sitter into branch 'release/22.12'. work around bug in QThreadPool::tryStart(std::function) the underlying code doesn't correctly set up ref counting before passing the internally created runnable to QThreadPoolPrivate. this later results in failed assertions about the ref counting. instead create a qrunnable of our function so we can use tryStart(QRunnable) which has correct ref counting code. this prevents crashing when used with full on debug builds of Qt M +6 -1 src/localLister.cpp https://invent.kde.org/utilities/filelight/commit/83d15a5a71bf189627c28dd2eb2e2a9f41863648 well done :-) that fixed it for me Why did you enable debug, anyway? originally debug is enabled for qtcore to produce meaninful backtraces for a couple of bugs with digikam, kwin/plasma-integration, mesa/opencl, and others. :-) I never experienced such a runtime issue due to debug enabled until now... (In reply to Thomas Bettler from comment #22) > originally debug is enabled for qtcore to produce meaninful backtraces for a > couple of bugs with digikam, kwin/plasma-integration, mesa/opencl, and > others. :-) > I never experienced such a runtime issue due to debug enabled until now... That's not what +debug does, it actually enables extra debug codepaths that may affect runtime behaviour as you just experienced. For backtraces, read here: https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces I can also confirm that the committed fix solves this issue. Thank you very much! :-) I'm using debug builds of Qt for mostly the same reasons: it helps debugging. More specifically, I think I turned on USE=debug for Qt on my Gentoo system when I was hacking on BibleTime code, which also uses Qt. I guess I was dealing with some Qt intricacies which I hoped to solve that way. Git commit 9853ce1045834f4f4b94a4745a473a1cda8c60fa by Albert Astals Cid, on behalf of Harald Sitter. Committed on 01/02/2023 at 21:06. Pushed by aacid into branch 'kde/5.15'. correctly set up ref counting in QThreadPool::tryStart(std::function) this function was inconsistent with the QThreadPool::tryStart(QRunnable) overload, where ref counting does get set up correctly. the lack of ref counting setup would later cause trouble because we assert the ref counting state all over QThreadPool. to prevent failed assertions we correctly set up ref counting now. this change is not applicable to Qt6 because the ref counting has already been removed there: https://github.com/qt/qtbase/commit/ecfda98d1f91c6a7da0d89826558d856cd88e670 M +4 -0 src/corelib/thread/qthreadpool.cpp https://invent.kde.org/qt/qt/qtbase/commit/9853ce1045834f4f4b94a4745a473a1cda8c60fa |