Bug 163839

Summary: [Cocoa] REGRESSION (r204508): Crash in init_WebCreateFragment when pasting (seen in multiple apps using legacy WebKit)
Product: WebKit Reporter: Darin Adler <darin>
Component: HTML EditingAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Critical CC: andersca, commit-queue, mitz
Priority: P1 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Darin Adler
Reported 2016-10-21 22:25:44 PDT
Seeing crashes in init_WebCreateFragment(WebCore::Document&, NSAttributedString*, WebCore::FragmentAndResources&). Dan pointed out the likely cause: The use of SOFT_LINK_FRAMEWORK(WebKitLegacy) seems incorrect. The macro is intended for use with frameworks installed directly in /System/Library/Frameworks. But WebKitLegacy is not installed in that location. In macOS it’s installed inside the WebKit umbrella framework, and in iOS it’s installed in /System/Library/PrivateFrameworks.
Attachments
Patch (1.53 KB, patch)
2016-10-21 22:33 PDT, Darin Adler
no flags
Darin Adler
Comment 1 2016-10-21 22:26:40 PDT
Darin Adler
Comment 2 2016-10-21 22:27:18 PDT
I’m going to try this: #if PLATFORM(IOS) SOFT_LINK_PRIVATE_FRAMEWORK(WebKitLegacy) #endif #if PLATFORM(MAC) SOFT_LINK_FRAMEWORK_IN_UMBRELLA(WebKit, WebKitLegacy) #endif But the real problem is that last time I didn’t test!
Darin Adler
Comment 3 2016-10-21 22:33:45 PDT
Darin Adler
Comment 4 2016-10-21 22:34:32 PDT
I’ve uploaded a patch, but also seems critical this time that someone does some testing, ideally me. Maybe I can make a unit test? I am not set up for iOS development at the moment.
mitz
Comment 5 2016-10-22 00:03:31 PDT
Comment on attachment 292464 [details] Patch We should have a unit test that exercises this code path. However, such a test would not have caught this mistake, because when we run tests, we always have DYLD_FRAMEWORK_PATH pointing at a location that contains a WebKitLegacy.framework, so dyld never gets as far as to look for it in /System/Library/Frameworks and fail to find it there. r=me because there’s no practical way to add a regression test for this.
WebKit Commit Bot
Comment 6 2016-10-22 09:29:22 PDT
Comment on attachment 292464 [details] Patch Clearing flags on attachment: 292464 Committed r207712: <http://trac.webkit.org/changeset/207712>
WebKit Commit Bot
Comment 7 2016-10-22 09:29:25 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.