Skip to content
Snippets Groups Projects
Simon McVittie's avatar
Simon McVittie authored
If we pass a (signed) char to a varargs function, it's promoted to
(signed) int by the default argument promotions (resulting in padding
on the left by copying the sign bit); but then %x interprets it as an
unsigned int. The practical result is that for anything over 0x7f, for
example 0xAB, we interpret the high bit as the sign bit and pad with
"1" bits, turning 0xAB into 0xFFFFFFAB. \uFFFFFFAB is not allowed as an
escaped JSON character (because Unicode stops at U+10FFFF) so parsing
fails.

Note that this change does not result in strings with non-ASCII content
being interpreted *correctly*: we are effectively taking the bytestring
from the OS and decoding it as though it was ISO-8859-1, so if a file's
path includes U+00C7 LATIN CAPITAL_LETTER C WITH CEDILLA (`Ç`), encoded
as 0xC3 0x87 on disk (assuming a UTF-8 environment), it will go into
the JSON document as \u00C3\u0087 instead of the correct \u00C7. Fixing
this would require either a considerably more complex implementation of
inspect-library, or an output format that is based on bytestrings
rather than JSON.

Partially addresses
https://github.com/ValveSoftware/steam-runtime/issues/385 and
#69

.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
869b7c0d
History

steam-runtime-tools — Steam Runtime integration for the Steam client

The steam-runtime-tools library provides low-level Unix-specific tools and functionality for the Steam client, including the pressure-vessel tool that runs Steam games in containers.

To support multiple architectures (currently only i386 and x86_64 are supported), you will need to build it once for each architecture and install at least the helper tools in /usr/libexec/steam-runtime-tools-0 (the libsteam-runtime-tools-0-helpers package) for every architecture in parallel.

The helper tools are located relative to the shared library, so it's OK to bundle steam-runtime-tools alongside some other stack in this layout:

anything/
    lib/
        x86_64-linux-gnu/
            libsteam-runtime-tools-0.so.0
    libexec/
        steam-runtime-tools-0/
            i386-linux-gnu-*
            x86_64-linux-gnu-*

as long as the program that is linked to libsteam-runtime-tools-0.so.0 can find it (via a RPATH or RUNPATH or by setting the LD_LIBRARY_PATH environment variable).

pressure-vessel — putting Steam in containers

The pressure-vessel/ subdirectory of this project contains the pressure-vessel utilities, which are used by Steam's Steam Linux Runtime compatibility tool to run games in individual game-specific containers. For background on pressure-vessel and SteamLinuxRuntime, please see: