Bug 384705 - kwayland-integration fails idleTest due to heap-use-after-free
Summary: kwayland-integration fails idleTest due to heap-use-after-free
Status: RESOLVED FIXED
Alias: None
Product: kwayland
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.38.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Martin Flöser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-14 13:09 UTC by Heiko Becker
Modified: 2017-10-21 12:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Becker 2017-09-14 13:09:00 UTC
I'm not sure if this actually should be assigned to frameworks-kwayland, but kwayland-integration didn't really change between 5.10.5 and 5.10.95. So I suspect something broke with kwayland-5.38.0. Thanks for moving it to the right product, if I'm wrong.

Anyway like the summary says kwayland-integration fails its idleTest here and on build.kde.org: https://build.kde.org/job/Plasma%20kwayland-integration%20kf5-qt5%20SUSEQt5.9/2/console
I can reproduce it with kwayland-integration 5.10.5 and 5.10.95

KF5 5.38.0
Qt 5.9.1
Comment 1 Martin Flöser 2017-10-21 11:15:39 UTC
This should be fixed by kwayland-integration commit e27d843cc3204c4dee64166d5ea60beaf0bf5d47

    Unload poller's connection thread earlier in teardown
    
    Summary:
    KIdleTime is a global static, it's destructor it deletes the backend in
    a deleteLater; This is *after* the app has been deleted.
    
    This means we end up deleting Poller's ConnectionThread after the static
    QVector managing the ConnectionThreads in the main app has been deleted,
    leading to a confusing crash.
    
    We can fix this by deleting the connection thread in unload rather than
    the actual object destruction.
    
    This fixes a crash on app close, most notably the recursive drkonqi
    crash.
    
    Test Plan:
    Verified what was happening by subclassing the vector and adding debug
    Had the drkonqi crash loop, made this change, no more crashes
    
    Reviewers: graesslin
    
    Reviewed By: graesslin
    
    Subscribers: anthonyfieroni, plasma-devel
    
    Tags: #plasma
    
    Differential Revision: https://phabricator.kde.org/D8285
Comment 2 Heiko Becker 2017-10-21 12:05:46 UTC
(In reply to Martin Flöser from comment #1)
> This should be fixed by kwayland-integration commit
> e27d843cc3204c4dee64166d5ea60beaf0bf5d47

Indeed it is. Thanks!