Public bug reported:

Since 2.52.6-0ubuntu0.24.04.2 (the noble SRU for LP: #2168736, 
debian/patches/disable-nvidia-dmabuf.patch),
WebKitWebProcess leaks one anon_inode:sync_file file descriptor per rendered 
frame on the proprietary NVIDIA
driver. With the default soft RLIMIT_NOFILE of 1024 that a desktop-launched 
application inherits, the web
process runs out of descriptors within about 5 minutes and aborts; the window 
stays grey/blank.

Downgrading to 2.52.6-0ubuntu0.24.04.1 (noble-security) makes it go away, with 
nothing else changed (same
kernel, same NVIDIA driver, same Mesa). The leak started right after the update 
was installed.

[ System ]

Linux Mint 22.3 (Ubuntu noble base), Cinnamon, X11 session
Kernel 7.0.0-43-generic
NVIDIA GeForce RTX 5070 Ti, nvidia-driver-580-open 580.196.07-1ubuntu1
libwebkit2gtk-4.1-0 2.52.6-0ubuntu0.24.04.2 (bad) / 2.52.6-0ubuntu0.24.04.1 
(good)

Observed in a GTK3 WebKitGTK 4.1 application (a Tauri 2 app). I have not
tried epiphany or MiniBrowser.

[ Steps to reproduce ]

1. On an NVIDIA system with 2.52.6-0ubuntu0.24.04.2, start a WebKitGTK 4.1 
application that keeps
   repainting (e.g. a page with an animation).
2. Find its web process and count its sync_file descriptors a few times:
   ls -l /proc/<WebKitWebProcess pid>/fd | grep -c sync_file

Expected: a small, stable count.
Actual: the count grows steadily (about 2 per second here) and never goes down.

[ Evidence ]

Descriptors of the web process sampled every 15 s; every other type
stays flat:

09:17:32 total=137 sync_file=66  nvidia=36 eventfd=13 socket=5
09:17:48 total=195 sync_file=124 nvidia=36 eventfd=13 socket=5
09:18:03 total=243 sync_file=172 nvidia=36 eventfd=13 socket=5
09:18:33 total=303 sync_file=232 nvidia=36 eventfd=13 socket=5
09:19:19 total=395 sync_file=324 nvidia=36 eventfd=13 socket=5
09:22:25 total=797 sync_file=723 nvidia=36 eventfd=13 socket=5

When the limit is reached the kernel log shows:

[drm:nv_drm_semsurf_fence_wait_ioctl [nvidia_drm]] *ERROR* [nvidia-drm] Attempt 
to wait on invalid sync FD: -24
traps: ReceiveQueue[28591] trap int3 ip:... in libglib-2.0.so.0.8000.0

and the web process dumps core with SIGTRAP. The faulting thread is
WebKit's ReceiveQueue:

#0 g_log_structured_array (libglib-2.0.so.0)
#1 g_log_default_handler
#2 g_logv
#3 g_log
#4 ?? (libglib-2.0.so.0)
#5 g_main_context_new_with_flags
#6 ?? (libjavascriptcoregtk-4.1.so.0)
#7 WTF::RunLoop::currentSingleton()

i.e. glib's fatal error when it cannot create a main context's wakeup fd
(EMFILE).

[ Workarounds ]

- WEBKIT_DISABLE_DMABUF_RENDERER=1: no leak (descriptor count flat at 33), at 
the cost of GPU rendering.
- __NV_DISABLE_EXPLICIT_SYNC=1: no effect.
- Downgrading to 2.52.6-0ubuntu0.24.04.1: no leak.

** Affects: webkit2gtk (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: noble regression-update

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175515

Title:
  webkit2gtk 2.52.6-0ubuntu0.24.04.2 leaks sync_file fds in
  WebKitWebProcess on NVIDIA until it aborts with EMFILE

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/webkit2gtk/+bug/2175515/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to