mumble-voip / mumble

Mumble is an open-source, low-latency, high quality voice chat software.
https://www.mumble.info
Other
6.44k stars 1.12k forks source link

linux: mumble overlay crashes Left4Dead2 on Steam #4551

Open cbs228 opened 4 years ago

cbs228 commented 4 years ago

When attempting to load the 32-bit libmumbleoverlay.x86.so.1.4.0 into Left4Dead2, the game crashes with a SEGFAULT. The SEGFAULT occurs after the title movie but before the game reaches the main menu. During the title movie, the overlay appears to function okay.

Left4Dead2 is a 32-bit Valve Source title. A similar issue with Source titles was reported in #1274.

Steps to Reproduce

  1. Install required 32-bit libraries.

    sudo dpkg --add-architecture i386
    sudo apt-get update
    sudo apt-get install g++-multilib
  2. Build bf9550a68e30b77d2d7b63094022244d26c6fd50 with the overlay and debugging symbols. 32-bit compatibility packages are needed.

    cmake -Dsymbols=ON -Dclient=ON -Dserver=OFF \
    -Doverlay=ON \
    -DCMAKE_INSTALL_PREFIX=install \
    -DCMAKE_INSTALL_RPATH='\$ORIGIN/../lib' \
    -DCMAKE_BUILD_TYPE=Debug ..
    make -j10
  3. Open the Steam client. In Steam, right-click the game. Choose Properties→General→Set Launch Options. Set launch options to:

    LD_PRELOAD="/path/to/libmumbleoverlay.x86.so.1.4.0" GAME_DEBUGGER=gdb gnome-terminal -- %command%

    The "%command%" substitution is built in to Steam. Steam will replace %command% with whatever command it uses to run the game. The GAME_DEBUGGER option is part of the launch script for L4D2.

  4. Leave the mumble client closed. (The crash also occurs if it is open.)

  5. Start the game via Steam by clicking the "Play" button. A terminal will open with gdb. Continue to run until the game segfaults.

Desktop (please complete the following information):

I have also tested the version included with Mumble 1.3.0, which I also built from source. I also tried building it with the Steam Runtime Environment com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz, just to see if glibc or any other library was the culprit. These versions all produced similar errors.

GDB backtrace

Click to show ``` Thread 1 "hl2_linux" received signal SIGSEGV, Segmentation fault. 0xf3ef4cc7 in ?? () from /usr/lib/i386-linux-gnu/dri/iris_dri.so (gdb) bt #0 0xf3ef4cc7 in ?? () from /usr/lib/i386-linux-gnu/dri/iris_dri.so #1 0xf7fc5866 in drawContext (ctx=ctx@entry=0x825c240, width=640, height=480) at /home/me/Documents/Programming/mumble-gh/overlay_gl/overlay.c:551 #2 0xf7fc6972 in glXSwapBuffers (dpy=0x8069c10, draw=90177556) at /home/me/Documents/Programming/mumble-gh/overlay_gl/init_unix.c:101 #3 0xf73700e9 in ?? () from /lib/i386-linux-gnu/libSDL2-2.0.so.0 #4 0xf7354720 in ?? () from /lib/i386-linux-gnu/libSDL2-2.0.so.0 #5 0xf7a7dc99 in ?? () from bin/launcher.so #6 0xf743d2e6 in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/libtogl.so #7 0xf742e2cb in IDirect3DDevice9::Present(_RECT const*, _RECT const*, void*, RGNDATA const*) () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/libtogl.so #8 0xe9e3391d in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/shaderapidx9.so #9 0xebc06b7b in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/materialsystem.so #10 0xec580a16 in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #11 0xec4c296d in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #12 0xec57fe7b in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #13 0xec5931fb in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #14 0xec595f0c in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #15 0xec5ae320 in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #16 0xec5ae58e in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #17 0xec5ae699 in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #18 0xec69b3c3 in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #19 0xec69780c in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #20 0xec69791f in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #21 0xec708d10 in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #22 0xec69913f in ?? () from /home/me/.steam/SteamApps/common/Left 4 Dead 2/bin/engine.so #23 0xf7a7aff0 in ?? () from bin/launcher.so #24 0xf7a7aff0 in ?? () from bin/launcher.so #25 0xf7a6239d in LauncherMain () from bin/launcher.so #26 0x080484e4 in main () (gdb) frame 1 #1 0xf7fc5866 in drawContext (ctx=ctx@entry=0x825c240, width=640, height=480) at /home/me/Documents/Programming/mumble-gh/overlay_gl/overlay.c:551 551 glGetBooleanv(GL_TEXTURE_GEN_Q, &b); (gdb) p *ctx $2 = {next = 0x0, dpy = 0x8069c10, draw = 90177556, uiWidth = 0, uiHeight = 0, uiLeft = 0, uiRight = 0, uiTop = 0, uiBottom = 0, saName = {sun_family = 1, sun_path = "/run/user/1000/MumbleOverlayPipe", '\000' }, iSocket = -1, omMsg = {{headerbuffer = "", omh = {uiMagic = 0, iLength = -1, uiType = 0}}, { msgbuffer = "", oms = {a_cName = '\000' }, omi = {uiWidth = 0, uiHeight = 0}, omb = {x = 0, y = 0, w = 0, h = 0}, oma = {x = 0, y = 0, w = 0, h = 0}, omp = { pid = 0}, omf = {fps = 0}, omin = {state = 0 '\000'}}}, texture = 4294967295, a_ucTexture = 0x0, uiMappedLength = 0, bValid = 1 '\001', bMesa = 1 '\001', uiProgram = 3, timeT = 10877986, frameCount = 0, maxVertexAttribs = 16, vertexAttribStates = 0x8574b70 ""} ```
Krzmbrzl commented 4 years ago

The GAME_DEBUGGER option is part of the launch script for L4D2.

Is the game run via Proton? Or is this an actual native linux binary?

Have you tried using the mumble-overlay script to start the game? I don't actually think that it'll be much different, but you never know xD The script can be found at https://github.com/mumble-voip/mumble/blob/master/scripts/mumble-overlay

cbs228 commented 4 years ago

@Krzmbrzl, L4D2 is a Linux OpenGL port of a title that was originally DirectX for Windows.

The mumble-overlay is no help, unfortunately. I added an echo to show the command being executed.

Console output (click) ``` ERROR: ld.so: object '/home/me/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/me/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/me/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/me/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. set ERROR: ld.so: object '/home/me/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/me/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/me/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. LD_PRELOAD=/usr/lib/mumble/libmumbleoverlay.x86_64.so /usr/lib/mumble/libmumbleoverlay.x86.so :/home/me/.steam/ubuntu12_32/gameoverlayrenderer.so:/home/me/.steam/ubuntu12_64/gameoverlayrenderer.so /home/me/.steam/SteamApps/common/Left 4 Dead 2/./hl2.sh -game left4dead2 -steam ERROR: ld.so: object '/usr/lib/mumble/libmumbleoverlay.x86.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/me/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. /usr/bin/mumble-overlay: line 70: 519486 Segmentation fault (core dumped) LD_PRELOAD="${MUMBLE_PRELOAD} ${LD_PRELOAD}" "${@}" ```

The segfault now occurs immediately before anything is rendered.

It may be because Steam is also trying to preload gameoverlayrenderer.so, which I think is part of the Steam overlay. Steam appears to try and load this library even with the "Steam Overlay" option disabled. The game will start if I force LD_PRELOAD to empty. (I confirmed it's emptiness by examining /proc/$pid/environ). This means the absence of the gameoverlayrenderer.so is probably not the issue. Steam uses colons to separate LD_PRELOAD entries, while your script uses spaces. While this is probably not the issue, I don't know how ld.so handles this.

If I modify the mumble-overlay script to disregard the existing LD_PRELOAD, the same problem occurs as per the original report.

For the upcoming CMakeified mumble 1.4, we might consider generating mumble-overlay programmatically using cmake's configure_file(). If we do this, you can substitute something like ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} for the library search path. For my system. CMake's default install path for this library is something like /usr/local/lib/x86_64-linux-gnu/. This is definitely one of my /etc/ld.so.conf.d/ entries, but the mumble-overlay script won't find it there.

L4D2 may have some vulkan components, as it announces that it is running vulkan shaders prior to launch. The mumble overlay doesn't work with the vulkan demo program, vkcube from vulkan-tools. That's not a surprise… but it also doesn't crash.

Krzmbrzl commented 4 years ago

@davidebeatrici any idea?

cbs228 commented 4 years ago

This issue is still valid, but it's no longer a priority for me. I'll continue to help out with it as I can.

I was trying to get positional audio working, and I thought that the overlay was part of the equation. It is not. Instead, I was bitten by #4506… but I only found that issue after digging through the code to see how game linking actually works.