[Kde-pim] Review Request 120999: don't handle events for systray when shutting down, avoiding null pointer dereference and crash
Laurent Montel
montel at kde.org
Wed Nov 5 08:04:32 GMT 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120999/#review69874
-----------------------------------------------------------
Ship it!
Seems good for me.
Ship it in 4.14.
I will merge in master.
Thanks
Regards
- Laurent Montel
On nov. 4, 2014, 9:29 après-midi, René J.V. Bertin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120999/
> -----------------------------------------------------------
>
> (Updated nov. 4, 2014, 9:29 après-midi)
>
>
> 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