Summary: | kinit crashes when I close Dolphin while it shows the content of an audio CD | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kinit | Reporter: | Patrick Silva <bugseforuns> |
Component: | general | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | cherkaba, kdelibs-bugs, kitt997, klivmanis+kde, loic.yhuel, nate |
Priority: | NOR | ||
Version: | 5.59.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kio/2c379fecccbf5e2c0b20a93c843c009f2f597318 | Version Fixed In: | |
Sentry Crash Report: |
Description
Patrick Silva
2019-06-16 18:17:59 UTC
https://cgit.kde.org/kio.git/tree/src/ioslaves/file/file.cpp#n719 I wonder if ::exit() is really the only way to "deal" with errors. Someone familiar with KIO error handling would need to investigate how to do it properly. *** Bug 410119 has been marked as a duplicate of this bug. *** I can't reproduce this crash after upgrade to frameworks 5.62 on Arch Linux. (In reply to Christoph Feck from comment #1) > https://cgit.kde.org/kio.git/tree/src/ioslaves/file/file.cpp#n719 > > I wonder if ::exit() is really the only way to "deal" with errors. Someone > familiar with KIO error handling would need to investigate how to do it > properly. It has now been removed : https://cgit.kde.org/kio.git/commit/?id=512967f6f4e887d4a5a0a7da5893055e1c840ce5. But there is an exit() later in kinit, leading to a crash in QCoreGlobalData::~QCoreGlobalData, see the backtrace which was attached to https://bugs.kde.org/show_bug.cgi?id=411441. The root cause is https://cgit.kde.org/kio.git/commit/src/ioslaves/file/file.cpp?id=6738a8b2f71c527f30a624b0b560f79d992715d3. Until Qt 5.12 (https://codereview.qt-project.org/c/qt/qtbase/+/230316), you are not allowed to delete a QTextCodec. Since kdeinit does not call QLibrary::unload, the file.so plugin stays in memory, so you can just do "(void)new LegacyCodec;", QCoreGlobalData::~QCoreGlobalData will delete it on exit. *** Bug 411441 has been marked as a duplicate of this bug. *** Is bug 412103 a duplicate? *** Bug 412103 has been marked as a duplicate of this bug. *** (In reply to Loïc Yhuel from comment #4) > Until Qt 5.12 (https://codereview.qt-project.org/c/qt/qtbase/+/230316), you > are not allowed to delete a QTextCodec. > https://bugs.kde.org/show_bug.cgi?id=412103 made me realize that even with Qt 5.12, allocating a QTextCodec on the stack is not valid, unless there is no exit() anywhere below, since if it isn't destroyed before QCoreGlobalData, the delete operator will be called, which will call free on a stack address. So, even with Qt 5.12, the proper solution is to allocate it on the heap : "(void)new LegacyCodec;". Thanks for the investigation, Loïc! Do you want to submit a patch to phabricator? same kdeinit5 crash when closing dolphin or kate. debian/kde sid (In reply to Christoph Feck from comment #9) > Thanks for the investigation, Loïc! Do you want to submit a patch to > phabricator? Done, https://phabricator.kde.org/D24150 *** Bug 412337 has been marked as a duplicate of this bug. *** *** Bug 412335 has been marked as a duplicate of this bug. *** Git commit 2c379fecccbf5e2c0b20a93c843c009f2f597318 by David Faure. Committed on 27/09/2019 at 00:56. Pushed by dfaure into branch 'master'. Fix crash on exit in kio_file Summary: All QTextCodec are deleted by QCoreGlobalData on exit, so they must be allocated on the heap. Before Qt 5.12, it is even not allowed to delete them. Reviewers: cfeck, dfaure, broulik Reviewed By: dfaure Subscribers: aacid, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D24150 M +2 -1 src/ioslaves/file/file.cpp https://commits.kde.org/kio/2c379fecccbf5e2c0b20a93c843c009f2f597318 *** Bug 413262 has been marked as a duplicate of this bug. *** |