RESOLVED FIXED 168171
[GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
https://bugs.webkit.org/show_bug.cgi?id=168171
Summary [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK b...
Carlos Garcia Campos
Reported 2017-02-11 09:05:50 PST
It's crashing the UI process in ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain when calling HashMap::ensure(). It's weird, maybe it's yet another issue that only happens with GCC.
Attachments
Patch (1.99 KB, patch)
2017-07-11 08:58 PDT, Charlie Turner
no flags
Patch (50.24 KB, patch)
2017-10-03 10:08 PDT, Carlos Garcia Campos
buildbot: commit-queue-
Archive of layout-test-results from ews112 for mac-elcapitan (1.95 MB, application/zip)
2017-10-03 14:08 PDT, Build Bot
no flags
Fix the build (50.21 KB, patch)
2017-10-04 00:44 PDT, Carlos Garcia Campos
cdumez: review-
Patch (40.90 KB, patch)
2017-10-05 01:47 PDT, Carlos Garcia Campos
cdumez: review+
cdumez: commit-queue-
Patch for landing (49.22 KB, patch)
2017-10-05 10:39 PDT, Carlos Garcia Campos
no flags
Patch for landing (49.23 KB, patch)
2017-10-05 10:41 PDT, Carlos Garcia Campos
no flags
John Wilander
Comment 1 2017-02-11 10:57:50 PST
Sorry about that. Are you able to mark them as skipped for now? Thanks!
John Wilander
Comment 2 2017-02-11 11:26:03 PST
The feature is disabled by default as can be seen in the test cases' call to enable it through internals so you shouldn't risk anything by skipping the tests for now. We'll have to look for the root cause.
Carlos Garcia Campos
Comment 3 2017-02-11 23:05:29 PST
I marked them as crashing in GTK+ expectations. I spent some time debugging it but couldn't find anything, that's why I thought it could be a compiler issue. Also tried different approaches, copying the temporary string, using add instead of ensure and some other things, and it always crashed when adding the item to the HashMap.
John Wilander
Comment 4 2017-02-11 23:23:01 PST
Thanks! I'll see what we can do next week. I'm not an expert on the differences in the two compilers but I have come across certain compiler errors specific to GTK and Efl for this part of the code. I believe it was an implicit this-pointer in a lambda that confused GCC.
Michael Catanzaro
Comment 5 2017-07-06 21:14:25 PDT
These tests are now all timing out instead of crashing. So we will probably need to fix the timeout in order to get them crashing again in order to fix the crash. The timeouts started somewhere between r219010 and r219065, inclusive. Unfortunately that's a huge range as our test bot has been having memory issues recently. The failures look like this: --- /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt +++ /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-actual.txt @@ -4,5 +4,5 @@ main frame - didFinishDocumentLoadForFrame main frame - didHandleOnloadEventsForFrame main frame - didFinishLoadForFrame -PASS Host did not get classified as prevalent resource. +FAIL: Timed out waiting for notifyDone to be called Updating expectations accordingly.
Michael Catanzaro
Comment 6 2017-07-06 21:20:21 PDT
Aha, the WPE bot caught it! They regressed in r219049 "Replace ResourceLoadStatisticsStore C API with Cocoa SPI".
Michael Catanzaro
Comment 7 2017-07-06 21:26:06 PDT
Looks like the TestController implementation for non-Cocoa platforms was purposefully removed. We'll have to implement it. Supporting resource load statistics is interesting for us anyway; we get feature requests for this all the time.
Charlie Turner
Comment 8 2017-07-11 08:58:03 PDT
WebKit Commit Bot
Comment 9 2017-07-11 11:10:18 PDT
Comment on attachment 315114 [details] Patch Clearing flags on attachment: 315114 Committed r219345: <http://trac.webkit.org/changeset/219345>
WebKit Commit Bot
Comment 10 2017-07-11 11:10:19 PDT
All reviewed patches have been landed. Closing bug.
Carlos Alberto Lopez Perez
Comment 11 2017-07-11 11:12:22 PDT
Reopening: r219345 was a gardening commit
Carlos Garcia Campos
Comment 12 2017-10-03 10:08:24 PDT
Build Bot
Comment 13 2017-10-03 10:09:33 PDT
Attachment 322538 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:53: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:55: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:57: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:76: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:31: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:122: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:147: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:169: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:343: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 9 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 14 2017-10-03 13:20:06 PDT
Comment on attachment 322538 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322538&action=review > Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:51 > + void setStatisticsLastSeen(const String&, double); Since there are a lot of these and they are only used for testing, I had intentionally not added them to APIWebSiteDataStore.h. Instead, I had the API side (see existing ObjC API such as _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours) get the resource load statistics from the WebSiteDataStore and use the statistics object directly. > Tools/WebKitTestRunner/TestController.cpp:-2295 > -#if !PLATFORM(COCOA) || !WK_API_ENABLED I believe this change breaks the mac-32bit EWS.
Build Bot
Comment 15 2017-10-03 14:08:40 PDT
Comment on attachment 322538 [details] Patch Attachment 322538 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4744706 New failing tests: workers/wasm-hashset.html
Build Bot
Comment 16 2017-10-03 14:08:42 PDT
Created attachment 322577 [details] Archive of layout-test-results from ews112 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Carlos Garcia Campos
Comment 17 2017-10-04 00:06:00 PDT
(In reply to Chris Dumez from comment #14) > Comment on attachment 322538 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=322538&action=review > > > Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:51 > > + void setStatisticsLastSeen(const String&, double); > > Since there are a lot of these and they are only used for testing, I had > intentionally not added them to APIWebSiteDataStore.h. Instead, I had the > API side (see existing ObjC API such as > _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours) > get the resource load statistics from the WebSiteDataStore and use the > statistics object directly. I know, but we don't have other C API to do the same, so I don't know how to implement the test controller methods without adding C API. > > Tools/WebKitTestRunner/TestController.cpp:-2295 > > -#if !PLATFORM(COCOA) || !WK_API_ENABLED > > I believe this change breaks the mac-32bit EWS. Right, I guess I need to ifdef the implementation of every method now, I'll try.
Carlos Garcia Campos
Comment 18 2017-10-04 00:43:46 PDT
(In reply to Carlos Garcia Campos from comment #17) > > > Tools/WebKitTestRunner/TestController.cpp:-2295 > > > -#if !PLATFORM(COCOA) || !WK_API_ENABLED > > > > I believe this change breaks the mac-32bit EWS. > > Right, I guess I need to ifdef the implementation of every method now, I'll > try. I can leave it as it was since we don't define WK_API_ENABLED
Carlos Garcia Campos
Comment 19 2017-10-04 00:44:55 PDT
Created attachment 322637 [details] Fix the build
Build Bot
Comment 20 2017-10-04 00:46:21 PDT
Attachment 322637 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:53: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:55: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:57: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:76: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:31: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:122: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:147: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:169: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp:343: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 9 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Michael Catanzaro
Comment 21 2017-10-04 03:46:14 PDT
(In reply to Carlos Garcia Campos from comment #17) > I know, but we don't have other C API to do the same, so I don't know how to > implement the test controller methods without adding C API. I'm pretty sure we do not want to start using GLib API from the test controller...?
Carlos Garcia Campos
Comment 22 2017-10-04 03:48:36 PDT
(In reply to Michael Catanzaro from comment #21) > (In reply to Carlos Garcia Campos from comment #17) > > I know, but we don't have other C API to do the same, so I don't know how to > > implement the test controller methods without adding C API. > > I'm pretty sure we do not want to start using GLib API from the test > controller...? We can't. There's no easy way to add private api to the glib API just for WTR.
Chris Dumez
Comment 23 2017-10-04 09:06:28 PDT
(In reply to Carlos Garcia Campos from comment #17) > (In reply to Chris Dumez from comment #14) > > Comment on attachment 322538 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=322538&action=review > > > > > Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:51 > > > + void setStatisticsLastSeen(const String&, double); > > > > Since there are a lot of these and they are only used for testing, I had > > intentionally not added them to APIWebSiteDataStore.h. Instead, I had the > > API side (see existing ObjC API such as > > _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours) > > get the resource load statistics from the WebSiteDataStore and use the > > statistics object directly. > > I know, but we don't have other C API to do the same, so I don't know how to > implement the test controller methods without adding C API. You misunderstood my comment I believe. I am fine with you adding C API. I just want this C API to use the ResourceLoadStatisticsStore directly (like we do in the ObjC API) instead of adding ALL those methods on APIWebsiteDataStore.
Chris Dumez
Comment 24 2017-10-04 09:08:15 PDT
Comment on attachment 322637 [details] Fix the build View in context: https://bugs.webkit.org/attachment.cgi?id=322637&action=review Please apply previous review comments. > Source/WebKit/UIProcess/API/APIWebsiteDataStore.h:51 > + void setStatisticsLastSeen(const String&, double); We do not need all those methods. > Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:61 > + WebKit::toImpl(dataStoreRef)->setStatisticsLastSeen(WebKit::toImpl(host)->string(), seconds); auto& statistics = WebKit::toImpl(dataStoreRef)->resourceLoadStatistics(); statistics.setStatisticsLastSeen(WebKit::toImpl(host)->string(), seconds);
Carlos Garcia Campos
Comment 25 2017-10-05 01:47:08 PDT
Chris Dumez
Comment 26 2017-10-05 09:02:58 PDT
Comment on attachment 322806 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322806&action=review r=me with review comments. > Source/WebCore/platform/glib/FileMonitorGLib.cpp:38 > + if (path.isEmpty() || !modificationHandler) This is a bad check. !modificationHandler will always be true since you WTFMove() it above.. I think this show this is not tested. This is supposed to be covered by Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp API test which is probably not enabled for GTK port? > Source/WebCore/platform/glib/FileMonitorGLib.cpp:41 > + GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(fileSystemRepresentation(path).data())); auto file ? > Source/WebCore/platform/glib/FileMonitorGLib.cpp:60 > + if (event == G_FILE_MONITOR_EVENT_DELETED) We may not want to call the callback if event == G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED ? > Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h:44 > +typedef void (*WKWebsiteDataStoreIsStatisticsPrevalentResourceFunction)(bool isPrevalentResource, WKErrorRef error, void* functionContext); Do we ever use those WKErrorRef parameters? If not, I would suggest dropping them. > Tools/WebKitTestRunner/TestController.cpp:2312 > +struct ResourceStatisticsCallbackContext { I would give this a constructor that takes a TestController& in parameter and initializes both done / result to false. ResourceStatisticsCallbackContext(TestController& testController) : testController(&testController) { } otherwise, the call sites are not very readable. > Tools/WebKitTestRunner/TestController.cpp:2314 > + bool done; bool done { false }; > Tools/WebKitTestRunner/TestController.cpp:2315 > + bool result; bool result { false }; > Tools/WebKitTestRunner/TestController.cpp:2329 > + ResourceStatisticsCallbackContext context = { this, false, false }; ResourceStatisticsCallbackContext context(*this); > Tools/WebKitTestRunner/TestController.cpp:2345 > + ResourceStatisticsCallbackContext context = { this, false, false }; ResourceStatisticsCallbackContext context(*this); > Tools/WebKitTestRunner/TestController.cpp:2361 > + ResourceStatisticsCallbackContext context = { this, false, false }; ResourceStatisticsCallbackContext context(*this);
Carlos Garcia Campos
Comment 27 2017-10-05 09:08:03 PDT
Comment on attachment 322806 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322806&action=review >> Source/WebCore/platform/glib/FileMonitorGLib.cpp:38 >> + if (path.isEmpty() || !modificationHandler) > > This is a bad check. !modificationHandler will always be true since you WTFMove() it above.. > > I think this show this is not tested. This is supposed to be covered by Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp API test which is probably not enabled for GTK port? Oops good catch! :-P I'll enable the test too. >> Source/WebCore/platform/glib/FileMonitorGLib.cpp:60 >> + if (event == G_FILE_MONITOR_EVENT_DELETED) > > We may not want to call the callback if event == G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED ? I was not sure, attribute change is a modification in the end.
Michael Catanzaro
Comment 28 2017-10-05 09:08:22 PDT
(In reply to Chris Dumez from comment #26) > I would give this a constructor that takes a TestController& in parameter > and initializes both done / result to false. > ResourceStatisticsCallbackContext(TestController& testController) > : testController(&testController) > { } explicit
Chris Dumez
Comment 29 2017-10-05 09:16:24 PDT
(In reply to Michael Catanzaro from comment #28) > (In reply to Chris Dumez from comment #26) > > I would give this a constructor that takes a TestController& in parameter > > and initializes both done / result to false. > > ResourceStatisticsCallbackContext(TestController& testController) > > : testController(&testController) > > { } > > explicit +1 :)
Chris Dumez
Comment 30 2017-10-05 09:16:52 PDT
(In reply to Carlos Garcia Campos from comment #27) > Comment on attachment 322806 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=322806&action=review > > >> Source/WebCore/platform/glib/FileMonitorGLib.cpp:38 > >> + if (path.isEmpty() || !modificationHandler) > > > > This is a bad check. !modificationHandler will always be true since you WTFMove() it above.. > > > > I think this show this is not tested. This is supposed to be covered by Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp API test which is probably not enabled for GTK port? > > Oops good catch! :-P I'll enable the test too. > > >> Source/WebCore/platform/glib/FileMonitorGLib.cpp:60 > >> + if (event == G_FILE_MONITOR_EVENT_DELETED) > > > > We may not want to call the callback if event == G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED ? > > I was not sure, attribute change is a modification in the end. Fair enough.
Carlos Garcia Campos
Comment 31 2017-10-05 10:39:39 PDT
Created attachment 322852 [details] Patch for landing I've addressed all review comments, added the FileMonitor test and fixed the impl to pass the test :-) Thanks Chris!
Carlos Garcia Campos
Comment 32 2017-10-05 10:41:36 PDT
Created attachment 322853 [details] Patch for landing Read the explicit comment after submitting the patch, added too.
Carlos Garcia Campos
Comment 33 2017-10-05 23:48:54 PDT
Radar WebKit Bug Importer
Comment 34 2017-10-05 23:49:36 PDT
Note You need to log in before you can comment on or make changes to this bug.