Bug 191996 - WebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515
Summary: WebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-26 21:47 PST by Wenson Hsieh
Modified: 2018-11-27 08:04 PST (History)
5 users (show)

See Also:


Attachments
Patch (2.38 KB, patch)
2018-11-26 21:55 PST, Wenson Hsieh
thorton: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff
Rebase on trunk (2.36 KB, patch)
2018-11-27 07:12 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2018-11-26 21:47:59 PST
From logging in decode(Decoder& decoder, NSArray<Class> *allowedClasses), it looks like what's happening is that the allowedClasses contains:

    @[ NSArray.class, DDScannerResult.class ]

...however, the decoded object is a type of __NSArrayM, which is not exactly equal to NSArray.class (instead, it's one of the concrete implementations of NSArray).

Example crash trace (from https://build.webkit.org/builders/Apple%20iOS%2012%20Simulator%20Debug%20WK2%20%28Tests%29/builds/1014/steps/run-api-tests/logs/stdio)

    TestWebKitAPI.WebKit.AddAndRemoveDataDetectors
        ASSERTION FAILED: [allowedClasses containsObject:[object class]]
        /Volumes/Data/slave/ios-simulator-12-debug/build/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h(57) : std::optional<RetainPtr<T> > IPC::decode(IPC::Decoder &, NSArray<Class> *) [T = NSArray]
        1   0x106fbd359 WTFCrash
        2   0x10ab7975b WTFCrashWithInfo(int, char const*, char const*, int)
        3   0x10af506d4 std::optional<WTF::RetainPtr<NSArray> > IPC::decode<NSArray>(IPC::Decoder&, NSArray<objc_class*>*)
        4   0x10af5038b WebKit::DataDetectionResult::decode(IPC::Decoder&)
        5   0x10bb8556c std::optional<WebKit::DataDetectionResult> IPC::ArgumentCoder<WebKit::DataDetectionResult>::decode<WebKit::DataDetectionResult, (void*)0>(IPC::Decoder&)
        6   0x10bb65f54 IPC::Decoder& IPC::Decoder::operator>><WebKit::DataDetectionResult, (void*)0>(std::optional<WebKit::DataDetectionResult>&)
        7   0x10bb65e59 Messages::WebPage::DetectDataInAllFrames::callReply(IPC::Decoder&, WTF::CompletionHandler<void (WebKit::DataDetectionResult&&)>&&)
Comment 1 Wenson Hsieh 2018-11-26 21:55:45 PST
Created attachment 355713 [details]
Patch
Comment 2 WebKit Commit Bot 2018-11-26 23:48:32 PST Comment hidden (obsolete)
Comment 3 Wenson Hsieh 2018-11-27 07:12:39 PST
Created attachment 355731 [details]
Rebase on trunk
Comment 4 WebKit Commit Bot 2018-11-27 07:51:49 PST
Comment on attachment 355731 [details]
Rebase on trunk

Clearing flags on attachment: 355731

Committed r238553: <https://trac.webkit.org/changeset/238553>
Comment 5 Radar WebKit Bug Importer 2018-11-27 08:04:30 PST
<rdar://problem/46276314>