Bug 227714

Summary: Make sure PlatformCALayer gets destroyed on the main thread
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Layout and RenderingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, ggaren, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2021-07-06 11:12:29 PDT
Make sure PlatformCALayer gets destroyed on the main thread, to avoid crashes like these:
Thread 6 Crashed ↩:: Dispatch queue: com.apple.WebKit.EventDispatcher
0   com.apple.WebCore             	0x000000019ee50bd8 WTFCrashWithInfo(int, char const*, char const*, int) + 20
1   com.apple.WebCore             	0x000000019ec2ef8c WebCore::TimerBase::~TimerBase() + 236
2   com.apple.WebCore             	0x000000019ec601fc WebCore::TileController::~TileController() + 184
3   com.apple.WebCore             	0x000000019ec600fc -[WebTiledBackingLayer invalidate] + 40
4   com.apple.WebCore             	0x000000019f945630 WebCore::PlatformCALayerCocoa::~PlatformCALayerCocoa() + 484
5   com.apple.WebCore             	0x000000019f945b1c WebCore::PlatformCALayerCocoa::~PlatformCALayerCocoa() + 16
6   com.apple.WebCore             	0x000000019f7ab030 collectDescendantLayersAtPoint(WTF::Vector<std::__1::pair<CALayer*, WebCore::FloatPoint>, 16ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&, CALayer*, CGPoint) + 1308
7   com.apple.WebCore             	0x000000019f7ab180 WebCore::ScrollingTreeMac::eventListenerRegionTypesForPoint(WebCore::FloatPoint) const + 136
8   com.apple.WebCore             	0x00000001a0901148 WebCore::ScrollingTree::determineWheelEventProcessing(WebCore::PlatformWheelEvent const&) + 540
9   com.apple.WebKit              	0x00000001a21e79a4 WebKit::EventDispatcher::wheelEvent(WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebWheelEvent const&, bool, bool, bool, bool) + 648
10  com.apple.WebKit              	0x00000001a1b4f634 WebKit::EventDispatcher::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 364
Comment 1 Chris Dumez 2021-07-06 11:13:43 PDT
Created attachment 432946 [details]
Patch
Comment 2 Geoffrey Garen 2021-07-06 13:00:51 PDT
Comment on attachment 432946 [details]
Patch

r=me
Comment 3 EWS 2021-07-06 13:47:07 PDT
Committed r279615 (239436@main): <https://commits.webkit.org/239436@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 432946 [details].
Comment 4 Radar WebKit Bug Importer 2021-07-06 13:48:24 PDT
<rdar://problem/80229177>