Public bug reported:

In 26.04, mate-screenshot never finishes writing its temporary PNG. The
file /tmp/mate-screenshot.<pid>.0/Screenshot.png stays at 0 bytes, so the
dialog never enables drag and drop, and the forked save child hangs
forever. Its threads are "mate-screenshot" in futex wait and
"gly-hdl-editor" in do_wait.

screenshot-save.c saves the image in a child that was fork()ed from the
multi-threaded GTK process. gdk-pixbuf 2.44 writes PNG through glycin,
which uses its own threads and sandboxed helper processes, and that
deadlocks after fork(). Users cannot drag screenshots into other
applications, and a stuck process is left behind for every screenshot.

Upstream fixed this in two commits (mate-utils issue #369):
  c74d86d0f25435b1d90f70015d210448126bb6ef  mate-screenshot: Replace fork save 
with sync save
  b70d97e762a165828402307bca87221fdfa26d51  mate-screenshot: Cleanup on SIGINT 
and SIGTERM again

The attached debdiff backports both of them unchanged to 1.26.1-1build5.

[Test Plan]

1. On 26.04 (libgdk-pixbuf-2.0-0 2.44.5, glycin 2.1.5), run mate-screenshot.
2. Try to drag the preview into a terminal or file manager.
   Before: nothing can be dragged; ls -la /tmp/mate-screenshot.*/ shows a
   0-byte file and a leftover mate-screenshot child process.
   After: the temp file is a complete PNG at screen size, the drag works,
   and no child process is left.
3. Close the dialog, or send SIGTERM to the process: the temp directory is
   removed.

Tested here with a rebuild of the debdiff on a 3840x2160 screen: the temp
PNG was written at full size, no child process was left, and the temp
directory was removed both on SIGTERM and on normal exit.

[Where problems could occur]

Saving is now synchronous in the main process, so the dialog may need a
fraction of a second longer to appear on very large screens. Temp-file
cleanup moves from the child to atexit and signal handlers, so a crash
(SIGSEGV) can leave the temp dir in /tmp. The change only affects
mate-screenshot; other mate-utils tools are untouched.

** Affects: mate-utils (Ubuntu)
     Importance: Undecided
         Status: New

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

Title:
  [SRU] mate-screenshot hangs saving temp file, drag and drop never
  enabled (glycin deadlock after fork)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mate-utils/+bug/2171362/+subscriptions


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

Reply via email to