Bug 245092

Summary: [ Monterey Release ] webaudio/offlineaudiocontext-gc.html is a consistent failure
Product: WebKit Reporter: Karl Rackler <rackler>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, cdumez, marcus.stenbeck, rniwa, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Sample code showing the issue
none
Minimal OfflineAudioContext memory leak sample none

Description Karl Rackler 2022-09-12 13:05:14 PDT
Description:
webaudio/offlineaudiocontext-gc.html

After a series of consistent passes, the first failure I saw on the dashboard was at 254173@main on Monterey Release wk1 on model macmini8,1 with architecture x86_64 and has consistently failed since.  Monterey Release wk2 on model macmini8,1 on architecture x86_64 has been a flaky failure since approximately the same period.  The test has the same diff for both wk1 and wk2.

Monterey Release wk1 on model macmini8,1 with architecture x86_64
https://build.webkit.org/#/builders/372/builds/5305
Monterey Release wk2 on model macmini8,1 with architecture x86_64
https://build.webkit.org/#/builders/365/builds/5706

Reproduction steps:
I can reproduce this on the bot using 254173@main, but not locally using ToT.

Command: 
run-webkit-tests --no-build --exit-after-n-crashes-or-timeouts 1 --exit-after-n-failures 1 --release --debug-rwt-logging --no-retry-failures webaudio/offlineaudiocontext-gc.html

Result: 
Regressions: Unexpected text-only failures (1)
  webaudio/offlineaudiocontext-gc.html [ Failure ]

History:
https://results.webkit.org/?suite=layout-tests&test=webaudio%2Fofflineaudiocontext-gc.html&version_name=Monterey

Diff:
--- /Volumes/Data/worker/Apple-Monterey-Release-WK1-Tests/build/layout-test-results/webaudio/offlineaudiocontext-gc-expected.txt
+++ /Volumes/Data/worker/Apple-Monterey-Release-WK1-Tests/build/layout-test-results/webaudio/offlineaudiocontext-gc-actual.txt
@@ -1,4 +1,4 @@
 
 PASS GC a newly created offline audio context
-PASS GC a rendering offline audio context
+FAIL GC a rendering offline audio context assert_true: expected true got false


--- /Volumes/Data/worker/Apple-Monterey-Release-WK2-Tests/build/layout-test-results/webaudio/offlineaudiocontext-gc-expected.txt
+++ /Volumes/Data/worker/Apple-Monterey-Release-WK2-Tests/build/layout-test-results/webaudio/offlineaudiocontext-gc-actual.txt
@@ -1,4 +1,4 @@
 
 PASS GC a newly created offline audio context
-PASS GC a rendering offline audio context
+FAIL GC a rendering offline audio context assert_true: expected true got false
Comment 1 Radar WebKit Bug Importer 2022-09-12 13:05:38 PDT
<rdar://problem/99834913>
Comment 2 Karl Rackler 2022-09-12 13:20:42 PDT
I have marked this test as a flaky failure while this issue is investigated.
Comment 3 EWS 2022-09-12 13:29:15 PDT
Test gardening commit 254404@main (ce0723f31884): <https://commits.webkit.org/254404@main>

Reviewed commits have been landed. Closing PR #4276 and removing active labels.
Comment 4 Alexey Proskuryakov 2022-09-12 16:46:01 PDT
254173@main is "EventTarget should hold EventTargetData in WeakPtrImpl", and this particular queue confidently blames it. But this is not happening on other wk1 bots, nor on internal bots, so something is super fishy.
Comment 5 marcus.stenbeck 2022-10-31 12:05:24 PDT
Created attachment 463326 [details]
Sample code showing the issue

I'm running into what I believe is GC failure for OfflineAudioContext on macOS Monterey 12.6 (21G115) using Safari Version 16.0 (17614.1.25.9.10, 17614) on a MacBookPro18,3 with M1 processor.

As you click the "process" button in the sample Chrome will consistently stay at the same processing time, while Safari steadily increases over time.
Comment 6 marcus.stenbeck 2022-11-02 03:47:13 PDT
Created attachment 463359 [details]
Minimal OfflineAudioContext memory leak sample
Comment 7 marcus.stenbeck 2022-11-02 03:48:17 PDT
The new attachment is a minimal reproduction showing the memory leaking. It seems related to the `suspend()` and `resume()` function of OfflineAudioContext.
Comment 8 Karl Rackler 2022-11-04 09:51:18 PDT
Looking at the History:
https://results.webkit.org/?suite=layout-tests&test=webaudio%2Fofflineaudiocontext-gc.html&version_name=Monterey

It appears the test began consistently passing after landing 254766@main.