alibaba/coobjc

ios11.1 在co_launch中WebView执行js闪退

iDivines opened this issue · 1 comments

Context and Description

在ios11.1中,无论是UIWebView还是UIWebView执行JS都会闪退

Environment Details

  • coobjc version:1.2.6
  • iOS version: 11.1(ios其他版本没有出现)
  • Xcode version:xcode11.2
  • Other informations:

Code

- (void)viewWillAppear:(BOOL)animated
{
    co_launch(^{
        UIWebView *web = [[UIWebView alloc] init];
        [web stringByEvaluatingJavaScriptFromString:@"var a=1"];
    });
}

Stack

#0	0x000000018b24bc60 in JSC::BuiltinExecutables::createExecutable(JSC::VM&, JSC::SourceCode const&, JSC::Identifier const&, JSC::ConstructorKind, JSC::ConstructAbility) ()
#1	0x000000018b24f994 in JSC::BuiltinExecutables::functionPrototypeApplyCodeExecutable() ()
#2	0x000000018b6755fc in JSC::functionPrototypeApplyCodeGenerator(JSC::VM&) ()
#3	0x000000018b5897c0 in JSC::FunctionPrototype::addFunctionProperties(JSC::ExecState*, JSC::JSGlobalObject*, JSC::JSFunction**, JSC::JSFunction**, JSC::JSFunction**) ()
#4	0x000000018b688200 in JSC::JSGlobalObject::init(JSC::VM&) ()
#5	0x000000018b69203c in JSC::JSGlobalObject::finishCreation(JSC::VM&, JSC::JSObject*) ()
#6	0x000000018c45d4f8 in WebCore::JSDOMGlobalObject::finishCreation(JSC::VM&, JSC::JSObject*) ()
#7	0x000000018cc5c36c in WebCore::JSDOMWindowBase::finishCreation(JSC::VM&, WebCore::JSDOMWindowProxy*) ()
#8	0x000000018cbe6b38 in WebCore::JSDOMWindow::finishCreation(JSC::VM&, WebCore::JSDOMWindowProxy*) ()
#9	0x000000018cc600a8 in WebCore::JSDOMWindowProxy::setWindow(WTF::RefPtr<WebCore::DOMWindow>&&) ()
#10	0x000000018d2b1d40 in WebCore::ScriptController::createWindowProxy(WebCore::DOMWrapperWorld&) ()
#11	0x000000018d2b3620 in WebCore::ScriptController::initScript(WebCore::DOMWrapperWorld&) ()
#12	0x000000018d8355bc in -[WebFrame(WebInternal) _stringByEvaluatingJavaScriptFromString:forceUserGesture:] ()
#13	0x000000018e047a6c in -[UIWebView stringByEvaluatingJavaScriptFromString:] ()
#14	0x0000000102dfd2d8 in __47-[KMDiscoverListViewController viewWillAppear:]_block_invoke at /Users/idivines/Downloads/coobjc-master/Examples/coobjcBaseExample/coobjcBaseExample/UI/View Controllers/Discover List/KMDiscoverListViewController.m:39
#15	0x0000000102f014ac in -[COCoroutine execute] at /Users/idivines/Downloads/coobjc-master/coobjc/co/COCoroutine.m:111
#16	0x0000000102f01ab0 in co_exec at /Users/idivines/Downloads/coobjc-master/coobjc/co/COCoroutine.m:84
#17	0x0000000102ed8a20 in coroutine_main at /Users/idivines/Downloads/coobjc-master/cocore/coroutine.m:189
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0	0x0000000103225280 in _dispatch_introspection_queue_item_enqueue_hook ()
#1	0x0000000103204c50 in _dispatch_queue_push ()
#2	0x0000000102ed6ffc in -[CODispatch dispatch_async_block:] at /Users/idivines/Downloads/coobjc-master/cocore/CODispatch.m:120
#3	0x0000000102f0253c in -[COCoroutine resume] at /Users/idivines/Downloads/coobjc-master/coobjc/co/COCoroutine.m:224
#4	0x0000000102dfd228 in co_launch [inlined] at /Users/idivines/Library/Developer/Xcode/DerivedData/coobjcBaseExample-fgmirdsavivlplbvbjlaebcijqcf/Build/Products/Debug-iphoneos/coobjc/coobjc.framework/Headers/coobjc.h:54
#5	0x0000000102dfd1f0 in -[KMDiscoverListViewController viewWillAppear:] at /Users/idivines/Downloads/coobjc-master/Examples/coobjcBaseExample/coobjcBaseExample/UI/View Controllers/Discover List/KMDiscoverListViewController.m:37

coobjc 不支持协程能运行 JSCore相关代码,see #68