Bug 62573 - [bisected] Half-Life 2: Deathmatch native version crashes
Summary: [bisected] Half-Life 2: Deathmatch native version crashes
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r600 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium critical
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-03-20 19:55 UTC by Benjamin
Modified: 2013-03-27 16:42 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg (80.37 KB, text/plain)
2013-03-20 20:04 UTC, Benjamin
Details
Xorg.0.log (72.50 KB, text/plain)
2013-03-20 20:06 UTC, Benjamin
Details
gdb output (25.92 KB, text/plain)
2013-03-21 23:05 UTC, Benjamin
Details
possible fix (812 bytes, patch)
2013-03-21 23:33 UTC, Marek Olšák
Details | Splinter Review

Description Benjamin 2013-03-20 19:55:15 UTC
As the title says, the native version of HL2:DM crashes on joining or creating a server (when it loads a map I think). This does not happen under Wine nor TF2. On the github page ValveSoftware/Source-1-Games I was told that the problem lies in libgallium.

glxinfo reports the renderer as "Gallium 0.4 on AMD PALM", the version as "3.0 Mesa 9.2-devel", and the shading language version as "1.30" on my machine.

Would it help to post more output from glxinfo?
Comment 1 Alex Deucher 2013-03-20 19:58:47 UTC
Please attach your xorg log and dmesg output.  Also is this a 32-bit game running on a 64-bit distro?  What do you mean by crash?  segfault?  system hangs?  If it's a segfault or something like that can you get a backtrace with gdb?
Comment 2 Benjamin 2013-03-20 20:04:44 UTC
Created attachment 76842 [details]
dmesg
Comment 3 Benjamin 2013-03-20 20:06:46 UTC
Created attachment 76843 [details]
Xorg.0.log
Comment 4 Benjamin 2013-03-20 20:08:37 UTC
Yeah, it's segfaulting. It is 32-bit running on 64-bit Ubuntu, but I do have multiarch support (and TF2 works fine, which is nearly the same engine and also 32-bit).
Comment 5 Benjamin 2013-03-20 20:23:05 UTC
If I am debugging it with gdb, it won't go past the loading screen for the main menu. The last thing gdb says is "0xf776e425 in __kernel_vsyscall ()
". I don't know what that means.
Comment 6 Michel Dänzer 2013-03-21 06:59:46 UTC
Is the libgl1-mesa-dri:i386 package installed on your system?

(In reply to comment #5)
> If I am debugging it with gdb, it won't go past the loading screen for the
> main menu. The last thing gdb says is "0xf776e425 in __kernel_vsyscall ()".

That's too little information. If you don't know which output from gdb is relevant, please just attach all of it.
Comment 7 Benjamin 2013-03-21 12:37:42 UTC
That package is installed. I should have been more clearer, that was the only thing it outputted besides it informing me that it's loading debugging symbols. 

Oops.... I made a mistake when using gdb. I'll post the corrected information shortly.
Comment 8 Andreas Boll 2013-03-21 22:50:17 UTC
I can reproduce this bug on rv770.
It works fine on mesa 9.0.3 and 9.1.1

I've bisected to this commit:

ea63491629f48099371f725e7c3779f2982d7a52 is the first bad commit
commit ea63491629f48099371f725e7c3779f2982d7a52
Author: Marek Olšák <maraeo@gmail.com>
Date:   Thu Feb 7 04:36:33 2013 +0100

    st/mesa: accelerate glGetTexImage for all formats using a blit
    
    This commit allows using glGetTexImage during rendering and still
    maintain interactive framerates.
    
    This improves performance of WarCraft 3 under Wine. The framerate is improved
    from 25 fps to 39 fps in the main menu, and from 0.5 fps to 32 fps in the game.
    
    v2: fix choosing the format for decompression
Comment 9 Andreas Boll 2013-03-21 22:52:06 UTC
(gdb) bt full
#0  0xb48d8ebb in st_GetTexImage (ctx=0x80e44e0, format=32992, type=5121, 
    pixels=0x17d59208, texImage=0x17d58e50)
    at ../../src/mesa/state_tracker/st_cb_texture.c:662
        st = 0x80f2908
        pipe = 0x815c578
        screen = 0x80a9878
        width = 64
        height = 2
        depth = 1
        src = 0x0
        dst = 0x0
        dst_templ = {reference = {count = 2}, 
          screen = 0xb482b04c <_mesa_image_offset+124>, target = 32992, format = 5121, 
          width0 = 3221208592, height0 = 3086507199, depth0 = 3221208592, 
          array_size = 2904027824, last_level = 60, nr_samples = 191, usage = 255, 
          bind = 64, flags = 3}
        dst_format = <optimized out>
        src_format = 3086455916
        mesa_format = <optimized out>
        gl_target = 3553
        pipe_target = <optimized out>
        blit = {dst = {resource = 0x0, level = 0, box = {x = 0, y = -1261735936, 
              z = 268719712, width = 149, height = -1261735936, depth = 0}, 
            format = 2147483647}, src = {resource = 0x0, level = 3028636484, box = {x = 2, 
              y = 135176152, z = 64, width = -1208460097, height = 32992, depth = 5121}, 
            format = PIPE_FORMAT_NONE}, mask = 1, filter = 64, 
          scissor_enable = 224 '\340', scissor = {minx = 28672, miny = 46283, 
            maxx = 34124, maxy = 46215}}
        bind = 1024
        tex_xfer = <optimized out>
        map = 0x0
        done = 0 '\000'
#1  0xb4876d15 in _mesa_GetnTexImageARB (target=target@entry=3553, level=level@entry=0, 
    format=format@entry=32992, type=type@entry=5121, bufSize=bufSize@entry=2147483647, 
    pixels=pixels@entry=0x17d59208) at ../../src/mesa/main/texgetimage.c:928
        texObj = <optimized out>
        texImage = 0x17d58e50
        ctx = 0x80e44e0
#2  0xb4876df7 in _mesa_GetTexImage (target=3553, level=0, format=32992, type=5121, 
    pixels=0x17d59208) at ../../src/mesa/main/texgetimage.c:938
No locals.
#3  0xb73fa65a in ?? ()
   from /home/aboll/.local/share/Steam/SteamApps/common/Half-Life 2 Deathmatch/bin/libtogl.so
No symbol table info available.

.....
Comment 10 Benjamin 2013-03-21 23:05:16 UTC
Created attachment 76882 [details]
gdb output

The interesting stuff is near the bottom. It segfaults on st_GetTexImage in st_cb_texture.c on line 895, which makes considering Andreas' post about Warcraft III in Wine.
Comment 11 Benjamin 2013-03-21 23:07:59 UTC
*makes sense, I meant to say makes sense.

It's interesting that it's segfaulting in different places for each of us.
Comment 12 Marek Olšák 2013-03-21 23:33:11 UTC
Created attachment 76887 [details] [review]
possible fix

(In reply to comment #10)
> Created attachment 76882 [details]
> gdb output
> 
> The interesting stuff is near the bottom. It segfaults on st_GetTexImage in
> st_cb_texture.c on line 895, which makes considering Andreas' post about
> Warcraft III in Wine.

Could you please try this patch?
Comment 13 Benjamin 2013-03-21 23:40:18 UTC
Comment on attachment 76887 [details] [review]
possible fix

Which package is this? Is it libgl1-mesa-dri?
Comment 14 Marek Olšák 2013-03-21 23:42:17 UTC
It's a git patch for Mesa, applicable using "git am -3". Of course it's the DRI driver.
Comment 15 Benjamin 2013-03-21 23:43:54 UTC
Since I'm using xorg-edgers, do I need to check out from git or can I just use apt-get source?
Comment 16 Marek Olšák 2013-03-22 00:10:31 UTC
Sorry I don't really know what needs to be done if you have xorg-edgers. The patch is supposed to be applied using the git command, so you basically need the whole Mesa git repository.
Comment 17 Benjamin 2013-03-22 01:14:52 UTC
I checked out from git and applied the patch, BUT autogen.sh exits with code 1, configure has a syntax error, and make says there is nothing to do.
Comment 18 Michel Dänzer 2013-03-22 06:51:26 UTC
Please attach the output from autogen.sh / configure. There's no point running make until those have succeeded.
Comment 19 Andreas Boll 2013-03-22 08:23:03 UTC
Thanks Marek, your patch fixes the segfault.
Feel free to add my Tested-by on the patch.
Comment 20 Tom 2013-03-22 17:06:46 UTC
It fixes this issue for me too, thanks.
Comment 21 Benjamin 2013-03-23 21:23:20 UTC
The patch works for me.
Comment 22 Tom 2013-03-23 23:37:47 UTC
Marek, your the latest commits in master mesa git repo don't solve this problem.
Comment 23 Andreas Boll 2013-03-27 16:42:50 UTC
Fixed by commit 17003b44b76f2442a8bd795c8a314146facef3e5


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.