Bug 219591

Summary: [WTF] RunLoop::dispatchAfter() leaks pending timers after thread termination
Product: WebKit Reporter: Zan Dobersek <zan>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ggaren, mcatanzaro, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=219232
Attachments:
Description Flags
Unit test none

Description Zan Dobersek 2020-12-07 01:18:23 PST
Spun from  bug #219232.

Any task queued via RunLoop::dispatchAfter() is leaked if the RunLoop thread terminates before the underlying DispatchTimer is fired because the DispatchTimer is only freed when it's fired, which doesn't happen after the RunLoop thread terminates.

Right now, the RunLoop reference taken via TimerBase (from which DispatchTimer derives) also blocks the RunLoop object to be destroyed once the thread is terminated. Bug #219232 doesn't help here because DispatchTimer instances are not stored in any containers that could be cleared at the point of termination.
Comment 1 Zan Dobersek 2020-12-07 01:19:24 PST
Created attachment 415538 [details]
Unit test
Comment 2 Radar WebKit Bug Importer 2020-12-14 01:19:18 PST
<rdar://problem/72288000>