Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[L4D2] engine.so: cannot enable executable stack as shared object requires: Invalid argument #6978

Open
JND94 opened this issue Feb 3, 2025 · 4 comments

Comments

@JND94
Copy link

JND94 commented Feb 3, 2025

steam.sh[19678]: Running Steam on arch rolling 64-bit
steam.sh[19678]: STEAM_RUNTIME is enabled automatically
setup.sh[19728]: Steam runtime environment up-to-date!
steam.sh[19678]: Using supervisor /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin/steam-runtime-supervisor
steam.sh[19678]: Steam client's requirements are satisfied
CProcessEnvironmentManager is ready, 6 preallocated environment variables.
[2025-02-03 19:46:23] Startup - updater built Jan 28 2025 00:50:36
[2025-02-03 19:46:23] Startup - Steam Client launched with: '/home/user/.local/share/Steam/ubuntu12_32/steam' '-srt-logger-opened' '-forcedesktopscaling' '1.2' '-nochatui' '-nofriendsui'
02/03 19:46:23 minidumps folder is set to /tmp/dumps
02/03 19:46:23 Init: Installing breakpad exception handler for appid(steam)/version(1738026274)/tid(19799)
[2025-02-03 19:46:23] Loading cached metrics from disk (/home/user/.local/share/Steam/package/steam_client_metrics.bin)
[2025-02-03 19:46:23] Using the following download hosts for Public, Realm steamglobal
[2025-02-03 19:46:23] 1. https://client-update.fastly.steamstatic.com, /, Realm 'steamglobal', weight was 900, source = 'update_hosts_cached.vdf'
[2025-02-03 19:46:23] 2. https://client-update.akamai.steamstatic.com, /, Realm 'steamglobal', weight was 100, source = 'update_hosts_cached.vdf'
[2025-02-03 19:46:23] 3. https://client-update.steamstatic.com, /, Realm 'steamglobal', weight was 1, source = 'baked in'
[2025-02-03 19:46:23] Verificando instalación...
[2025-02-03 19:46:23] Verification complete
UpdateUI: skip show logo
Steam logging initialized: directory: /home/user/.local/share/Steam/logs

XRRGetOutputInfo Workaround: initialized with override: 0 real: 0xe00c1dc0
XRRGetCrtcInfo Workaround: initialized with override: 0 real: 0xe00c0500
steamwebhelper.sh[19836]: Using supervisor /home/user/.steam/root/ubuntu12_32/steam-runtime/amd64/usr/bin/steam-runtime-supervisor
steamwebhelper.sh[19836]: Starting steamwebhelper under bootstrap sniper steam runtime via /home/user/.local/share/Steam/ubuntu12_64/steam-runtime-sniper.sh
steamwebhelper.sh[19836]: Using CEF sandbox \(try with -no-cef-sandbox if this fails\)
steamwebhelper.sh[19836]: Starting steamwebhelper with Sniper steam runtime at /home/user/.local/share/Steam/ubuntu12_64/steam-runtime-sniper/_v2-entry-point
exec ./steamwebhelper -nocrashdialog -lang=es_ES -cachedir=/home/user/.local/share/Steam/config/htmlcache -steampid=19799 -buildid=1738026274 -steamid=0 -logdir=/home/user/.local/share/Steam/logs -uimode=7 -startcount=0 -steamuniverse=Public -realm=Global -clientui=/home/user/.local/share/Steam/clientui -steampath=/home/user/.local/share/Steam/ubuntu12_32/steam -launcher=0 -no-restart-on-ui-mode-change --valve-enable-site-isolation --enable-smooth-scrolling --password-store=basic --log-file=/home/user/.local/share/Steam/logs/cef_log.txt --disable-quick-menu --enable-features=PlatformHEVCDecoderSupport --disable-features=SpareRendererForSitePerProcess,DcheckIsFatal,ValveFFmpegAllowLowDelayHEVC
Steam Runtime Launch Service: starting steam-runtime-launcher-service
Steam Runtime Launch Service: steam-runtime-launcher-service is running pid 20047
bus_name=com.steampowered.PressureVessel.LaunchAlongsideSteam
SDL3 3.1.7 library is too old.
Desktop state changed: desktop: { pos:    0,   0 size: 1920,1080 } primary: { pos:    0,   0 size: 1920,1080 }
Caching cursor image for left_ptr, size 40x40, serial 3, cache size = 0
fsync: up and running.
Fossilize INFO: Overriding serialization path: "/home/user/.local/share/Steam/shader_cache_temp_dir_d3d11_64/fozpipelinesv6/steamapprun_pipeline_cache".
fsync: up and running.
Fossilize INFO: Overriding serialization path: "/home/user/.local/share/Steam/shader_cache_temp_dir_d3d12_64/fozpipelinesv6/steamapprun_pipeline_cache".
chdir "/home/user/disk1/Games/steamapps/common/Left 4 Dead 2"
ERROR: ld.so: object '/home/user/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/user/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/user/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/user/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/user/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Game Recording - would start recording game 550, but recording for this game is disabled
Adding process 20753 for gameID 550
Adding process 20754 for gameID 550
Adding process 20755 for gameID 550
pid 20862 != 20858, skipping destruction (fork without exec?)
pid 20867 != 20858, skipping destruction (fork without exec?)
pid 20888 != 20858, skipping destruction (fork without exec?)
Adding process 20858 for gameID 550
SDL video target is 'x11'
Adding process 20889 for gameID 550
Adding process 20891 for gameID 550
SDL video target is 'x11'
 failed to dlopen /home/user/disk1/Games/steamapps/common/Left 4 Dead 2/bin/engine.so error=/home/user/disk1/Games/steamapps/common/Left 4 Dead 2/bin/engine.so: cannot enable executable stack as shared object requires: Invalid argument
 failed to dlopen engine.so error=engine.so: cannot enable executable stack as shared object requires: Invalid argument
AppFramework : Unable to load module engine.so!
Unable to load interface VCvarQuery001 from engine.so
Game Recording - game stopped [gameid=550]
Removing process 20891 for gameID 550
Removing process 20889 for gameID 550
Removing process 20858 for gameID 550
Removing process 20755 for gameID 550
Removing process 20754 for gameID 550
Removing process 20753 for gameID 550

ldd on engine.so gives:

> LD_LIBRARY_PATH="." ldd engine.so
        linux-gate.so.1 (0xe84a1000)
        libtier0.so => ./libtier0.so (0xe77e5000)
        libvstdlib.so => ./libvstdlib.so (0xe76f0000)
        libsteam_api.so => ./libsteam_api.so (0xe7693000)
        libSDL2-2.0.so.0 => ./libSDL2-2.0.so.0 (0xe7537000)
        librt.so.1 => /usr/lib32/librt.so.1 (0xe7502000)
        libopenal.so.1 => /usr/lib32/libopenal.so.1 (0xe7305000)
        libm.so.6 => /usr/lib32/libm.so.6 (0xe7221000)
        libdl.so.2 => /usr/lib32/libdl.so.2 (0xe721c000)
        libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xe6fa4000)
        libpthread.so.0 => /usr/lib32/libpthread.so.0 (0xe6f9d000)
        /usr/lib/ld-linux.so.2 (0xe84a3000)
        libc.so.6 => /usr/lib32/libc.so.6 (0xe6d6a000)
        libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xe6d35000)
@smcv
Copy link

smcv commented Feb 3, 2025

This sounds like a result of this behaviour change in glibc 2.41:

  • dlopen and dlmopen no longer make the stack executable if a shared
    library requires it, either implicitly because of a missing GNU_STACK
    ELF header (and default ABI permission having the executable bit set)
    or explicitly because of the executable bit in GNU_STACK, and the
    stack is not already executable. Instead, loading such objects will
    fail.

https://lists.gnu.org/archive/html/info-gnu/2025-01/msg00014.html

@smcv
Copy link

smcv commented Feb 3, 2025

If it's that, the ideal solution would be for engine.so to not require an executable stack (this is usually a result of having inline assembler that the compiler cannot prove is compatible with a non-executable stack).

If that isn't possible, the next best thing would be for the engine's main executable to be flagged as requiring an executable stack, so that the stack is already executable before loading engine.so.

@kisak-valve kisak-valve changed the title [L4D2] Crash on start [L4D2] engine.so: cannot enable executable stack as shared object requires: Invalid argument Feb 3, 2025
@JND94
Copy link
Author

JND94 commented Feb 4, 2025

ValveSoftware/portal2#451 (comment)
clearing the executable stack flag as described here worked for me

@smcv
Copy link

smcv commented Feb 4, 2025

clearing the executable stack flag

This sounds as though engine.so and valve_avi.so might not actually need an executable stack, but might be missing the metadata that says they don't need it.

If that's the case, then Valve developers could likely fix this problem by linking them with -Wl,-z,noexecstack (edited: possibly -Wl,-z,no-exec-stack, I'm not sure of the exact spelling), or by ensuring that any assembler code in these libraries is marked with a suitable .note.GNU-stack note to say "I don't actually need an executable stack".

Or, if these libraries genuinely do need an executable stack and it isn't easy to change them to not, another likely way to avoid this regression would be to mark the game's main executable as also requiring an executable stack, by linking it with -Wl,-z,execstack.

Recent versions of binutils ld will log warnings during linking if an executable stack is required. Red Hat's blog has quite a good writeup about this: https://www.redhat.com/en/blog/linkers-warnings-about-executable-stacks-and-segments

The most common reasons to need an executable stack are inline assembler code (the compiler can't easily prove that this doesn't need an executable stack, so it will pessimistically assume that an executable stack is required), and nested functions (a deprecated gcc extension).

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

No branches or pull requests

3 participants