Bug 139921 - [iOS] Log better using FeatureCounter why PageCache is failing due to pruned resources
Summary: [iOS] Log better using FeatureCounter why PageCache is failing due to pruned ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on: 139944 141788
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-23 15:42 PST by Chris Dumez
Modified: 2015-03-06 10:47 PST (History)
7 users (show)

See Also:


Attachments
Patch (15.03 KB, patch)
2014-12-23 15:56 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (15.10 KB, patch)
2014-12-23 15:57 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (14.74 KB, patch)
2014-12-23 16:33 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (15.67 KB, patch)
2014-12-25 12:00 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (15.72 KB, patch)
2014-12-25 12:29 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-12-23 15:42:57 PST
Log better using FeatureCounter why PageCache is failing due to pruned resources. The reason can be:
- Page cache reached maximum capacity
- Memory pressure
- Process suspended (WK2)

Radar: <rdar://problem/19255690>
Comment 1 Chris Dumez 2014-12-23 15:56:04 PST
Created attachment 243707 [details]
Patch
Comment 2 Chris Dumez 2014-12-23 15:57:15 PST
Created attachment 243708 [details]
Patch
Comment 3 Chris Dumez 2014-12-23 16:33:14 PST
Created attachment 243710 [details]
Patch
Comment 4 WebKit Commit Bot 2014-12-23 17:14:06 PST
Comment on attachment 243710 [details]
Patch

Clearing flags on attachment: 243710

Committed r177712: <http://trac.webkit.org/changeset/177712>
Comment 5 WebKit Commit Bot 2014-12-23 17:14:12 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Alexey Proskuryakov 2014-12-24 23:33:14 PST
This made a regression test flakily assert:

http://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=fast%2Floader%2Fcrash-copying-backforwardlist.html

0   com.apple.JavaScriptCore      	0x0000000106ce8b8a WTFCrash + 42 (Assertions.cpp:321)
1   com.apple.WebCore             	0x000000010cb57a51 WebCore::pruningReasonToFeatureCounterKey(WebCore::PruningReason) + 193 (PageCache.cpp:451)
2   com.apple.WebCore             	0x000000010cb57ba2 WebCore::PageCache::get(WebCore::HistoryItem*, WebCore::Page*) + 306 (PageCache.cpp:512)
3   com.apple.WebCore             	0x000000010bee4164 WebCore::FrameLoader::loadDifferentDocumentItem(WebCore::HistoryItem*, WebCore::FrameLoadType, WebCore::FrameLoader::FormSubmissionCacheLoadPolicy) + 116 (FrameLoader.cpp:3178)
4   com.apple.WebCore             	0x000000010beee676 WebCore::FrameLoader::loadItem(WebCore::HistoryItem*, WebCore::FrameLoadType) + 166 (FrameLoader.cpp:3271)
5   com.apple.WebCore             	0x000000010c00183d WebCore::HistoryController::recursiveGoToItem(WebCore::HistoryItem*, WebCore::HistoryItem*, WebCore::FrameLoadType) + 141 (HistoryController.cpp:740)
6   com.apple.WebCore             	0x000000010c0015a5 WebCore::HistoryController::goToItem(WebCore::HistoryItem*, WebCore::FrameLoadType) + 405 (HistoryController.cpp:301)
7   com.apple.WebCore             	0x000000010cb45f99 WebCore::Page::goToItem(WebCore::HistoryItem*, WebCore::FrameLoadType) + 201 (Page.cpp:446)
Comment 7 WebKit Commit Bot 2014-12-25 08:19:32 PST
Re-opened since this is blocked by bug 139944
Comment 8 Chris Dumez 2014-12-25 11:28:08 PST
Ok, the problem seems to be that HistoryItem::m_prunedReason is not correctly initialized in the HistoryItem copy constructor.
Comment 9 Chris Dumez 2014-12-25 12:00:57 PST
Created attachment 243748 [details]
Patch
Comment 10 Chris Dumez 2014-12-25 12:03:19 PST
Comment on attachment 243748 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=243748&action=review

> Source/WebCore/history/HistoryItem.cpp:165
> +    , m_pruningReason(PruningReason::None)

This is what was missing in the previous patch that landed. I missed it because m_next / m_prev pointers weren't initialized here either. I am now initializing m_next / m_prev here as well as there is no guarantee those will be initialized to nullptr.
Comment 11 Alexey Proskuryakov 2014-12-25 12:27:01 PST
rs=me on the additional changes. I think that this should be landed under original Gavin's review.
Comment 12 Chris Dumez 2014-12-25 12:29:41 PST
Created attachment 243749 [details]
Patch
Comment 13 WebKit Commit Bot 2014-12-25 13:09:45 PST
Comment on attachment 243749 [details]
Patch

Clearing flags on attachment: 243749

Committed r177738: <http://trac.webkit.org/changeset/177738>
Comment 14 WebKit Commit Bot 2014-12-25 13:09:53 PST
All reviewed patches have been landed.  Closing bug.