Review Request 128761: Fix crash on exit

Martin Tobias Holmedahl Sandsmark martin.sandsmark at kde.org
Sat Aug 27 12:53:15 UTC 2016


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



Calling exit() before deleting the QApplication is explicitly not supported by Qt, it will lead to random crashes all over the place. See e. g. https://quickgit.kde.org/?p=konsole.git&a=commit&h=fe334292b5402ad0fd4b934291160ece9a12d953 and https://bugreports.qt.io/browse/QTBUG-48709

- Martin Tobias Holmedahl Sandsmark


On Aug. 27, 2016, 9:12 a.m., Peter Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128761/
> -----------------------------------------------------------
> 
> (Updated Aug. 27, 2016, 9:12 a.m.)
> 
> 
> Review request for Plasma, David Edmundson, David Faure, and Hugo Pereira Da Costa.
> 
> 
> Bugs: 356940
>     https://bugs.kde.org/show_bug.cgi?id=356940
> 
> 
> Repository: oxygen
> 
> 
> Description
> -------
> 
> Since Qt 5.6.0, Qt5 applications started crashing on exit. All signs
> point to this delete-on-destroy hack which was added to avoid outliving
> the plugin lifetime.
> 
> This method is wrong because the returned style is owned by the caller
> (QApplication, QProxyStyle, etc) and will cleaned up when those users
> are destructed.
> 
> Copied from breeze patch https://git.reviewboard.kde.org/r/128760/
> 
> 
> Diffs
> -----
> 
>   kstyle/oxygenstyleplugin.cpp 70b90d9 
> 
> Diff: https://git.reviewboard.kde.org/r/128761/diff/
> 
> 
> Testing
> -------
> 
> Started `QT_STYLE_OVERRIDE=oxygen LD_LIBRARY_PATH=... QT_PLUGIN_PATH=... wireshark -o` (an invalid option that triggers `exit(1)`) and observe a heap-use-after free similar to the one reported in the bug. Apply this patch, rebuild oxygen and notice that the crash is fixed. Also tested with "Testcase (ASAN)" from bug 356940, crash is also gone.
> 
> 
> Thanks,
> 
> Peter Wu
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160827/a95d6dba/attachment.html>


More information about the Plasma-devel mailing list