一年前,我们开发了一款在iPad上运行的应用程序。用户可以编辑和滚动多个页面表单。在每个页面中有几个输入字段,标签和图像。现在我们将应用程序移植到IOS 10.我们正在使用cordova,ionic和AngularJS。
现在我们在IOS 9.3.5上也遇到了一些奇怪的崩溃。在表单的页面滚动一段时间后,这意味着创建和删除了许多输入字段和标签,应用程序崩溃(有时它只会冻结并显示白屏)。
大部分时间它在线程0(Dispatch queue:com.apple.main-thread)中崩溃并出现分段错误。有几次我遇到了类似堆栈跟踪的线程3(WebThread)崩溃。
我的想法是,一个线程释放了另一个线程仍在使用的内存。任何人都可以给我一个提示,在哪里寻找问题?有人有类似的问题并解决了吗?由于崩溃发生在webKit代码中,它可能是cordova或ios中的一个问题吗?
二手组件的版本:
XCode: 8.0
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.13
Ionic App Lib Version: 0.6.5
OS: Distributor ID: Fedora Description: Fedora release 23 (Twenty Three)
Node Version: v0.10.42
IOS崩溃日志:
Incident Identifier: AAE0FFAD-F9BB-4D8D-AB30-1BCCE2BCB0EE
CrashReporter Key: 9e09392dd3be7bec6a92955b1797ddd5a45bc167
Hardware Model: iPad2,4
Process: mobileforms [299]
Path: /private/var/containers/Bundle/Application/682882E8-F9E4-4CCA-BC7F-0AE8C18647FC/mobileforms.app/mobileforms
Identifier: de.skai-ms.mobileforms
Version: 3.3.1 (3.3)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2016-11-16 21:13:28.28 +0100
Launch Time: 2016-11-16 20:53:04.04 +0100
OS Version: iOS 9.3.5 (13G36)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xbbadbeef
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 JavaScriptCore 0x25c8ea22 WTFCrash + 54 (Assertions.cpp:321)
1 WebCore 0x25f471d0 WTF::StringAppend<WTF::String, WTF::String>::operator WTF::String() const + 104 (StringOperators.h:40)
2 WebCore 0x26926172 WebCore::TextResourceDecoder::decodeAndFlush(char const*, unsigned long) + 110 (TextResourceDecoder.cpp:676)
3 WebCore 0x25ebee90 WebCore::CachedScript::script() + 48 (CachedScript.cpp:75)
4 JavaScriptCore 0x25c7bcc4 std::__1::unique_ptr<JSC::FunctionNode, std::__1::default_delete<JSC::FunctionNode> > JSC::parse<JSC::FunctionNode>(JSC::VM*, JSC::SourceCode const&, JSC::FunctionParameters*, JSC::Identifier const&, JSC::JSParserBuiltinMode, JSC::JSParserStrictMode, JSC::JSParserCodeType, JSC::ParserError&, JSC::JSTextPosition*, JSC::ConstructorKind, JSC::ThisTDZMode) + 28 (Parser.h:1069)
5 JavaScriptCore 0x25c7b49e JSC::UnlinkedFunctionExecutable::codeBlockFor(JSC::VM&, JSC::SourceCode const&, JSC::CodeSpecializationKind, JSC::DebuggerMode, JSC::ProfilerMode, JSC::ParserError&) + 90 (UnlinkedCodeBlock.cpp:62)
6 JavaScriptCore 0x25ae5d62 JSC::ScriptExecutable::newCodeBlockFor(JSC::CodeSpecializationKind, JSC::JSFunction*, JSC::JSScope*, JSC::JSObject*&) + 378 (Executable.cpp:240)
7 JavaScriptCore 0x25ae629a JSC::ScriptExecutable::prepareForExecutionImpl(JSC::ExecState*, JSC::JSFunction*, JSC::JSScope*, JSC::CodeSpecializationKind) + 98 (Executable.cpp:330)
8 JavaScriptCore 0x25932952 JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 162 (Executable.h:408)
9 JavaScriptCore 0x25a0ca86 JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) + 62 (CallData.cpp:39)
10 WebCore 0x25fd91e2 WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*) + 490 (JSMainThreadExecState.h:56)
11 WebCore 0x262256b4 WebCore::EventTarget::fireEventListeners(WebCore::Event*, WebCore::EventTargetData*, WTF::Vector<WebCore::RegisteredEventListener, 1ul, WTF::CrashOnOverflow, 16ul>&) + 532 (EventTarget.cpp:256)
12 WebCore 0x25f1f61c WebCore::EventTarget::fireEventListeners(WebCore::Event*) + 232 (EventTarget.cpp:208)
13 WebCore 0x2621d4b0 WebCore::EventContext::handleLocalEvents(WebCore::Event&) const + 64 (EventContext.cpp:55)
14 WebCore 0x2621dd04 WebCore::EventDispatcher::dispatchEvent(WebCore::Node*, WTF::PassRefPtr<WebCore::Event>) + 732 (EventDispatcher.cpp:307)
15 WebCore 0x25f1f46c WebCore::Node::dispatchEvent(WTF::PassRefPtr<WebCore::Event>) + 20 (Node.cpp:2015)
16 WebCore 0x25fd8fbe WebCore::EventTarget::dispatchEvent(WTF::PassRefPtr<WebCore::Event>, int&) + 78 (EventTarget.cpp:154)
17 WebCore 0x25ff59ae WebCore::jsNodePrototypeFunctionDispatchEvent(JSC::ExecState*) + 94 (JSNode.cpp:890)
18 JavaScriptCore 0x25beb41e llint_entry + 21374
19 JavaScriptCore 0x25beafe8 llint_entry + 20296
20 JavaScriptCore 0x25beafe8 llint_entry + 20296
21 JavaScriptCore 0x25beb038 llint_entry + 20376
22 JavaScriptCore 0x25beb038 llint_entry + 20376
23 JavaScriptCore 0x25be5e90 vmEntryToJavaScript + 336
24 JavaScriptCore 0x25b407da JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 102 (JITCode.cpp:81)
25 JavaScriptCore 0x25932a08 JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 344 (Interpreter.cpp:973)
26 JavaScriptCore 0x25a0ca86 JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) + 62 (CallData.cpp:39)
27 WebCore 0x25fd91e2 WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*) + 490 (JSMainThreadExecState.h:56)
28 WebCore 0x262256b4 WebCore::EventTarget::fireEventListeners(WebCore::Event*, WebCore::EventTargetData*, WTF::Vector<WebCore::RegisteredEventListener, 1ul, WTF::CrashOnOverflow, 16ul>&) + 532 (EventTarget.cpp:256)
29 WebCore 0x25f1f61c WebCore::EventTarget::fireEventListeners(WebCore::Event*) + 232 (EventTarget.cpp:208)
30 WebCore 0x2621d4b0 WebCore::EventContext::handleLocalEvents(WebCore::Event&) const + 64 (EventContext.cpp:55)
31 WebCore 0x2621dd04 WebCore::EventDispatcher::dispatchEvent(WebCore::Node*, WTF::PassRefPtr<WebCore::Event>) + 732 (EventDispatcher.cpp:307)
32 WebCore 0x25f1f46c WebCore::Node::dispatchEvent(WTF::PassRefPtr<WebCore::Event>) + 20 (Node.cpp:2015)
33 WebCore 0x25fd8fbe WebCore::EventTarget::dispatchEvent(WTF::PassRefPtr<WebCore::Event>, int&) + 78 (EventTarget.cpp:154)
34 WebCore 0x26221854 WebCore::EventHandler::dispatchTouchEvent(WebCore::PlatformTouchEvent const&, WTF::AtomicString const&, WTF::HashMap<WebCore::EventTarget*, WTF::Vector<WTF::RefPtr<WebCore::Touch>, 0ul, WTF::CrashOnOverflow, 16ul>*, WTF::PtrHash<WebCore::EventTarget*>, WTF::HashTraits<WebCore::EventTarget*>, WTF::HashTraits<WTF::Vector<WTF::RefPtr<WebCore::Touch>, 0ul, WTF::CrashOnOverflow, 16ul>*> > const&, float, float) + 852 (EventHandlerIOSTouch.cpp:92)
35 WebCore 0x25fd72d8 WebCore::EventHandler::handleTouchEvent(WebCore::PlatformTouchEvent const&) + 4844 (EventHandlerIOSTouch.cpp:449)
36 WebCore 0x25fd5850 WebCore::EventHandler::touchEvent(WebEvent*) + 236 (EventHandlerIOS.mm:120)
37 WebKitLegacy 0x26b15008 -[WebHTMLView touch:] + 136 (WebHTMLView.mm:3886)
38 WebCore 0x25fd5760 -[WAKView _selfHandleEvent:] + 136 (WAKView.mm:165)
39 WebCore 0x25fd56bc -[WAKView handleEvent:] + 48 (WAKView.mm:125)
40 WebCore 0x25fd5488 -[WAKWindow sendEventSynchronously:] + 332 (WAKWindow.mm:336)
41 UIKit 0x2743a522 -[UIWebBrowserView _dispatchWebEvent:] + 78 (UIWebBrowserView.m:1357)
42 UIKit 0x2743a948 -[UIWebBrowserView _webTouchEventsRecognized:] + 512 (UIWebBrowserView.m:1464)
43 UIKit 0x27215a34 -[UIWebTouchEventsGestureRecognizer _processTouches:withEvent:type:] + 356 (UIWebTouchEventsGestureRecognizer.m:329)
44 UIKit 0x27215ce2 -[UIWebTouchEventsGestureRecognizer touchesEnded:withEvent:] + 78 (UIWebTouchEventsGestureRecognizer.m:393)
45 UIKit 0x27315646 -[UIGestureRecognizer _touchesEnded:withEvent:] + 146 (UIGestureRecognizer.m:1812)
46 UIKit 0x26de2d84 -[UIWindow _sendGesturesForEvent:] + 580 (UIWindow.m:2047)
47 UIKit 0x26de267a -[UIWindow sendEvent:] + 622 (UIWindow.m:2256)
48 UIKit 0x26db3124 -[UIApplication sendEvent:] + 204 (UIApplication.m:12647)
49 UIKit 0x26db16d2 _UIApplicationHandleEventQueue + 5010 (UIApplication.m:10454)
50 CoreFoundation 0x227f9dfe __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14 (CFRunLoop.c:1761)
51 CoreFoundation 0x227f99ec __CFRunLoopDoSources0 + 452 (CFRunLoop.c:1807)
52 CoreFoundation 0x227f7d5a __CFRunLoopRun + 794 (CFRunLoop.c:2536)
53 CoreFoundation 0x22747228 CFRunLoopRunSpecific + 520 (CFRunLoop.c:2814)
54 CoreFoundation 0x22747014 CFRunLoopRunInMode + 108 (CFRunLoop.c:2844)
55 GraphicsServices 0x23d37ac8 GSEventRunModal + 160 (GSEvent.c:2245)
56 UIKit 0x26e1b188 UIApplicationMain + 144 (UIApplication.m:3772)
57 mobileforms 0x000b2e82 main + 34 (main.m:32)
58 libdyld.dylib 0x223ef872 start + 2 (start_glue.s:64)
我们已经进行了一些调查,并在https://developer.apple.com/reference/webkit/wkwebview上发现应用应该使用WKWebView而不是UIWebView。默认情况下,cordova使用UIWebView,但为WKWebView提供了一个插件。
我们的下一步是将应用程序移植到新的cordova和WKWebView插件。有人有经验吗?