[Kde-pim] Review Request 120999: don't handle events for systray when shutting down, avoiding null pointer dereference and crash

René J.V. Bertin rjvbertin at gmail.com
Wed Nov 5 12:53:49 GMT 2014



> On Nov. 5, 2014, 9:04 a.m., Laurent Montel wrote:
> > Seems good for me.
> > Ship it in 4.14.
> > I will merge in master.
> > Thanks
> > Regards

Pushed. Just got a weird message during the push:

```
> git push -v --all
Pushing to ssh://git@git.kde.org/kdepim
Counting objects: 26, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 488 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: This commit is available for viewing at:
remote: http://commits.kde.org/kdepim/dee0b2510ea1333aed5c7c8d673327c08019e3e1
remote: Closing bug 340624
remote: INFO - Review request 120999 successfully closed.
To ssh://git@git.kde.org/kdepim
   e91ae93..dee0b25  KDE/4.14 -> KDE/4.14
 ! [rejected]        master -> master (non-fast-forward)
updating local tracking ref 'refs/remotes/origin/KDE/4.14'
error: failed to push some refs to 'ssh://git@git.kde.org/kdepim'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Exit 1
> git pull
Already up-to-date.
```

but it seems the commit went through fine regardless?


- René J.V.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120999/#review69874
-----------------------------------------------------------


On Nov. 5, 2014, 1:46 p.m., René J.V. Bertin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120999/
> -----------------------------------------------------------
> 
> (Updated Nov. 5, 2014, 1:46 p.m.)
> 
> 
> Review request for KDEPIM.
> 
> 
> Repository: kdepim
> 
> 
> Description
> -------
> 
> When quitting kontact or kmail through the quit menu action it is not impossible that the process will remain active for a certain time, or even blocked in `KMKernel::cleanup()` (for instance when stuck in the "Retrieving Folder Contents" screen). During that time, kmail's systray entry will remain accessible.
> The documentation for `KJob::exec` (used in `KMKernel::cleanup()`) claims that its nested event loop does not propagate UI events, but despite this, a right-click on the systray icon will result in UI events that will ultimately lead to a null pointer dereference and a crash. See the backtrace in https://bugs.kde.org/show_bug.cgi?id=340624 .
> 
> The patch proposed here prevents this by adding an additional check on `kmkernel->shuttingDown()` in `KMSystemTray::buildPopupMenu()` which prevents the crash. It does not appear to be necessary to protect `KMSystemTray::slotActivated` in a similar way, probably because it bails when there is no main window.
> 
> Note that a similar protection *may* be required in the system tray code for the other kontact components, like akregator.
> 
> 
> Diffs
> -----
> 
>   kmail/kmsystemtray.cpp a960a79 
> 
> Diff: https://git.reviewboard.kde.org/r/120999/diff/
> 
> 
> Testing
> -------
> 
> On Kubuntu 14.04 with KDE 4.14.2 from the kubuntu-backports PPA, and my own ppa:rjvbertin/kdepim .
> With this patch, kontact can still get stuck in `KMKernel::cleanup` when struck by the frozen Retrieving Folder Contents syndrome, but right-clicking the systray icon will now bring up a small menu that allows to quit the application completely.
> 
> Side-note: this 2-step exit occurs on OS X too, even when exiting without the frozen RFC screen. Only here the global menubar remains visible, with an active Quit menu item.
> 
> 
> Thanks,
> 
> René J.V. Bertin
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list