Bug 44384 - [Qt] Crash when purging the scratch buffer for the shadow
Summary: [Qt] Crash when purging the scratch buffer for the shadow
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ariya Hidayat
Keywords: Qt, QtTriaged
Depends on:
Reported: 2010-08-21 15:21 PDT by Ariya Hidayat
Modified: 2010-08-23 01:16 PDT (History)
2 users (show)

See Also:

Patch (2.72 KB, patch)
2010-08-21 16:11 PDT, Ariya Hidayat
no flags Details | Formatted Diff | Diff
Patch (2.82 KB, patch)
2010-08-22 21:41 PDT, Ariya Hidayat
kenneth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ariya Hidayat 2010-08-21 15:21:13 PDT
The purge timer might stop or fire after the application is destroyed, and thus causes a crash.
Comment 1 Ariya Hidayat 2010-08-21 16:11:29 PDT
Created attachment 65036 [details]
Comment 2 Ariya Hidayat 2010-08-21 17:04:33 PDT
Comment on attachment 65036 [details]

Andreas kindly suggested on IRC that the problem is solved easier by making ShadowBuffer a child of QCoreApplication::instance().

This leads me into thinking, maybe we should fix our shared timer instead so that application destruction stops and closes pending timers.

Clearing the review flag while thinking about this.
Comment 3 Ariya Hidayat 2010-08-22 21:20:37 PDT
Apparently the problem is because TimerBase/Timer relies on thread global data, which is gone already after the application instance is destroyed. Thus, any static object can't use TimerBase/Timer with a risk of crashing.
Comment 4 Ariya Hidayat 2010-08-22 21:41:56 PDT
Created attachment 65073 [details]
Comment 5 Andreas Kling 2010-08-22 21:45:50 PDT
Comment on attachment 65073 [details]

LGTM, feels like the best approach to this problem.
Comment 6 Kenneth Rohde Christiansen 2010-08-23 00:26:01 PDT
Comment on attachment 65073 [details]

Oh that is a bit sad...
Comment 7 Ariya Hidayat 2010-08-23 01:16:21 PDT
Committed r65795: <http://trac.webkit.org/changeset/65795>