Bug 188581 - isValidCSSSelector is unsafe to be called from a non-main thread
Summary: isValidCSSSelector is unsafe to be called from a non-main thread
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-14 14:46 PDT by Alex Christensen
Modified: 2018-08-15 13:03 PDT (History)
9 users (show)

See Also:


Attachments
Patch (25.01 KB, patch)
2018-08-14 14:51 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (26.64 KB, patch)
2018-08-14 15:19 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (27.94 KB, patch)
2018-08-14 15:58 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (27.91 KB, patch)
2018-08-14 16:13 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2018-08-14 14:46:14 PDT
isValidCSSSelector is unsafe to be called from a non-main thread
Comment 1 Alex Christensen 2018-08-14 14:51:18 PDT
Created attachment 347113 [details]
Patch
Comment 2 Alex Christensen 2018-08-14 14:51:21 PDT
<rdar://problem/40517358>
Comment 3 Alex Christensen 2018-08-14 15:19:46 PDT
Created attachment 347116 [details]
Patch
Comment 4 Sam Weinig 2018-08-14 15:32:07 PDT
Comment on attachment 347116 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=347116&action=review

> Source/WebCore/contentextensions/ContentExtensionRule.h:207
> +// FIXME: Move this to WTF.

Can we do this now?
Comment 5 Alex Christensen 2018-08-14 15:58:35 PDT
Created attachment 347121 [details]
Patch
Comment 6 Alex Christensen 2018-08-14 16:13:58 PDT
Created attachment 347124 [details]
Patch
Comment 7 Alex Christensen 2018-08-14 17:31:14 PDT
http://trac.webkit.org/r234873
Comment 9 Geoffrey Garen 2018-08-15 09:45:20 PDT
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x0000000129e7e4c0 WTFCrash + 16 (Assertions.cpp:267)
1   com.apple.WebKit              	0x000000010fa2705b WTFCrashWithInfo(int, char const*, char const*, int) + 27
2   com.apple.WebKit              	0x000000010feb2580 WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics(unsigned long long, WebCore::NetworkLoadMetrics const&) + 128 (NetworkConnectionToWebProcess.h:108)
3   com.apple.WebKit              	0x000000010feb2053 WebKit::NetworkResourceLoader::didFinishLoading(WebCore::NetworkLoadMetrics const&) + 435 (NetworkResourceLoader.cpp:527)
4   com.apple.WebKit              	0x000000010fe0e04c WebKit::NetworkLoad::didCompleteWithError(WebCore::ResourceError const&, WebCore::NetworkLoadMetrics const&) + 300 (NetworkLoad.cpp:372)
5   com.apple.WebKit              	0x000000010fe04e07 WebKit::NetworkDataTaskCocoa::didCompleteWithError(WebCore::ResourceError const&, WebCore::NetworkLoadMetrics const&) + 87 (NetworkDataTaskCocoa.mm:302)
6   com.apple.WebKit              	0x000000010fef6b53 -[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:] + 227 (NetworkSessionCocoa.mm:402)
7   com.apple.CFNetwork           	0x00007fffbb8655c1 __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.162 + 76
8   com.apple.Foundation          	0x00007fffbdf81f19 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
9   com.apple.Foundation          	0x00007fffbdf81bfc -[NSBlockOperation main] + 101
10  com.apple.Foundation          	0x00007fffbdf80324 -[__NSOperationInternal _start:] + 672
11  com.apple.Foundation          	0x00007fffbdf7c1db __NSOQSchedule_f + 201
12  libdispatch.dylib             	0x00007fffd20c38fc _dispatch_client_callout + 8
13  libdispatch.dylib             	0x00007fffd20d0aac _dispatch_main_queue_callback_4CF + 925
14  com.apple.CoreFoundation      	0x00007fffbc56ed69 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
15  com.apple.CoreFoundation      	0x00007fffbc53004d __CFRunLoopRun + 2221
16  com.apple.CoreFoundation      	0x00007fffbc52f544 CFRunLoopRunSpecific + 420
17  com.apple.Foundation          	0x00007fffbdf60252 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
18  com.apple.Foundation          	0x00007fffbdf6012a -[NSRunLoop(NSRunLoop) run] + 76
19  libxpc.dylib                  	0x00007fffd235289b _xpc_objc_main + 731
20  libxpc.dylib                  	0x00007fffd23512e4 xpc_main + 494
21  com.apple.WebKit.Networking   	0x000000010fa0f091 WebKit::XPCServiceMain() + 1169
22  com.apple.WebKit.Networking   	0x000000010fa0f37b main + 27
23  libdyld.dylib                 	0x00007fffd20f9235 start + 1
Comment 10 Alex Christensen 2018-08-15 10:48:17 PDT
http://trac.webkit.org/r234890
Comment 11 Alex Christensen 2018-08-15 13:03:32 PDT
I'm re-adding the assertion with the Vector fix in https://bugs.webkit.org/show_bug.cgi?id=188611