Summary: | Thumbnailer crashes in GSCreator::create() while generating thumbnails | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kio-extras | Reporter: | soundconjurer <palemastervolrath> |
Component: | Thumbnails and previews | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | REOPENED --- | ||
Severity: | normal | CC: | alex765, ambrop7, aramgrigoryan, aspotashev, bugseforuns, DarkCacok1, elvis.angelaccio, jza, m.busico, msiyer.dev, nate, opensuse.lietuviu.kalba |
Priority: | NOR | ||
Version: | 20.04 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kdegraphics-thumbnailers/3e2ea6e924d0e2a2cdd9bb435b06965117d6d34c | Version Fixed In: | 20.03.80 |
Sentry Crash Report: | |||
Attachments: |
So many thumbnails processes spawn.
Fix by changing exit() to _exit(). |
I can't confirm here. Ksysguard only shows 1 thumbnail.so process while dolphin generates thumbnails of 2142 jpg files. Operating System: Arch Linux KDE Plasma Version: 5.15.1 KDE Frameworks Version: 5.55.0 Qt Version: 5.12.1 I can confirm it....I have the same issue Because of these processes, Xorg begins to weigh more SOFTWARE/OS VERSIONS Operating System: KDE neon 5.16 KDE Plasma Version: 5.16.1 KDE Frameworks Version: 5.59.0 Qt Version: 5.12.3 Kernel Version: 4.18.0-21-generic OS Type: 64-bit Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz Memory: 11,4 ГиБ It turned out that this is due to the fact that thumbnail.so cannot display a thumbnail for the djvu file. Decision: Install the djvulibre-bin package (In reply to Maxim from comment #3) > It turned out that this is due to the fact that thumbnail.so cannot display > a thumbnail for the djvu file. > > Decision: > Install the djvulibre-bin package Has this step being confirmed to solved it. I havent seen a djvulibre package both on the regular repositories nor on the AUR database. I also experience the same issue without detecting any djvulibre document. So the issue goes beyond that. I would like to know how @Maxim came to this conclusion as I would like to perform a similar diagnostic and see if there is other 'thumbnail generation issues' for a different format. Regards. I have been experiencing this on NixOS for some time. For me this bug also manifested itself as shutdown/restart hanging for 1.5 minutes as systemd waits for processes to terminate (then proceeds anyway). Relevant part of "pstree -p": ├─thumbnail.so(4023)─┬─thumbnail.so(4028) │ ├─{thumbnail.so}(4024) │ └─{thumbnail.so}(4025) The parent (4023) is just waiting for the child (4028) to terminate: (gdb) attach 4023 ... (gdb) bt #0 0x00007f0f81e88f82 in waitpid () from /nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/libc.so.6 #1 0x00007f0f6d7abdba in GSCreator::create(QString const&, int, int, QImage&) () from /run/current-system/sw/lib/qt-5.12.6/plugins/gsthumbnail.so #2 0x00007f0f758fed4a in ThumbnailProtocol::get(QUrl const&) () from /run/current-system/sw/lib/qt-5.12.6/plugins/kf5/kio/thumbnail.so #3 0x00007f0f778b7416 in KIO::SlaveBase::dispatch(int, QByteArray const&) () from /nix/store/sj97lmn8qy4b1rld3v6hw0d2fxiqiv7q-kio-5.64.0/lib/libKF5KIOCore.so.5 #4 0x00007f0f778b85d6 in KIO::SlaveBase::dispatchLoop() () from /nix/store/sj97lmn8qy4b1rld3v6hw0d2fxiqiv7q-kio-5.64.0/lib/libKF5KIOCore.so.5 #5 0x00007f0f758fbf16 in kdemain () from /run/current-system/sw/lib/qt-5.12.6/plugins/kf5/kio/thumbnail.so #6 0x0000000000409a75 in launch(int, char const*, char const*, char const*, int, char const*, bool, char const*, bool, char const*) () #7 0x000000000040ada8 in handle_launcher_request(int, char const*) [clone .isra.0] () #8 0x000000000040b673 in handle_requests(int) () #9 0x000000000040655f in main () The child (4028) is hung in exit() -> QtDbus atexit handler -> ... -> pthread_cond_wait(). (gdb) attach 4028 ... (gdb) bt #0 0x00007f0f81ce6ee2 in pthread_cond_wait@@GLIBC_2.3.2 () from /nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/libpthread.so.0 #1 0x00007f0f825dafff in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /nix/store/pf3d04a9mm6pidzzy3xm2imz1xlkqj7i-qtbase-5.12.6/lib/libQt5Core.so.5 #2 0x00007f0f825db0e9 in QWaitCondition::wait(QMutex*, unsigned long) () from /nix/store/pf3d04a9mm6pidzzy3xm2imz1xlkqj7i-qtbase-5.12.6/lib/libQt5Core.so.5 #3 0x00007f0f825d4b4e in QThread::wait(unsigned long) () from /nix/store/pf3d04a9mm6pidzzy3xm2imz1xlkqj7i-qtbase-5.12.6/lib/libQt5Core.so.5 #4 0x00007f0f838b8406 in ?? () from /nix/store/pf3d04a9mm6pidzzy3xm2imz1xlkqj7i-qtbase-5.12.6/lib/libQt5DBus.so.5 #5 0x00007f0f838b8499 in ?? () from /nix/store/pf3d04a9mm6pidzzy3xm2imz1xlkqj7i-qtbase-5.12.6/lib/libQt5DBus.so.5 #6 0x00007f0f81dff321 in __run_exit_handlers () from /nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/libc.so.6 #7 0x00007f0f81dff40a in exit () from /nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/libc.so.6 #8 0x00007f0f6d7ab7b2 in GSCreator::create(QString const&, int, int, QImage&) () from /run/current-system/sw/lib/qt-5.12.6/plugins/gsthumbnail.so #9 0x00007f0f758fed4a in ThumbnailProtocol::get(QUrl const&) () from /run/current-system/sw/lib/qt-5.12.6/plugins/kf5/kio/thumbnail.so #10 0x00007f0f778b7416 in KIO::SlaveBase::dispatch(int, QByteArray const&) () from /nix/store/sj97lmn8qy4b1rld3v6hw0d2fxiqiv7q-kio-5.64.0/lib/libKF5KIOCore.so.5 #11 0x00007f0f778b85d6 in KIO::SlaveBase::dispatchLoop() () from /nix/store/sj97lmn8qy4b1rld3v6hw0d2fxiqiv7q-kio-5.64.0/lib/libKF5KIOCore.so.5 #12 0x00007f0f758fbf16 in kdemain () from /run/current-system/sw/lib/qt-5.12.6/plugins/kf5/kio/thumbnail.so #13 0x0000000000409a75 in launch(int, char const*, char const*, char const*, int, char const*, bool, char const*, bool, char const*) () #14 0x000000000040ada8 in handle_launcher_request(int, char const*) [clone .isra.0] () #15 0x000000000040b673 in handle_requests(int) () #16 0x000000000040655f in main () My guess is that the atexit handler is waiting for another thread to signal a pthread condition variable, but that never happens because only the calling thread survives a fork(). In any case, the issue can be fixed by using _exit() instead of exit(), which does not run atexit handlers. I am attaching a patch, which fixes the bug for me. Created attachment 125073 [details]
Fix by changing exit() to _exit().
Git commit 3e2ea6e924d0e2a2cdd9bb435b06965117d6d34c by Elvis Angelaccio, on behalf of Ambroz Bizjak. Committed on 19/01/2020 at 20:35. Pushed by elvisangelaccio into branch 'master'. GSCreator: Fix hang due to calling exit() after fork() Summary: After fork(), exit() invokes atexit handlers, which can result in a lockup if an atexit handler uses thread synchronization facilities, since all but the current thread no longer exist. An example backtrace can be found in the linked bug report. Fix it by using _exit() instead of exit(). FIXED-IN: 20.03.80 Test Plan: I don't know the exact environment required to trigger this bug, but one precondition is to trigger generation of thumbnails via this code; maybe browsing folders with PDF files will do that. Once you see thumbnail.so processes staying around, you must have hit this bug. This patch should prevent this issue from occurring, and it did on my system. Reviewers: #frameworks, elvisangelaccio Reviewed By: elvisangelaccio Subscribers: elvisangelaccio Differential Revision: https://phabricator.kde.org/D26635 M +3 -3 ps/gscreator.cpp https://commits.kde.org/kdegraphics-thumbnailers/3e2ea6e924d0e2a2cdd9bb435b06965117d6d34c *** Bug 406257 has been marked as a duplicate of this bug. *** I can confirm that the bug still exists on 20.04.3 openSUSE Tumbleweed. When i mount an encrypted external HDD it starts to accumulate thumbnail.so processes in the memory and after closing Dolphin lot's of them remain in the memory running... *** Bug 424902 has been marked as a duplicate of this bug. *** *** Bug 424704 has been marked as a duplicate of this bug. *** |
Created attachment 118256 [details] So many thumbnails processes spawn. SUMMARY STEPS TO REPRODUCE 1. Browse many folders with many PDFs or Pictures, things that generate thumbnails. 2. View processes. 3. Observe the numerous thumbnail.so processes. OBSERVED RESULT thumbnail.so processes are created to generate thumbnails, but the processes never seem to die off. EXPECTED RESULT The thumbnail.so processes close after they are finished. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 18.04.2 LTS (available in About System) KDE Plasma Version: 5.12.7 KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION