RESOLVED FIXED 216745
[GTK][WPE] WKTR has lost access to Pulseaudio
https://bugs.webkit.org/show_bug.cgi?id=216745
Summary [GTK][WPE] WKTR has lost access to Pulseaudio
Philippe Normand
Reported 2020-09-20 10:10:23 PDT
I was trying to debug #216716 so I locally un-flagged it and ran it in loop, after noticing a consistent crash after 24 or 25 successful iterations, I dug in another debug black hole... The crash happens when I run: run-webkit-tests --gtk --exit-after-n-failures=1 --iterations=200 --no-retry-failures --no-show-results fast/mediastream/mediastreamtrack-video-clone.html 24th or 25th iteration will crash. Then check the crash log attached to this bug, snippet: STDERR: shm_open() failed: No such file or directory STDERR: shm_open() failed: No such file or directory STDERR: shm_open() failed: No such file or directory STDERR: shm_open() failed: No such file or directory STDERR: shm_open() failed: No such file or directory STDERR: shm_open() failed: No such file or directory STDERR: shm_open() failed: No such file or directory STDERR: shm_open() failed: No such file or directory STDERR: shm_open() failed: Too many open files STDERR: The per-process limit on the number of open file descriptors has been reached. STDERR: ERROR: cannot create wakeup pipe STDERR: The per-process limit on the number of open file descriptors has been reached. STDERR: ERROR: cannot create wakeup pipe STDERR: shm_open() failed: Too many open files STDERR: The per-process limit on the number of open file descriptors has been reached. STDERR: ERROR: cannot create wakeup pipe STDERR: shm_open() failed: Too many open files STDERR: The per-process limit on the number of open file descriptors has been reached. STDERR: ERROR: cannot create wakeup pipe STDERR: STDERR: (WebKitWebProcess:133): GStreamer-CRITICAL **: 10:00:18.403: gst_poll_write_control: assertion 'set != NULL' failed Strangely, this doesn't happen when I downgrade PulseAudio from v13 to v12.2 in the SDK, so there might be a regression in their SHM support, I haven't found it yet though... Anyway. env GST_DEBUG="pulse:6" run-webkit-tests --gtk --no-retry-failures --no-show-results fast/mediastream/mediastreamtrack-video-clone.html less -R WebKitBuild/GTK/Release/layout-test-results/fast/mediastream/mediastreamtrack-video-clone-stderr.txt ... 0:00:00.682512514 133 0x61be10 LOG pulse pulsesink.c:549:gst_pulseringbuffer_open_device:<autoaudiosink1-actual-sink-pulse> connect to server (NULL) 0:00:00.682548463 133 0x61be10 LOG pulse pulsesink.c:426:gst_pulsering_context_state_cb: got new context state 1 0:00:00.682607837 133 0x61be10 LOG pulse pulsesink.c:572:gst_pulseringbuffer_open_device:<autoaudiosink1-actual-sink-pulse> context state is now 1 0:00:00.682612609 133 0x61be10 LOG pulse pulsesink.c:581:gst_pulseringbuffer_open_device:<autoaudiosink1-actual-sink-pulse> waiting.. 0:00:00.683023557 133 0xd20330 LOG pulse pulsesink.c:426:gst_pulsering_context_state_cb: got new context state 2 0:00:00.684308385 133 0xd20330 LOG pulse pulsesink.c:426:gst_pulsering_context_state_cb: got new context state 3 shm_open() failed: No such file or directory 0:00:00.684485267 133 0xd20330 LOG pulse pulsesink.c:426:gst_pulsering_context_state_cb: got new context state 5 0:00:00.684495839 133 0xd20330 LOG pulse pulsesink.c:432:gst_pulsering_context_state_cb: signaling 0:00:00.684541232 133 0x61be10 LOG pulse pulsesink.c:572:gst_pulseringbuffer_open_device:<autoaudiosink1-actual-sink-pulse> context state is now 5 0:00:00.684552988 133 0x61be10 WARN pulse pulsesink.c:614:gst_pulseringbuffer_open_device:<autoaudiosink1-actual-sink-pulse> error: Failed to connect: Protocol error So this fails, but `webkit-flatpak -c gst-launch-1.0 audiotestsrc num-buffers=1 ! queue ! pulsesink` works fine. After comparing strace logs between WKTR and this gst-launch line, in the latter case, enable-shm=no appears in the pulseaudio config file (in the strace log): openat(AT_FDCWD, "/run/user/1000/pulse/config", O_RDONLY|O_CLOEXEC) = 8 ... fstat(8, {st_mode=S_IFREG|0600, st_size=14, ...}) = 0 read(8, "enable-shm=no\n", 4096) = 14 read(8, "", 4096) = 0 but not in WKTR's. So this lead me in flatpak-run.c which sets 2 PULSEAUDIO env vars in the sandbox: flatpak_bwrap_set_env (bwrap, "PULSE_SERVER", pulse_server, TRUE); flatpak_bwrap_set_env (bwrap, "PULSE_CLIENTCONFIG", config_path, TRUE); And of course our GTK and WPE test drivers don't set these vars...
Attachments
crash log (119.44 KB, text/plain)
2020-09-20 10:10 PDT, Philippe Normand
no flags
Patch (2.69 KB, patch)
2020-09-20 10:15 PDT, Philippe Normand
no flags
Philippe Normand
Comment 1 2020-09-20 10:10:53 PDT
Created attachment 409235 [details] crash log
Philippe Normand
Comment 2 2020-09-20 10:15:47 PDT
EWS
Comment 4 2020-09-21 12:00:51 PDT
Committed r267351: <https://trac.webkit.org/changeset/267351> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409236 [details].
Radar WebKit Bug Importer
Comment 5 2020-09-21 12:27:26 PDT
Note You need to log in before you can comment on or make changes to this bug.