Skip to content

Rnote crashes after 20 seconds due to file descriptor leak #1620

@httpdev

Description

@httpdev

Describe the bug
On Linux (NixOS 25.11, kernel 6.18.2, GNOME 49), if

  • the screen is captured using OBS (Pipewire),
  • there is a second display connected (via HDMI) and set to mirror mode, and
  • the rnote window is maximized,
    rnote will crash after approximately 20 seconds.

Unfortunately these are the exact conditions that occur when using rnote for presenting a lecture while simultaneously recording/streaming.

Clicking anywhere or drawing with the digitizer pen resets the "timeout".

To Reproduce
Steps to reproduce the behavior:

  1. Attach second monitor.
  2. Press Win+P and choose "Mirror".
  3. Start OBS, add "Screen Capture (PipeWIre), select "Display" > "Share" in the "Share Screen" dialog.
  4. Start rnote from console and maximize window
  5. Wait 20 seconds
  6. rnote terminates with an error "Gdk-Message: 19:28:09.660: Error reading events from display: Invalid argument"

Expected behavior
Rnote should still work.

Console Output

RUST_LOG=rnote=debug RUST_BACKTRACE=1 rnote
   0.000048481s DEBUG rnote: .. tracing subscriber initialized.
MESA-INTEL: warning: ../src/intel/vulkan/anv_formats.c:981: FINISHME: support more multi-planar formats with DRM modifiers
MESA-INTEL: warning: ../src/intel/vulkan/anv_formats.c:949: FINISHME: support YUV colorspace with DRM format modifiers
Gdk-Message: 22:52:17.180: Error reading events from display: Invalid argument

The MESA messages appear at startup and do not appear to be critical, as the application runs fine if any of the above crash conditions are not met. The Gdk-Message appears at the time of the crash.

Desktop (please complete the following information):

  • OS: NixOS 25.11
  • App Version: Rnote v0.13.1
  • Installation Source: nixpkgs
  • Desktop Environment: Gnome 49.0
  • Display Server: Wayland
  • GPU/lspci:
00:02.0 VGA compatible controller: Intel Corporation WhiskeyLake-U GT2 [UHD Graphics 620] (rev 02)
Subsystem: Lenovo Device 2292
Kernel driver in use: i915
Kernel modules: i915
  • Input Source: Digitizer pen available but no interaction necessary for crash

Additional context
There is no relevant output in dmesg or journalctl. Running

watch -n 1 'ls -1 /proc/$(pidof rnote)/fd | wc -l'

remotely (as the crash only happens when rnote is maximized) shows that there appears to be a file descriptor leak. The descriptor count normally hovers around 40, but when the crash conditions are met, it quickly increases to >1000, at which point rnote is terminated.

Running lsof -p $(pidof rnote) under crash conditions shows hundreds of open file descriptors with name

/memfd:mutter-anonymous-file-dmabuf-format-table (deleted)

Running sudo strace -f -e trace=memfd_create,sendmsg -s 200 -p $(pidof gnome-shell) shows that gnome-shell sends hundreds of SCM_RIGHTS messages:

[pid 210866] sendmsg(96, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="B\0\0\0\1\0\f\0 \t\0\0B\0\0\0\2\0\24\0\10\0\0\0\200\342\0\0\0\0\0\0B\0\0\0\4\0\24\0\10\0\0\0\200\342\0\0\0\0\0\0B\0\0\0\6\0\f\0\1\0\0\0B\0\0\0\5\0p\0b\0\0\0\0\0\1\0\2\0\5\0\6\0\7\0\n\0\v\0\f\0\16\0\17\0\20\0\22\0\23\0\24\0\26\0\27\0\30\0\31\0\33\0\34\0\35\0\36\0 \0!\0\"\0#\0%\0&\0'\0(\0*\0+\0,\0j\0k\0l\0\202\0\203\0\204\0\206\0\207\0\210\0\212\0\213\0\214\0\216\0\217\0\220\0\0\0B\0\0\0\3\0\10\0B\0\0\0\4\0\24\0\10\0\0\0\200\342\0\0"..., iov_len=536}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[114]}], msg_controllen=20, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 536

I suspect the whole issue might be related to this: SCM_RIGHTS API quirks : SCM_RIGHTS messages contain file descriptors that the application must close and apparently doesn't. Unfortunately I don't know how to continue debugging this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggtk4Related to Gtk4linuxThis issue occurs only on linux

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions