GModCEFCodecFix
GModCEFCodecFix copied to clipboard
CEF requires libnss that is newer than in Steam Runtime
When running GMod in minimalistic LXC container I get no main menu and in console I get this:
Attempting to load Chromium...
failed to dlopen /home/lyberta/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/html_chromium_client.so error=/home/lyberta/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu/libnss3.so: version `NSS_3.30' not found (required by /home/lyberta/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/libcef.so)
Failed to load /home/lyberta/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/html_chromium_client.so: (null)
Failed to load /home/lyberta/.local/share/Steam/steamapps/common/GarrysMod/garrysmod/bin/html_chromium_client.so: (null)
failed to dlopen html_chromium_client.so error=/home/lyberta/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu/libnss3.so: version `NSS_3.30' not found (required by /home/lyberta/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/libcef.so)
Failed to load html_chromium_client.so: (null)
Attempting to load Awesomium...
Failed to load /home/lyberta/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/html_awesomium_client.so: (null)
Failed to load /home/lyberta/.local/share/Steam/steamapps/common/GarrysMod/garrysmod/bin/html_awesomium_client.so: (null)
Failed to load html_awesomium_client.so: (null)
Attempting to load Stub...
It looks like the version of libnss3.so Steam Runtime provides is too old for CEF.
Copying libnss3.so and libnssutil3.so into GarrysMod/bin/linux64 makes the main menu appear for about a minute then the entire game crashes with:
[0105/104432.322145:ERROR:nss_util.cc(239)] Error initializing NSS with a persistent database (sql:/home/lyberta/.pki/nssdb): libsoftokn3.so: cannot open shared object file: No such file or directory
[0105/104432.322243:ERROR:nss_util.cc(124)] Error initializing NSS without a persistent database: NSS error code: -5925
[0105/104432.322266:FATAL:nss_util.cc(126)] nss_error=-5925, os_error=0
[0105/104441.160691:ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -3
Ok, then with copying libsoftokn3.so the game crashes with a different message:
[0105/105206.705430:ERROR:nss_util.cc(239)] Error initializing NSS with a persistent database (sql:/home/lyberta/.pki/nssdb): NSS error code: -8023
[0105/105206.705537:ERROR:nss_util.cc(124)] Error initializing NSS without a persistent database: NSS error code: -8023
[0105/105206.705554:FATAL:nss_util.cc(126)] nss_error=-8023, os_error=0
[0105/105226.180183:ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -3
Out of desperation, I installed libnss3 inside of container which also pulled libnspr4 and the game finally worked. I guess the proper fix would be to somehow make CEF cooperate with locally installed libnss. Known good versions of these can be obtained, say, from Debian Stable (libnss3, libnspr4).
We're aiming to build CEF 120 this next go around with Steam Runtime 2.0 (Debian 10). Theoretically, you'll be able to select that runtime as a Compatibility option for GMod and everything should work
So we weren't able to build CEF inside of Steam Runtime, however, our build environment is Ubuntu 20.04 and the minimum supported build environment for CEF is Ubuntu 20.04+/Debian 10+. The minimum build environment effectively becomes the minimum run environment in this case. Steam Runtime 1.0 (scout) is based on Ubuntu 12.04, which is far too out of date.
If you want to run it in a Steam Runtime container, you'll need at least Steam Runtime 2.0 (soldier) to even attempt.
See BranchesAndBuilding for more info.
Reopening since this is apparently an issue with Ubuntu 24.04, and we could ship the right version of libnss ourselves to fix it