SwayNotificationCenter icon indicating copy to clipboard operation
SwayNotificationCenter copied to clipboard

[Bug] Script execution leaks pipe FDs

Open mbethke opened this issue 1 year ago • 1 comments

This bug just started turning on my system (Arch Linux, Sway 1.9-1, swaync 0.10.1-1): after about 9 days of uptime, every notification is accompanied by an error message saying

Failed to run script: example-script Output: Too many open files

Swaync's /proc/$PID/fd directory currently shows 1018 open files, 1002 of which are pipes.

My Vala-fu is weak, but my suspicion of execute_command in src/functions.vala is still strong ;) It looks like std_output isn't being closed if something goes wrong between spawning the process and setting up the child watch, although I can't think of too many things that could. As notoriously fiddly as this spawning stuff is especially in a portable way, I wouldn't be surprised if it was a GTK/Vala bug either.

Here's my config in case it helps.

mbethke avatar Mar 26 '24 15:03 mbethke

Are you running the latest version? This was fixed in #388

ErikReider avatar Apr 15 '24 21:04 ErikReider

Turns out I probably wasn't; meanwhile there's been an update of the Arch package and it's not happening any more.

mbethke avatar Jun 30 '24 10:06 mbethke