[iOS] Books crashes upon opening a book with a debug build of WebKit
Created attachment 453784 [details] Patch
<rdar://problem/89776531>
Comment on attachment 453784 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453784&action=review Please add a test. Just call lookUpContentRuleListForIdentifier with @"should-not-exist" and wait for it to return an error. That used to hit this assertion, right? > Source/WTF/ChangeLog:3 > + [iOS] Books crashes upon opening a book with a debug build of WebKit I would say "asserts" instead of "crashes" > Source/WTF/wtf/FileSystem.cpp:446 > + std::optional<FileSystem::MappedFileData> mappedFileOptional; This seems unnecessary. Why not just add an early return if makeSafeToUseMemoryMapForPath returns false?
Comment on attachment 453784 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453784&action=review > Source/WTF/wtf/cocoa/FileSystemCocoa.mm:220 > + return !error && success; Can you add log to print error if it's not nil? What is the error Books gets? I wonder if there's other issue we should fix
Books gets this: {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"} Makes sense.
Comment on attachment 453784 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453784&action=review >> Source/WTF/wtf/cocoa/FileSystemCocoa.mm:220 >> + return !error && success; > > Can you add log to print error if it's not nil? > What is the error Books gets? I wonder if there's other issue we should fix Sure, I can add logging no problem.
Created attachment 453860 [details] Patch for committing
Created attachment 453862 [details] Patch for committing
Created attachment 453875 [details] Patch for committing
Committed r290850 (248083@trunk): <https://commits.webkit.org/248083@trunk>