Bug 219980 - [WPE] REGRESSION(r270767): API test WPE/TestWebExtensions/webkit/WebKitWebExtension/user-messages is crashing
Summary: [WPE] REGRESSION(r270767): API test WPE/TestWebExtensions/webkit/WebKitWebExt...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-17 00:36 PST by Diego Pino
Modified: 2021-01-11 20:39 PST (History)
4 users (show)

See Also:


Attachments
Trace printed in a debug run (5.57 KB, text/plain)
2021-01-11 20:37 PST, Lauro Moura
no flags Details
Log messages in a failure run (18.15 KB, text/plain)
2021-01-11 20:39 PST, Lauro Moura
no flags Details
Log messages from the about:blank run (30.22 KB, text/plain)
2021-01-11 20:39 PST, Lauro Moura
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Pino 2020-12-17 00:36:52 PST
The test has been crashing in the WPE Release bot since build https://build.webkit.org/builders/WPE-Linux-64-bit-Release-Tests/builds/21510 (r270767). There are two commits in that build. I think r270767 might be the cause for the regression.

https://build.webkit.org/builders/WPE-Linux-64-bit-Release-Tests/builds/21510/steps/API-tests/logs/stdio

Unexpected crashes (1)
    /WPE/TestWebExtensions
        /webkit/WebKitWebExtension/user-messages

Unfortunately I haven't managed to get a stacktrace for this test. My environment uses Flatpak. This is what I tried:

$ Tools/Scripts/run-wpe-tests --debug WebKitBuild/WPE/Debug/bin/TestWebKitAPI/WPE/TestWebExtensions -p /webkit/WebKitWebExtension/user-messages
TEST: WebKitBuild/WPE/Debug/bin/TestWebKitAPI/WPE/TestWebExtensions...
  /webkit/WebKitWebExtension/user-messages:                           Leaked objects: WebKitWebContext(0x55a4771ed120 - 2 left)
FAIL
ERROR:../../Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h:163:virtual Test::~Test(): 'm_watchedObjects.isEmpty()' should be TRUE

And then I also tried to get into the sandbox and run the test (same result):

$ ./Tools/Scripts/webkit-flatpak --wpe --debug -c /bin/bash
$ WebKitBuild/WPE/Debug/bin/TestWebKitAPI/WPE/TestWebExtensions -p /webkit/WebKitWebExtension/user-messages
# random seed: R02S8a0a057d51e3145febaaf61f299230c3
# Start of webkit tests
# Start of WebKitWebExtension tests
Leaked objects: WebKitWebContext(0x561406141120 - 2 left)
**
ERROR:../../Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h:163:virtual Test::~Test(): 'm_watchedObjects.isEmpty()' should be TRUE
Bail out! ERROR:../../Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h:163:virtual Test::~Test(): 'm_watchedObjects.isEmpty()' should be TRUE
Aborted
Comment 1 Philippe Normand 2021-01-04 03:39:43 PST
Here it times out:

run-wpe-tests --debug /app/webkit/WebKitBuild/Debug/bin/TestWebKitAPI/WPE/TestWebExtensions -p /webkit/WebKitWebExtension/user-messages                                            11:37:45
TEST: /app/webkit/WebKitBuild/Debug/bin/TestWebKitAPI/WPE/TestWebExtensions...
  /webkit/WebKitWebExtension/user-messages:                           TIMEOUT

Ran 1 tests of 1 with 1 successful
Comment 2 Lauro Moura 2021-01-11 20:37:27 PST
Created attachment 417429 [details]
Trace printed in a debug run

The "leaked objects" is a failure tracked in bug211336, marking the test as flaky pass/fail/timeout.

Running with --debug all tests in the TestWebExtensions suite, the same revision (r270767) triggers an RefPtr "!m_deletionHasBegun" assertion in the immediate test after the "dom-document-title" test (Trace attached). All tests I tried to run after it triggered the assertion, even running it twice.

Reducing the test code, the following calls are enough to trigger it (running in separate test cases):

test->loadHtml("<html><head><title>WebKitGTK Web Extensions Test</title></head><body></body></html>", "http://bar.com");
test->waitUntilLoadFinished();

In fact, removing "http://bar.com" (and defaulting to "about:blank") makes the crash vanish, as the ProcessCache does not try to cache it ("no registrable domain" in the log messages).

Gardened in r271389.
Comment 3 Lauro Moura 2021-01-11 20:39:09 PST
Created attachment 417430 [details]
Log messages in a failure run

These are the log messages from a failed run with two cases with the minimal test.
Comment 4 Lauro Moura 2021-01-11 20:39:56 PST
Created attachment 417431 [details]
Log messages from the about:blank run

And these are the log messages from a run with no base url (completes successfully).