我的應用程序廣泛使用UIWebViews,因爲它基本上是一個基於WebView的應用程序。WebCore的崩潰是否意味着它必然與UIWebView有關?
在應用程序的左側,我有一個滑出菜單,類似於Facebook和Path應用程序。選擇其中一個表格行將重新滑入主網頁視圖並加載網址。
我已經看到WebCore從Webthread的隨機崩潰,但我根本無法理解如何解決它。我測試了殭屍和內存分配,但該應用程序始終保持在3-4MB的活動字節數內。
我不知道它是否相關,但當webview加載它的頁面時會出現明顯的「鉤子」。例如,在shouldStartLoad中,我檢查某些URL,然後在頁面上調用一個JS函數。我不知道這是否會導致崩潰。
崩潰日誌顯示webcore崩潰的不同區域。我在下面添加了一些最新的變體,但我不確定這些變體是否都是可能的。
總之,什麼是WebCore崩潰?這是UIWebView中的一個錯誤,我無法做任何事情?謝謝!
Thread 2 name: WebThread
Thread 2 Crashed:
0 WebCore 0x32c540c0 WebCore::Document::body() const + 4
1 WebCore 0x32d04052 WebCore::CachedResourceLoader::preload(WebCore::CachedResource::Type, WTF::String const&, WTF::String const&, bool) + 18
2 WebCore 0x32d03ebe WebCore::HTMLPreloadScanner::processToken() + 1510
3 WebCore 0x32d03872 WebCore::HTMLPreloadScanner::scan() + 42
4 WebCore 0x32cebc24 WebCore::HTMLDocumentParser::append(WebCore::SegmentedString const&) + 92
5 WebCore 0x32cbce20 WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter*, char const*, int, bool) + 200
6 WebCore 0x32ceb8d0 WebCore::DocumentWriter::addData(char const*, int, bool) + 48
7 WebCore 0x32ce5c3e WebCore::DocumentLoader::commitData(char const*, int) + 122
8 WebKit 0x358cbc9a -[WebHTMLRepresentation receivedData:withDataSource:] + 158
9 WebKit 0x358cbb10 -[WebDataSource(WebInternal) _receivedData:] + 164
10 WebKit 0x358cba48 WebFrameLoaderClient::committedLoad(WebCore::DocumentLoader*, char const*, int) + 100
11 WebCore 0x32ce2a48 WebCore::DocumentLoader::commitLoad(char const*, int) + 120
12 WebCore 0x32ce29b4 WebCore::DocumentLoader::receivedData(char const*, int) + 72
13 WebCore 0x32ce25da WebCore::ResourceLoader::didReceiveData(char const*, int, long long, bool) + 34
14 WebCore 0x32ce2566 WebCore::MainResourceLoader::didReceiveData(char const*, int, long long, bool) + 474
15 WebCore 0x32ce22b2 WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle*, char const*, int, int) + 42
16 WebCore 0x32ce2234 WebCore::ResourceHandle::handleDataArray(__CFArray const*) + 212
17 WebCore 0x32ce2156 WebCore::didReceiveDataArray(_CFURLConnection*, __CFArray const*, void const*) + 34
18 CFNetwork 0x370dd058 URLConnectionClient::_clientDidReceiveData(__CFArray const*, URLConnectionClient::ClientConnectionEventQueue*) + 220
19 CFNetwork 0x370434b0 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 436
20 CFNetwork 0x3704319c URLConnectionClient::processEvents() + 100
21 CFNetwork 0x370430d2 MultiplexerSource::perform() + 150
22 CoreFoundation 0x3738aacc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
23 CoreFoundation 0x3738a32e __CFRunLoopDoSources0 + 358
24 CoreFoundation 0x3738903e __CFRunLoopRun + 646
25 CoreFoundation 0x3730c49e CFRunLoopRunSpecific + 294
26 CoreFoundation 0x3730c366 CFRunLoopRunInMode + 98
27 WebCore 0x32cb5c9c RunWebThread(void*) + 396
28 libsystem_c.dylib 0x33c2b72e _pthread_start + 314
29 libsystem_c.dylib 0x33c2b5e8 thread_start + 0
OR
Thread 2 name: WebThread
Thread 2 Crashed:
0 WebCore 0x32cbe120 WebCore::HTMLDocumentParser::pumpTokenizer(WebCore::HTMLDocumentParser::SynchronousMode) + 312
1 WebCore 0x32cebc66 WebCore::HTMLDocumentParser::append(WebCore::SegmentedString const&) + 158
2 WebCore 0x32cbce20 WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter*, char const*, int, bool) + 200
3 WebCore 0x32ceb8d0 WebCore::DocumentWriter::addData(char const*, int, bool) + 48
4 WebCore 0x32ce5c3e WebCore::DocumentLoader::commitData(char const*, int) + 122
5 WebKit 0x358cbc9a -[WebHTMLRepresentation receivedData:withDataSource:] + 158
6 WebKit 0x358cbb10 -[WebDataSource(WebInternal) _receivedData:] + 164
7 WebKit 0x358cba48 WebFrameLoaderClient::committedLoad(WebCore::DocumentLoader*, char const*, int) + 100
8 WebCore 0x32ce2a48 WebCore::DocumentLoader::commitLoad(char const*, int) + 120
9 WebCore 0x32ce29b4 WebCore::DocumentLoader::receivedData(char const*, int) + 72
10 WebCore 0x32ce25da WebCore::ResourceLoader::didReceiveData(char const*, int, long long, bool) + 34
11 WebCore 0x32ce2566 WebCore::MainResourceLoader::didReceiveData(char const*, int, long long, bool) + 474
12 WebCore 0x32ce22b2 WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle*, char const*, int, int) + 42
13 WebCore 0x32ce2276 WebCore::ResourceHandle::handleDataArray(__CFArray const*) + 278
14 WebCore 0x32ce2156 WebCore::didReceiveDataArray(_CFURLConnection*, __CFArray const*, void const*) + 34
15 CFNetwork 0x370dd058 URLConnectionClient::_clientDidReceiveData(__CFArray const*, URLConnectionClient::ClientConnectionEventQueue*) + 220
16 CFNetwork 0x370434b0 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 436
17 CFNetwork 0x37043592 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 662
18 CFNetwork 0x3704319c URLConnectionClient::processEvents() + 100
19 CFNetwork 0x370430d2 MultiplexerSource::perform() + 150
20 CoreFoundation 0x3738aacc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
21 CoreFoundation 0x3738a298 __CFRunLoopDoSources0 + 208
22 CoreFoundation 0x3738903e __CFRunLoopRun + 646
23 CoreFoundation 0x3730c49e CFRunLoopRunSpecific + 294
24 CoreFoundation 0x3730c366 CFRunLoopRunInMode + 98
25 WebCore 0x32cb5c9c RunWebThread(void*) + 396
26 libsystem_c.dylib 0x33c2b72e _pthread_start + 314
27 libsystem_c.dylib 0x33c2b5e8 thread_start + 0
OR
Thread 2 name: WebThread
Thread 2 Crashed:
0 JavaScriptCore 0x35653c7c WTF::fastFree(void*) + 80
1 WebCore 0x32d064b4 WebCore::SegmentedString::prepend(WebCore::SegmentedSubstring const&) + 136
2 WebCore 0x32d0640e WebCore::SegmentedString::prepend(WebCore::SegmentedString const&) + 66
3 WebCore 0x32d047a8 WebCore::(anonymous namespace)::unconsumeCharacters(WebCore::SegmentedString&, WTF::Vector<unsigned short, 10ul> const&) + 188
4 WebCore 0x32cf023e WebCore::consumeHTMLEntity(WebCore::SegmentedString&, WTF::Vector<unsigned short, 16ul>&, bool&, unsigned short) + 1850
5 WebCore 0x32cef9e4 WebCore::HTMLTokenizer::processEntity(WebCore::SegmentedString&) + 40
6 WebCore 0x32cbebe8 WebCore::HTMLTokenizer::nextToken(WebCore::SegmentedString&, WebCore::HTMLToken&) + 1232
7 WebCore 0x32d03894 WebCore::HTMLPreloadScanner::scan() + 76
8 WebCore 0x32cebc24 WebCore::HTMLDocumentParser::append(WebCore::SegmentedString const&) + 92
9 WebCore 0x32cbce20 WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter*, char const*, int, bool) + 200
10 WebCore 0x32ceb8d0 WebCore::DocumentWriter::addData(char const*, int, bool) + 48
11 WebCore 0x32ce5c3e WebCore::DocumentLoader::commitData(char const*, int) + 122
12 WebKit 0x358cbc9a -[WebHTMLRepresentation receivedData:withDataSource:] + 158
13 WebKit 0x358cbb10 -[WebDataSource(WebInternal) _receivedData:] + 164
14 WebKit 0x358cba48 WebFrameLoaderClient::committedLoad(WebCore::DocumentLoader*, char const*, int) + 100
15 WebCore 0x32ce2a48 WebCore::DocumentLoader::commitLoad(char const*, int) + 120
16 WebCore 0x32ce29b4 WebCore::DocumentLoader::receivedData(char const*, int) + 72
17 WebCore 0x32ce25da WebCore::ResourceLoader::didReceiveData(char const*, int, long long, bool) + 34
18 WebCore 0x32ce2566 WebCore::MainResourceLoader::didReceiveData(char const*, int, long long, bool) + 474
19 WebCore 0x32ce22b2 WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle*, char const*, int, int) + 42
20 WebCore 0x32ce2276 WebCore::ResourceHandle::handleDataArray(__CFArray const*) + 278
21 WebCore 0x32ce2156 WebCore::didReceiveDataArray(_CFURLConnection*, __CFArray const*, void const*) + 34
22 CFNetwork 0x370dd058 URLConnectionClient::_clientDidReceiveData(__CFArray const*, URLConnectionClient::ClientConnectionEventQueue*) + 220
23 CFNetwork 0x370434b0 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 436
24 CFNetwork 0x3704319c URLConnectionClient::processEvents() + 100
25 CFNetwork 0x370430d2 MultiplexerSource::perform() + 150
26 CoreFoundation 0x3738aacc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
27 CoreFoundation 0x3738a32e __CFRunLoopDoSources0 + 358
28 CoreFoundation 0x3738903e __CFRunLoopRun + 646
29 CoreFoundation 0x3730c49e CFRunLoopRunSpecific + 294
30 CoreFoundation 0x3730c366 CFRunLoopRunInMode + 98
31 WebCore 0x32cb5c9c RunWebThread(void*) + 396
32 libsystem_c.dylib 0x33c2b72e _pthread_start + 314
33 libsystem_c.dylib 0x33c2b5e8 thread_start + 0
我測試的開發環境是Xcode 4.4.1和iOS 5.1.1。 我剛剛在iPhone 3gs上安裝了Xcode 4.5DP4和iOS6.0 beta,以查看是否發生崩潰。 但是,有一個普遍的答案,爲什麼WebCore崩潰?它是由於網頁上的不兼容HTML/JS嗎?它是WebCore中的錯誤嗎?我從來沒有見過這些錯誤,所以我很迷茫...... – kurisukun 2012-08-12 16:59:58
這是WebKit中的一個錯誤。你不應該對WebKit有太多的「影響」,以免它崩潰。 – Farcaller 2012-08-12 19:02:30