Review Request: Mitigate potential crashes associated with the use of QDialog::exec in kdelibs

David Faure faure at kde.org
Wed May 2 16:20:08 BST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104802/#review13274
-----------------------------------------------------------



kio/kfile/kpropertiesdialog.cpp
<http://git.reviewboard.kde.org/r/104802/#comment10401>

    Nice one, deleting the dialog immediately after show() !
    
    See, this is exactly why I'm against such massive changes. It's just too easy to slip in an untested change, which introduces a regression.
    
    So instead of a fix for a bug that did not actually happen, we have a regression that does happen. Not good.
    
    I'm veto'ing this for 4.8.
    
    At most, review it again to ensure it *only* changes code paths that call exec(), *test it*, and put it in the frameworks branch only.
    Yes it's hard to test so many code paths at once, so let's only change code paths one by one, after testing them.


- David Faure


On May 1, 2012, 4:37 p.m., Dawit Alemayehu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104802/
> -----------------------------------------------------------
> 
> (Updated May 1, 2012, 4:37 p.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Description
> -------
> 
> This patch attempts to mitigate the unintended crashes that might result from using QDialog::exec in kdelibs. Since nested event loops are potential sources of inadvertent crashes, this patch attempts to prevent that by changing how dialogs are created in kdelibs. All blocking dialog calls, i.e. those that invoke QDialog.exec(), are wrapped with QPointer and the QPointer is checked once QDialog.exec returns. See http://www.kdedevelopers.org/node/3919 for more details.
> 
> Note that I am aware of other classes that create nested event loops (e.g. QProcess), but this fix is only applicable to QDialog usage.
> 
> 
> Diffs
> -----
> 
>   kdeui/colors/kcolordialog.cpp 95bb7f5 
>   kdeui/dialogs/kedittoolbar.cpp bb80952 
>   kdeui/dialogs/kinputdialog.cpp 2801c00 
>   kdeui/dialogs/kpixmapregionselectordialog.cpp 11d964b 
>   kdeui/dialogs/kshortcutsdialog.cpp a73f8f2 
>   kdeui/dialogs/kshortcutseditor.cpp 5984a9d 
>   kdeui/findreplace/kfinddialog.cpp de2dd90 
>   kdeui/fonts/kfontdialog.cpp 9bea490 
>   kdeui/widgets/ktextedit.cpp 1e58706 
>   kdeui/xmlgui/kmenumenuhandler_p.cpp d8c82b6 
>   kfile/kdiroperator.cpp 18ffc34 
>   kfile/kdirselectdialog.cpp e0dcafa 
>   kfile/kfileplaceeditdialog.cpp 5537551 
>   kio/kfile/kacleditwidget.cpp d89429f 
>   kio/kfile/kencodingfiledialog.cpp 4686065 
>   kio/kfile/kfiledialog.cpp d121e4d 
>   kio/kfile/kicondialog.cpp b7d646f 
>   kio/kfile/kpropertiesdialog.cpp feb0c9e 
>   kio/kfile/kurlrequesterdialog.cpp 8ee29e1 
>   kio/kio/jobuidelegate.cpp 85679c2 
>   kio/kio/kbuildsycocaprogressdialog.cpp fba30ec 
>   kio/kio/passworddialog.cpp faf0c77 
>   kio/kio/paste.cpp ca451fb 
>   kio/kssl/kcm/cacertificatespage.cpp 0a269a3 
>   knewstuff/knewstuff2/ui/downloaddialog.cpp b4d2dcd 
>   knewstuff/knewstuff2/ui/kdxsbutton.cpp e8f8c83 
>   knewstuff/knewstuff3/knewstuffbutton.cpp 9c14e99 
>   kparts/browserrun.cpp c89829d 
>   kutils/kpluginselector.cpp 505e53f 
>   nepomuk/ui/tagwidget.cpp 7c59922 
>   nepomuk/utils/searchwidget.cpp f46e72a 
> 
> Diff: http://git.reviewboard.kde.org/r/104802/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Dawit Alemayehu
> 
>

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


More information about the kde-core-devel mailing list