After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791616 - gst-uninstalled.py: Don't close parent file descriptors
gst-uninstalled.py: Don't close parent file descriptors
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-build
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-14 14:33 UTC by Alicia Boya García
Modified: 2018-01-12 19:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (877 bytes, patch)
2017-12-14 14:36 UTC, Alicia Boya García
committed Details | Review

Description Alicia Boya García 2017-12-14 14:33:04 UTC
Python3 sets close_fds=True by default in subprocess.Popen() and friends.

This is a problem when gst-uninstalled.py is used as a wrapper for some applications, like the WebKit WebProcess, that receives a file descriptor (pointing to a socket) as an argument.
Comment 1 Alicia Boya García 2017-12-14 14:36:54 UTC
Created attachment 365543 [details] [review]
Patch
Comment 2 Thibault Saunier 2018-01-12 12:34:12 UTC
I think that patch is OK but I do not understand why close_fds=True is the default, in what case is it useful?
Comment 3 Alicia Boya García 2018-01-12 19:27:08 UTC
When gst-uninstalled is used as a wrapper for an executable that relies on file descriptor inheritance.

For instance, before calling fork(), WebKit creates a socket which shares to its WebProcess children as an open file descriptor. The socket is not closed in the child process before calling execv(), so they can still use it to communicate with the browser.

Therefore, if the WebProcess is swapped by a wrapper, e.g. gst-uninstall, it's necessary that such wrapper also does not close the socket file descriptor before calling execv() to execute the actual WebProcess.
Comment 4 Thibault Saunier 2018-01-12 19:44:37 UTC
commit a5ed8944e31583c3d499b720a2e3b3461716f98d (HEAD -> master, origin/master, origin/HEAD)
Author: Alicia Boya García <aboya@igalia.com>
Date:   Thu Dec 14 15:35:23 2017 +0100

    gst-uninstalled.py: Don't close parent file descriptors

    https://bugzilla.gnome.org/show_bug.cgi?id=791616