- Dec 17, 2020
-
-
Simon McVittie authored
To work around older versions of GLib having a potential deadlock in their fd-closing code due to use of non-async-signal-safe functions in the forked child process, the Flatpak-derived code we're using here uses a simple, naive implementation of closing fds: it iterates through every possible fd, up to the rlimit. Unfortunately, Wine users sometimes set their fd rlimit very high (typically around a million), because the "esync" mechanism in Proton's Wine needs a lot of fds. The time taken by each individual syscall is not significant, but when we do a million of them, it adds up. This is arguably a misconfiguration - the recommendation is now to have a soft rlimit of 1024 and a hard rlimit of about a million, so that only processes that opt-in to dealing with a million fds have to be aware of them - but a significant number of misconfigured systems probably still exist. We don't actually *need* to close all the fds here: there's no security boundary, so giving the child access to unnecessary fds isn't a privilage gain; the parent process outlives the child, so leaking fds won't result in them never being closed; and in any case we're reasonably careful to set CLOEXEC on all our fds. So let's just not close them. In particular, this can save literally a million syscalls per helper subprocess invocation (it's not often I get to say that!), reducing pressure-vessel-wrap launch time by 90% on a system with the high fd limit (about 70 seconds down to 7). With the recommended soft limit of 1024, the speedup is less dramatic, but it still takes off nearly 10% (about 6 down to 5.5). Resolves: https://github.com/ValveSoftware/steam-runtime/issues/323 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Dec 10, 2020
-
-
Simon McVittie authored
Because we were testing for a prefix match with a trailing slash, when FlatpakExports exports /home/me, we would not rewrite it to /home/me/.var/app/com.valvesoftware.Steam. Instead of adding the necessary special cases, use a slightly refactored version of flatpak_has_path_prefix(), which already does what we need. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Dec 03, 2020
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Oct 22, 2020
-
-
Simon McVittie authored
Now that GIO_MODULE_DIR has been backported into scout's GLib, we can disable GIO modules completely, instead of loading them but then not using them. This avoids some misleading warnings (#32). This will not be completely effective on non-Debian systems until we also patch scout's GLib to make GIO_MODULE_DIR take precedence over the hard-coded legacy search path /usr/lib/gio/modules. The unit test for this is still in tests/pressure-vessel/utils.c for now. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Sep 29, 2020
-
-
Simon McVittie authored
While I'm there, add the ability to pass in a pre-opened file descriptor. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Sep 28, 2020
-
-
Simon McVittie authored
This avoids duplicating it in the command-line tools. The test is still in tests/pressure-vessel/ for now, because it needs testutils.py, which uses its own location to find G_TEST_SRCDIR. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Sep 25, 2020
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Sep 09, 2020
-
-
Simon McVittie authored
This is preparation for combining pressure-vessel with steam-runtime-tools. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Sep 02, 2020
-
-
Ludovico de Nittis authored
When the current namespace is a Flatpak environment launched with the `--filesystem` option to mount a directory that is under the user's home, e.g. `--filesystem=~/Games`, we don't want to convert the path to `~/.var/app/com.valvesoftware.Steam/[...]`, because on the host we expect to have the same path as we had in the Flatpak environment. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
Ludovico de Nittis authored
pressure-vessel had a few hard coded assumptions about the host system and where to look at for the graphics provider. For example it was assumed that the root was the same host system used by both pressure-vessel current environment (where pressure-vessel-wrap runs) and also later on by `bwrap`. But when we run pressure-vessel in a Flatpak container, the final `bwrap` command is expected to be executed against the real host system (mounted in `/run/host`, in Flatpak). Also when we are in a Flatpak container we might want to pick the graphics stack from the host system (`/run/host`), from the Flatpak container itself or it could even be a completely separate one. (T22373, T22371) Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
Ludovico de Nittis authored
With this new function it will be possible to test the existence or properties of a given filename under a specific sysroot. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- Aug 19, 2020
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 18, 2020
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 04, 2020
-
-
Simon McVittie authored
This will be used to generate securely-unique socket names that are not an opportunity for denial of service. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 03, 2020
-
-
Simon McVittie authored
This gives us a way to report failure in a signal handler, or between fork() and exec(), both of which are contexts where only a restricted set of async-signal-safe functions are allowed. See signal-safety(7), signal(7) and fork(2) for details. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jul 29, 2020
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
If the wrapped command prints structured data to stdout, we don't want to corrupt its output stream. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
As noted in Flatpak and in GNOME/glib!490, there is a bug in GLib < 2.60 where g_spawn_* can sometimes deadlock while closing fds in a multi-threaded application. Work around this by making the affected fds close-on-execute ourselves, much like Flatpak does. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jul 21, 2020
-
-
Ludovico de Nittis authored
pressure-vessel-with-lock has been renamed to pressure-vessel-adverb because now it has more capabilities than just taking a lock. This change should help the environments that are not able to normally run `bwrap`, like if we are in a Docker container or in a Flatpak app. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- Jun 12, 2020
-
-
Simon McVittie authored
Rather than saying "but what if they are on different filesystems?" we might as well just make it work optimally fast either way, since the author of libglnx has already done the hard part for us. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
It isn't particularly important either way, but there's no real reason not to. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 21, 2020
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
While adding basic test coverage I discovered that this was not giving the intended answer if two values for the same variable appear in the environment block, which is rare but technically possible. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Feb 26, 2020
-
-
Simon McVittie authored
This will let us duplicate a runtime and edit it in-place. The major appeal of doing this is that it's something we can do in a Flatpak environment, where recursively invoking bubblewrap isn't allowed. It also seems like it might yield a more reliable way to overwrite parts of the runtime with their host-system equivalents than the tricks we currently use with files and directories mounted over their runtime counterparts. The major down side is that after we've done this, we have a copy of the runtime, which we need to garbage-collect and clean up eventually. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jan 23, 2020
-
-
Simon McVittie authored
This makes us match how Flatpak includes it, which makes our versions of Flatpak files more similar. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This keeps us more in sync with the equivalent code in Flatpak, helping us to merge fixes from there. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Nov 12, 2019
-
-
Simon McVittie authored
This ensures that we include it in every translation unit. Rename it to _pressure-vessel-config.h to avoid accidentally including the wrong config.h in the presence of submodules. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 10, 2019
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-