[WSLg / audio] Windows Audio service (Audiosrv) leaks ETW registrations while Linux apps play sound; kernel pools reach tens of GB

Abierto
#42,284 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
8/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp, linux, powershell, python, ubuntu

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
  1. 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

  2. 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).

  3. 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

03-attachments.zip

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.

Lenguaje dominante
C++
Estrellas
34.4k
Forks
1.9k
Merge medio
1 d 23 h
PR fusionados (30 d)
166

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/WSL

Todos los issues de microsoft/WSL

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.