Skip to content

fix hang with gdk-pixbuf >=2.44 Glycin: don't set SIGCHLD to IGNORE - #266

Open
yennor wants to merge 4 commits into
squentin:masterfrom
yennor:fix-glycin-sigchld
Open

fix hang with gdk-pixbuf >=2.44 Glycin: don't set SIGCHLD to IGNORE#266
yennor wants to merge 4 commits into
squentin:masterfrom
yennor:fix-glycin-sigchld

Conversation

@yennor

@yennor yennor commented Mar 19, 2026

Copy link
Copy Markdown

Disclaimer: I'm not a Perl developper. I did the whole thing using a LLM. It looks sound to me, also passed tests and everything. But probably a seasoned perl developer should take a look at it @squentin ;-)

gdk-pixbuf 2.44 introduced Glycin, which decodes images in sandboxed child processes (bwrap). Setting $SIG{CHLD}='IGNORE' caused the kernel to auto-reap these children before GLib's GSubprocess could collect their exit status, making every gdk-pixbuf image load hang indefinitely.

Fix by removing $SIG{CHLD}='IGNORE' and instead properly reaping child processes at each fork site:

  • forksystem and SaveTags: use Glib::child_watch_add
  • metadata readers and simple_http_wget: use waitpid after completion
  • mpv/mplayer _Kill_timeout: use waitpid(WNOHANG) to reap zombies

Also fix a pre-existing bug in forksystem where fork failure (undef) fell through into the child branch because undef==0 in numeric context.

Fixes: #262

RMM added 2 commits March 19, 2026 09:37
gdk-pixbuf 2.44 introduced Glycin, which decodes images in sandboxed
child processes (bwrap). Setting $SIG{CHLD}='IGNORE' caused the kernel
to auto-reap these children before GLib's GSubprocess could collect
their exit status, making every gdk-pixbuf image load hang indefinitely.

Fix by removing $SIG{CHLD}='IGNORE' and instead properly reaping child
processes at each fork site:
- forksystem and SaveTags: use Glib::child_watch_add
- metadata readers and simple_http_wget: use waitpid after completion
- mpv/mplayer _Kill_timeout: use waitpid(WNOHANG) to reap zombies

Also fix a pre-existing bug in forksystem where fork failure (undef)
fell through into the child branch because undef==0 in numeric context.

Fixes: squentin#262
Same fix as mpv/mplayer backends (7399e16): use waitpid(WNOHANG) in
_Kill_timeout to reap finished children before checking if still running.
Also add waitpid in iceserver _eos_cb to reap the child on normal exit.
@davidfoerster

davidfoerster commented Mar 19, 2026

Copy link
Copy Markdown

Which GLib bindings are you using? Mine don't feature Glib::child_watch_add but they do have Glib::Child->watch_add albeit with a different argument order.

@yennor

yennor commented Mar 20, 2026

Copy link
Copy Markdown
Author

You are completely right. As I said above. I didn't really do those changes myself. I just tested them, and told the model to test them, but as it seems, we never entered that code path... I know sooner or later I'll have to change my music player, so I didn't really invest too much time into it ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gdk::Pixbuf->new_from_file hangs with gdk-pixbuf v2.44

2 participants