D24150: Fix crash on exit in kio_file

Loïc Yhuel noreply at phabricator.kde.org
Mon Sep 23 04:42:06 BST 2019


hwti added a comment.


  In D24150#536169 <https://phabricator.kde.org/D24150#536169>, @dfaure wrote:
  
  > I (thought I) fixed this crash already in commit 512967f6f4e887d4a5a0 <https://phabricator.kde.org/R241:512967f6f4e887d4a5a0a7da5893055e1c840ce5> by removing the ::exit() call (which appears in the backtrace of that bug report).
  >
  > This being said, I'm not objecting to this patch, but I am wondering if you can still experience this crash with a kio that includes my commit above (from Sep 6).
  
  
  QCoreGlobalData destructor is called on any exit, even when returning from main (but there is an exit call in kdeinit5 anyway).
  If there is no other possible exit() call before the kdemain function in file.cpp returns, then you avoided the issue for Qt >= 5.12 : destroying the QTextCodec unregisters it, so it isn't in the list any more when QCoreGlobalData destructor is called.
  But older Qt versions do not have this logic, so QCoreGlobalData destructor often crashes when trying to call the LegacyTextCodec destructor, since the object has already been destroyed and is above the stack pointer. Even if it doesn't crash, free() would then be called on a stack address.

REVISION DETAIL
  https://phabricator.kde.org/D24150

To: hwti, cfeck, dfaure, broulik
Cc: aacid, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190923/b66a80b7/attachment.html>


More information about the Kde-frameworks-devel mailing list