Review Request 118858: Fix crashes in KUrlNavigator that are caused by accesses to objects which have been deleted in nested event loops

Dominik Haumann dhaumann at kde.org
Sat Jun 21 11:34:14 BST 2014


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


Just for info: Similar problems exist when an application runs an extra event loop through a QDialog::exec() call and the app is quit through a dbus call.
There once was a blog about it by Frank Osterfeld (read also the "Update" note, unfortunately, the markup is a bit broken):
http://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0 (and a followup here: http://kate-editor.org/2012/04/06/crash-through-d-bus-calls/ )

The solution is also to use a QPointer, on the dialog itself (and maybe additionally on the this QObject).

In other words, your fix is probably more than just a short-term workaround ;)

- Dominik Haumann


On June 21, 2014, 8:26 a.m., Frank Reininghaus wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118858/
> -----------------------------------------------------------
> 
> (Updated June 21, 2014, 8:26 a.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Bugs: 293863
>     http://bugs.kde.org/show_bug.cgi?id=293863
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> KUrlNavigator opens menus with exec() in a few places, and accesses member variables or pointers to children after that. This can cause crashes if the object has been deleted inside the nested event loops.
> 
> This can be fixed by using QPointers to detect if an object was deleted already, and return immediately in that case.
> 
> 
> Diffs
> -----
> 
>   kfile/kurlnavigator.cpp f5dfc81 
>   kfile/kurlnavigatorbutton.cpp 6cb40b1 
> 
> Diff: https://git.reviewboard.kde.org/r/118858/diff/
> 
> 
> Testing
> -------
> 
> Cannot reproduce the crashes any more. The menus in KUrlNavigator still work fine for me.
> 
> 
> Thanks,
> 
> Frank Reininghaus
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140621/cff8f900/attachment.htm>


More information about the kde-core-devel mailing list