Bug 232670 - _pasteboardWithName should be thread-safe
Summary: _pasteboardWithName should be thread-safe
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-03 10:37 PDT by Chris Dumez
Modified: 2021-11-03 13:13 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.58 KB, patch)
2021-11-03 10:42 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-11-03 10:37:56 PDT
_pasteboardWithName should be thread-safe, to match [NSPasteboard _pasteboardWithName].

This could lead to flaky crashes like so:
Thread 7 Crashed::  Dispatch queue: com.apple.root.user-initiated-qos
0   CoreFoundation                	    0x7ff810d9fb12 -[__NSDictionaryM setObject:forKey:] + 428
1   WebKitTestRunner              	       0x10baa0c66 +[WebKitTestRunnerPasteboard _pasteboardWithName:] + 374 (WebKitTestRunnerPasteboard.mm:63)
2   ShareKit                      	    0x7ff91ded5888 -[NSObject(ShareKitExtension) shareItemURL] + 240
3   ShareKit                      	    0x7ff91ded56d9 +[SHKSandbox filteredItemsFromSingleItem:processWithPID:] + 79
4   ShareKit                      	    0x7ff91ded54b7 +[SHKSandbox filteredItemsFromItems:processWithPID:] + 469
5   ShareKit                      	    0x7ff91ded5290 +[SHKSharingService sandboxProofItemsFromItems:] + 318
6   ShareKit                      	    0x7ff91df03861 __102+[SHKSharingService sharingServicesOnMainQueueForItems:mask:invokedByPicker:allowInactive:completion:]_block_invoke + 42
7   libdispatch.dylib             	    0x7ff810b63ad8 _dispatch_call_block_and_release + 12
8   libdispatch.dylib             	    0x7ff810b64cc9 _dispatch_client_callout + 8
9   libdispatch.dylib             	    0x7ff810b7450b _dispatch_root_queue_drain + 680
10  libdispatch.dylib             	    0x7ff810b74b5a _dispatch_worker_thread2 + 160
11  libsystem_pthread.dylib       	    0x7ff810d1802e _pthread_wqthread + 256
12  libsystem_pthread.dylib       	    0x7ff810d16ffb start_wqthread + 15
Comment 1 Chris Dumez 2021-11-03 10:42:07 PDT
Created attachment 443210 [details]
Patch
Comment 2 EWS 2021-11-03 13:12:30 PDT
Committed r285222 (243847@main): <https://commits.webkit.org/243847@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 443210 [details].
Comment 3 Radar WebKit Bug Importer 2021-11-03 13:13:20 PDT
<rdar://problem/84988401>