Bug 352207

Summary: dolphin crashes when hovering over the 'Activities' context menu entry of a file
Product: [Plasma] kactivitymanagerd Reporter: Michael Kutschall <michaelkutschall>
Component: fileitempluginAssignee: Ivan Čukić <ivan.cukic>
Status: RESOLVED DUPLICATE    
Severity: crash CC: asturm, auxsvr, besancon.vincent, cornelis, davidsaul92426, emmanuelpescosta099, lukasz, michaelkutschall, rindertvonk, rsodrewong, vylu
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.14
Attachments: dolphin-20151116-010200.crash.txt
dolphin-20151117-092919.kcrash.txt

Description Michael Kutschall 2015-09-03 09:53:51 UTC
When hovering over the entries of the context menu of a file or opening submenues, dolphin first freezes because of too many QSqlDatabasePrivate connections and then crashes because of a GLIB error causing a SIGTRAP

> GLib-ERROR **: Creating pipes for GWakeup: Too many open files

> killed by SIGTRAP



Reproducible: Always

Steps to Reproduce:
1. Quickly hover up and down over the context menu of a file
2. When dolphin freezes , continue step 1
3. dolphin crashes

Actual Results:  
When hovering over the entries of the context menu of a file or opening submenues, dolphin freezes after a while because of 

> QSqlDatabasePrivate::addDatabase: duplicate connection name 'kactivities_db_resources_15278000', old connection removed.

while htop shows that

> /usr/bin/X :0 -auth /var/run/sddm/:0 -nolisten tcp -background none -noreset vtl

runs at 100% CPU.

If the mouse movement stops, dolphin sometimes recovers, but not always.
When I continue moving the mouse over the menu, dolphin crashes because of 

> GLib-ERROR **: Creating pipes for GWakeup: Too many open files

> killed by SIGTRAP


Dolphin 15.08.0 on Arch Linux 4.1.6-1

Log Files:
* [dolphin.log](https://dl.dropboxusercontent.com/u/68298459/debug_dolphin/dolphin.log)
* [coredumpctl_gdb.log](https://dl.dropboxusercontent.com/u/68298459/debug_dolphin/coredumpctl_gdb.log)
* [strace.log](https://dl.dropboxusercontent.com/u/68298459/debug_dolphin/strace.log)
Comment 1 Michael Kutschall 2015-09-03 10:01:56 UTC
I forgot to add that when I do the above within gdb, the whole of Plasma freezes with no input possibility exept mouse movement.
Comment 2 Łukasz Żarnowiecki 2015-09-03 11:47:59 UTC
I can confirm existence of the debug.

In my case crashes when mouse enters the Activities but when going down with cursor. In opposite direction it is OK.

https://gist.githubusercontent.com/dolohow/45974e56004c58fbad89/raw/7f96540956eaf1dc59b807968ed9286aeb124a2c/gistfile1.txt
Comment 3 Emmanuel Pescosta 2015-09-03 15:19:13 UTC
*** Bug 349125 has been marked as a duplicate of this bug. ***
Comment 4 Michael Kutschall 2015-09-03 16:34:30 UTC
@Lukasz is right, it's the same bug indeed.

I actually get the multiple
> QSqlDatabasePrivate::addDatabase: duplicate connection name 'kactivities_db_resources_<xxxxxxxx>', old connection removed.
messages only when moving the **mouse** cursor over the "Activities" entry. The direction doesn't matter though.

When trying to reproduce the bug with **keyboard only**, I get a different but similar effect:

1. Open the context menu of a file as usual
2. Instead of hovering over the "Activites" entry, navigate with the arrow keys of your keyboard

Moving over the entry with the up and down arrows, I randomly get 1 or 0 QSqlDatabasePrivate messages but never more.
When pushing the "right" directional key when in "Activites" the submenu doesn't open or only opens for  some milliseconds.
Now I'm not able to move up and down any more, I need to press "left" before I can normally proceed in the menu. So internally, the submenu seems to be active, it just doesn't show on the screen.

I was not able to crash dolphin with this method. Maybe it is the mouse hover repeatedly trying to open and close the submenu while moving over the "Activities" entry.
Comment 5 Vincent Besançon 2015-09-04 12:15:20 UTC
Just installed a fresh Archlinux, same problem when hovering the right click --> Activity menu in dolphin.

As a workaround and because I do not use this menu, you can disable it in the Dolphin services.
See https://www.kubuntuforums.net/showthread.php?59971-Remove-Activities-From-Context-Menu-in-Dolphin.

This is not a solution for sure but that can help to wait for it ;-)
Comment 6 Emmanuel Pescosta 2015-09-04 13:07:24 UTC
Review-Request: https://git.reviewboard.kde.org/r/125044
Comment 7 Emmanuel Pescosta 2015-09-04 20:08:57 UTC
Git commit 821abd02047f15aceb106cd390df2cea502c72bf by Emmanuel Pescosta.
Committed on 04/09/2015 at 20:07.
Pushed by emmanuelp into branch 'master'.

Only spawn one action loader (thread) when the actions of the FileItemLinkingPlugin are not initialized
already.
Related: bug 351585
REVIEW: 125044
FIXED-IN: 5.14

M  +4    -1    src/workspace/fileitemplugin/FileItemLinkingPlugin.cpp
M  +1    -0    src/workspace/fileitemplugin/FileItemLinkingPlugin_p.h

http://commits.kde.org/kactivities/821abd02047f15aceb106cd390df2cea502c72bf
Comment 8 Emmanuel Pescosta 2015-09-14 19:29:58 UTC
*** Bug 352702 has been marked as a duplicate of this bug. ***
Comment 9 Andreas Sturmlechner 2015-09-18 19:15:18 UTC
This doesn't seem to be entirely fixed - after upgrading to kactivities-5.14, dolphin is still crashing sometimes when hovering over the activities context entry.
Comment 10 Emmanuel Pescosta 2015-09-18 19:36:10 UTC
(In reply to andreas.sturmlechner from comment #9)
> This doesn't seem to be entirely fixed - after upgrading to
> kactivities-5.14, dolphin is still crashing sometimes when hovering over the
> activities context entry.

Can you please provide a backtrace and/or valgrind log? Thanks!
Comment 11 Hussam Al-Tayeb 2015-09-18 19:54:15 UTC
(In reply to Emmanuel Pescosta from comment #10)
> (In reply to andreas.sturmlechner from comment #9)
> > This doesn't seem to be entirely fixed - after upgrading to
> > kactivities-5.14, dolphin is still crashing sometimes when hovering over the
> > activities context entry.
> 
> Can you please provide a backtrace and/or valgrind log? Thanks!

It is crashing here too. The distribution I currently use (Arch Linux) strips debug symbols but I can easily recompile packages without stripping those. Which packages would you like me to do? Dolphin/kactivities enough?
I can do Qt as well if needed but it won't finish today as it is a lengthy compile.
Comment 12 Hussam Al-Tayeb 2015-09-19 14:23:58 UTC
On Friday, September 18, 2015 7:54:15 PM EEST you wrote:
> https://bugs.kde.org/show_bug.cgi?id=352207
> 
> --- Comment #11 from Hussam Al-Tayeb <hussam@visp.net.lb> ---
> (In reply to Emmanuel Pescosta from comment #10)
> 
> > (In reply to andreas.sturmlechner from comment #9)
> > 
> > > This doesn't seem to be entirely fixed - after upgrading to
> > > kactivities-5.14, dolphin is still crashing sometimes when hovering over
> > > the activities context entry.
> > 
> > Can you please provide a backtrace and/or valgrind log? Thanks!
> 
> It is crashing here too. The distribution I currently use (Arch Linux)
> strips debug symbols but I can easily recompile packages without stripping
> those. Which packages would you like me to do? Dolphin/kactivities 
enough?
> I can do Qt as well if needed but it won't finish today as it is a lengthy
> compile.

This is what journald is logging:

           PID: 1756 (dolphin)                                                                                                                                                                                                                                                 
           UID: 1000 (hussam)                                                                                                                                                                                                                                                  
           GID: 100 (users)                                                                                                                                                                                                                                                    
        Signal: 11 (SEGV)                                                                                                                                                                                                                                                      
     Timestamp: Sat 2015-09-19 17:21:15 EEST (50s ago)                                                                                                                                                                                                                         
  Command Line: dolphin                                                                                                                                                                                                                                                        
    Executable: /usr/bin/dolphin                                                                                                                                                                                                                                               
 Control Group: /user.slice/user-1000.slice/session-c4.scope                                                                                                                                                                                                                   
          Unit: session-c4.scope                                                                                                                                                                                                                                               
         Slice: user-1000.slice                                                                                                                                                                                                                                                
       Session: c4                                                                                                                                                                                                                                                             
     Owner UID: 1000 (hussam)                                                                                                                                                                                                                                                  
       Boot ID: df430cfaaded41a3bfb7643a3a54e5d1                                                                                                                                                                                                                               
    Machine ID: efb490e643e2436d9d1138df1745a008                                                                                                                                                                                                                               
      Hostname: hades                                                                                                                                                                                                                                                          
       Message: Process 1756 (dolphin) of user 1000 dumped core.                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                               
                Stack trace of thread 1796:                                                                                                                                                                                                                                    
                #0  0x00007f17120b1bf4 
_ZN18QThreadStorageData6finishEPPv (libQt5Core.so.5)                                                                                                                                                                                    
                #1  0x00007f17120b2eb1 n/a (libQt5Core.so.5)                                                                                                                                                                                                                   
                #2  0x00007f17120b3df6 n/a (libQt5Core.so.5)                                                                                                                                                                                                                   
                #3  0x00007f170d67266c start_thread (libpthread.so.0)                                                                                                                                                                                                          
                #4  0x00007f1717f6694d __clone (libc.so.6)                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                               
                Stack trace of thread 1756:                                                                                                                                                                                                                                    
                #0  0x00007f1717f5cc3d poll (libc.so.6)                                                                                                                                                                                                                        
                #1  0x00007f170cf372b5 n/a (libglib-2.0.so.0)                                                                                                                                                                                                                  
                #2  0x00007f170cf373f2 g_main_context_iteration 
(libglib-2.0.so.0)                                                                                                                                                                                             
                #3  0x00007f1712306680 
_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE 
(libQt5Core.so.5)                                                                                                                                   
                #4  0x00007f17122a8e73 
_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE 
(libQt5Core.so.5)                                                                                                                                                                 
                #5  0x00007f171362c3c5 
_ZN5QMenu4execERK6QPointP7QAction (libQt5Widgets.so.5)                                                                                                                                                                                  
                #6  0x00007f1718279901 
_ZN18DolphinContextMenu19openItemContextMenuEv 
(libkdeinit5_dolphin.so)                                                                                                                                                                 
                #7  0x00007f171827af98 _ZN18DolphinContextMenu4openEv 
(libkdeinit5_dolphin.so)                                                                                                                                                                                 
                #8  0x00007f171826fa7c 
_ZN17DolphinMainWindow15openContextMenuERK6QPointRK9KFileItemRK4QUrlRK5QListIP7QActionE 
(libkdeinit5_dolphin.so)                                                                                                                        
                #9  0x00007f17122dc623 
_ZN11QMetaObject8activateEP7QObjectiiPPv (libQt5Core.so.5)                                                                                                                                                                              
                #10 0x00007f1717c2e373 
_ZN11DolphinView18requestContextMenuERK6QPointRK9KFileItemRK4QUrlRK5QListIP7QActionE 
(libdolphinprivate.so.5)                                                                                                                           
                #11 0x00007f1717c0701d 
_ZN11DolphinView28slotItemContextMenuRequestedEiRK7QPointF 
(libdolphinprivate.so.5)                                                                                                                                                     
                #12 0x00007f17122dc623 
_ZN11QMetaObject8activateEP7QObjectiiPPv (libQt5Core.so.5)                                                                                                                                                                              
                #13 0x00007f1717c2c3d2 
_ZN19KItemListController24itemContextMenuRequestedEiRK7QPointF 
(libdolphinprivate.so.5)                                                                                                                                                 
                #14 0x00007f1717bbfef8 
_ZN19KItemListController15mousePressEventEP24QGraphicsSceneMouseEventRK10QTransform 
(libdolphinprivate.so.5)                                                                                                                            
                #15 0x00007f1717bbf428 
_ZN19KItemListController12processEventEP6QEventRK10QTransform 
(libdolphinprivate.so.5)                                                                                                                                                  
                #16 0x00007f1717bd3a26 
_ZN13KItemListView5eventEP6QEvent (libdolphinprivate.so.5)                                                                                                                                                                              
                #17 0x00007f1713494f4c 
_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent 
(libQt5Widgets.so.5)                                                                                                                                                          
                #18 0x00007f171349a7a8 
_ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)                                                                                                                                                                         
                #19 0x00007f17122ab72b 
_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent 
(libQt5Core.so.5)                                                                                                                                                               
                #20 0x00007f17137ef62b n/a (libQt5Widgets.so.5)                                                                                                                                                                                                                
                #21 0x00007f17137f0148 n/a (libQt5Widgets.so.5)                                                                                                                                                                                                                
                #22 0x00007f17137f8f20 n/a (libQt5Widgets.so.5)                                                                                                                                                                                                                
                #23 0x00007f17137f939c 
_ZN14QGraphicsScene15mousePressEventEP24QGraphicsSceneMouseEvent 
(libQt5Widgets.so.5)
                #24 0x00007f1713802f90 
_ZN14QGraphicsScene5eventEP6QEvent (libQt5Widgets.so.5)
                #25 0x00007f1713494f4c 
_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent 
(libQt5Widgets.so.5)
                #26 0x00007f171349a7a8 
_ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #27 0x00007f17122ab72b 
_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent 
(libQt5Core.so.5)
                #28 0x00007f171381f265 
_ZN13QGraphicsView15mousePressEventEP11QMouseEvent 
(libQt5Widgets.so.5)
                #29 0x00007f17134dcccf _ZN7QWidget5eventEP6QEvent 
(libQt5Widgets.so.5)
                #30 0x00007f17135e9cd2 _ZN6QFrame5eventEP6QEvent 
(libQt5Widgets.so.5)
                #31 0x00007f17138206eb 
_ZN13QGraphicsView13viewportEventEP6QEvent (libQt5Widgets.so.5)
                #32 0x00007f17122ab4ec 
_ZN23QCoreApplicationPrivate29sendThroughObjectEventFiltersEP7QObjectP6QEvent 
(libQt5Core.so.5)
                #33 0x00007f1713494f2e 
_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent 
(libQt5Widgets.so.5)
                #34 0x00007f171349acf4 
_ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #35 0x00007f17122ab72b 
_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent 
(libQt5Core.so.5)
                #36 0x00007f1713499d69 
_ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Eb 
(libQt5Widgets.so.5)
                #37 0x00007f17134f87a3 n/a (libQt5Widgets.so.5)
                #38 0x00007f17134faefb n/a (libQt5Widgets.so.5)
                #39 0x00007f1713494f4c 
_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent 
(libQt5Widgets.so.5)
                #40 0x00007f171349a7a8 
_ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #41 0x00007f17122ab72b 
_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent 
(libQt5Core.so.5)
                #42 0x00007f1712c9e84a 
_ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE 
(libQt5Gui.so.5)
                #43 0x00007f1712ca05f5 
_ZN22QGuiApplicationPrivate24processWindowSystemEventEPN29QWindowSystemInterfacePrivate17WindowSystemEventE 
(libQt5Gui.so.5)
                #44 0x00007f1712c83a39 
_ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE 
(libQt5Gui.so.5)
                #45 0x00007f17021cba33 n/a (libQt5XcbQpa.so.5)
                #46 0x00007f170cf3708a g_main_context_dispatch 
(libglib-2.0.so.0)
                #47 0x00007f170cf37318 n/a (libglib-2.0.so.0)
                #48 0x00007f170cf373f2 g_main_context_iteration 
(libglib-2.0.so.0)
                #49 0x00007f1712306680 
_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE 
(libQt5Core.so.5)
                #50 0x00007f17122a8e73 
_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE 
(libQt5Core.so.5)
                #51 0x00007f17122b1556 _ZN16QCoreApplication4execEv 
(libQt5Core.so.5)
                #52 0x00007f17182838cf kdemain (libkdeinit5_dolphin.so)
                #53 0x00007f1717e91734 __libc_start_main (libc.so.6)
                #54 0x0000000000400799 _start (dolphin)
                
                Stack trace of thread 1757:
                #0  0x00007f1717f5cc3d poll (libc.so.6)
                #1  0x00007f170adc9b5a n/a (libxcb.so.1)
                #2  0x00007f170adcbb3f xcb_wait_for_event (libxcb.so.1)
                #3  0x00007f17021983e1 n/a (libQt5XcbQpa.so.5)
                #4  0x00007f17120b3dd5 n/a (libQt5Core.so.5)
                #5  0x00007f170d67266c start_thread (libpthread.so.0)
                #6  0x00007f1717f6694d __clone (libc.so.6)
                
                Stack trace of thread 1758:
                #0  0x00007f1717f5cc3d poll (libc.so.6)
                #1  0x00007f170cf372b5 n/a (libglib-2.0.so.0)
                #2  0x00007f170cf373f2 g_main_context_iteration 
(libglib-2.0.so.0)
                #3  0x00007f171230669b 
_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE 
(libQt5Core.so.5)
                #4  0x00007f17122a8e73 
_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE 
(libQt5Core.so.5)
                #5  0x00007f17120ae90d _ZN7QThread4execEv 
(libQt5Core.so.5)
                #6  0x00007f17120b3dd5 n/a (libQt5Core.so.5)
                #7  0x00007f170d67266c start_thread (libpthread.so.0)
                #8  0x00007f1717f6694d __clone (libc.so.6)
                
                Stack trace of thread 1768:
                #0  0x00007f170d678998 
pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00007f17120b4fec 
_ZN14QWaitCondition4waitEP6QMutexm (libQt5Core.so.5)
                #2  0x00007f17120b0721 n/a (libQt5Core.so.5)
                #3  0x00007f17120b3dd5 n/a (libQt5Core.so.5)
                #4  0x00007f170d67266c start_thread (libpthread.so.0)
                #5  0x00007f1717f6694d __clone (libc.so.6)


I can try gdb which will probably output something more useful but sadly it 
is making my desktop freeze when dolphin crashes from gdb.
Comment 13 Andreas Sturmlechner 2015-11-16 00:15:44 UTC
Created attachment 95523 [details]
dolphin-20151116-010200.crash.txt

Managed to reproduce a crash while gdb'ing.
Comment 14 Ivan Čukić 2015-11-16 07:22:46 UTC
Cool, can you switch the widget theme from breeze to Qt's Fusion and Oxygen and try to reproduce the crash. (your gdb backtrace ends in breeze, so it is probably a good idea to remove it from the equation)
Comment 15 Andreas Sturmlechner 2015-11-18 14:52:01 UTC
Created attachment 95584 [details]
dolphin-20151117-092919.kcrash.txt

Another crash (with breeze), but this time it managed to trigger drkonqi and also actually contained a backtrace, hence attaching. I've upgraded to 15.12.49.9999 for kcrash linking.
Comment 16 Christoph Feck 2015-11-24 12:11:49 UTC
*** Bug 355813 has been marked as a duplicate of this bug. ***
Comment 17 Ivan Čukić 2015-11-27 22:29:55 UTC
With all the info, or the lack of it, I'm marking this as a duplicate of another context menu crash.

*** This bug has been marked as a duplicate of bug 351485 ***