[WSLg / audio] Windows Audio service (Audiosrv) leaks ETW registrations while Linux apps play sound; kernel pools reach tens of GB
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 8/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
Read the full write-up in the first comment and the attachments before touching anything: the WPR pool trace summary ties 99.97% of the EtwD/Etwr allocations to the svchost hosting Audiosrv. Reproduce with the paplay loop against the RDPSink PulseAudio sink while sampling tags with the attached etwtags.ps1 or poolmon, then compare against a WSLg audio path where streams are opened and closed once. Done means those ETW registrations are released when a stream closes and pool growth stays flat under the loop.
索引モデルが issue の本文から書いたものです。
説明
Windows Version
Windows 11 25H2, build 26200.9711
WSL Version
WSL 3.0.5.0, kernel 6.18.58.1-1, WSLg 1.0.79
Are you using WSL 1, WSL 2, or WSLC?
- WSL 2
- WSL 1
- WSLC
Kernel Version
6.18.58.1-1
Distro Version
Ubuntu 24.04
Other Software
-
Windows 11 25H2 (10.0.26200.9711)
-
WSL 3.0.5.0, kernel 6.18.58.1-1, WSLg 1.0.79, MSRDC 1.2.7391
-
Ubuntu 24.04, PulseAudio from WSLg, default sink RDPSink
-
.wslconfig: memory=20GB, swap=8GB, networkingMode=mirrored, autoMemoryReclaim=gradual
Repro Steps
-
In a WSL2 distribution with WSLg (default PulseAudio sink "RDPSink"),
create a short silent clip and open/close audio streams in a loop:python3 -c "import wave; w=wave.open('/tmp/s.wav','wb'); w.setnchannels(2); w.setsampwidth(2); w.setframerate(48000); w.writeframes(bytes(9600)); w.close()"
while :; do paplay /tmp/s.wav; done -
On Windows, watch the kernel pool tags EtwD (paged) and Etwr (nonpaged),
e.g. with the attached etwtags.ps1 (20 s delta, no elevation needed):powershell -ExecutionPolicy Bypass -File .\etwtags.ps1 20
or with poolmon from the WDK (tags EtwD, Etwr).
-
The same happens with any Linux app that plays sound for a long time;
we first saw it with a game (Diablo IV through Wine/Proton): over a few
hours the pools grew to tens of GB and WSL stopped responding.
A pool-allocation trace (wpr -start Pool) attributes 99.97% of the EtwD/Etwr
allocations to the svchost.exe that hosts only Audiosrv (Windows Audio);
summary attached.
Expected Behavior
Opening, playing and closing audio streams from WSLg does not grow kernel
pool usage; ETW registrations made for a stream are freed when it closes.
Actual Behavior
EtwD and Etwr grow one-to-one (each pair looks like one ETW registration),
allocated by Audiosrv:
- About 2,000 registrations per audio stream opened and closed
(+25,207 in 20 s for 13 paplay runs; preliminary, measured while earlier
leaked registrations were still being freed). - While a stream is active, the slow freeing of earlier registrations stops.
- With a game playing sound: 680 to over 6,000 per second, after the first
minutes of a session. - After the Linux app exits they are freed at only ~3,000-4,400 per second.
Result on a 31 GB machine: paged pool 60 GB (EtwD 52.7 GB, 115 M
allocations), nonpaged 11 GB (Etwr 8.7 GB), commit 110.9 of 112.1 GB; WSL
stopped responding and needed wsl --shutdown. Both pools were below 1.1 GB
after a reboot.
Diagnostic Logs
Attachments: WPR pool trace summary, pool tag snapshots, measurement scripts. Full write-up in the first comment. The 12 GB ETL is available on request.
- 主要言語
- C++
- スター
- 34.4k
- フォーク
- 1.9k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 166
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/WSL のほかの issue
-
feature wsl2
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
microsoft/WSL#42306 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/WSL#42114 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
feature kernel wsl2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/WSL#41107 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
feature kernel
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/WSL#41054 · コメント 9 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
feature GPU
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
microsoft/WSL#13592 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
HarperFast/rocksdb-js#1131 ·
メンテナーはふだん 1 日以内に返信
-
area/daemon bug good first issue platform/linux priority/p2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ToshiNamura/Deimos#5 ·
-
needs-format
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Niko1221/Strata#6251 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
metasequoiaime/msime#11666 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
patrick-hudson/put.gd-desktop#1679 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信