Bug 94186

Summary: Crash when launching glxinfo and World of Warcraft with RV790
Product: Mesa Reporter: Chris Rankin <rankincj>
Component: Drivers/Gallium/r600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium CC: samuel.pitoiset
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: fix

Description Chris Rankin 2016-02-17 01:28:14 UTC
Warcraft has suddenly started to crash on launch with git Mesa on my RV790. Bisection has identified this commit:

61ed09c7ea41e559219c772f18ea00942d54d30a is the first bad commit
commit 61ed09c7ea41e559219c772f18ea00942d54d30a
Author: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Date:   Mon Jan 4 23:56:08 2016 +0100

    gallium/cso: add support for compute shaders

    Changes from v2:
     - removed cso_{save,restore}_compute_shader() functions and the
       compute_shader_saved variable because disabling compute shaders for
       meta ops is not currently needed

However, I'm not sure I trust bisection here because I have built Mesa from this revision *twice* and while WoW always crashes with one build, it never crashes with the other?!

WoW's crash dump only implies that Mesa is trying to read from a null pointer; I can find no useful stack trace.
Comment 1 Chris Rankin 2016-02-17 01:53:57 UTC
For reference, I shall assume that this is the first "good" commit:

OpenGL core profile version string: 3.3 Mesa 11.2.0-devel (git-fe14110)

These commits have definitely crashed for me at some point:
git-04085af
git-7410c60
git-61ed09c
git-e2a1ec5
git-4360ba0
Comment 2 Samuel Pitoiset 2016-02-17 09:07:38 UTC
Hi,

Thanks for the report, I'll have a look later today.

Are you sure you can't make an useful backtrace?
Comment 3 Chris Rankin 2016-02-17 10:49:29 UTC
Hi, WoW isn't creating a backtrace, but I've now noticed that glxinfo is core-dumping for me too! So perhaps this will help?

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff236764f in cso_destroy_context (ctx=0x5555558d3960)
    at cso_cache/cso_context.c:343
#2  0x00007ffff2238747 in st_destroy_context_priv (st=0x5555558bbed0)
    at state_tracker/st_context.c:185
#3  0x00007ffff22388f2 in st_destroy_context (st=0x5555558bbed0)
    at state_tracker/st_context.c:460
#4  0x00007ffff233bb8d in dri_destroy_context (cPriv=<optimized out>)
    at dri_context.c:188
#5  0x00007ffff233ad73 in driDestroyContext (pcp=0x55555583aa00)
    at dri_util.c:479
#6  0x00007ffff7bb1b4f in dri2_destroy_context (context=0x555555779540)
    at dri2_glx.c:129
#7  0x00007ffff7b90279 in MakeContextCurrent (dpy=0x555555760010, 
    draw=25165835, read=25165835, gc_user=0x5555558c3c80) at glxcurrent.c:250
#8  0x0000555555558c03 in print_screen_info ()
#9  0x0000555555556f88 in main ()
Comment 4 Samuel Pitoiset 2016-02-17 16:32:31 UTC
Created attachment 121819 [details]
fix

Could you please give a shot at the attached patch and tell me if it fixes the issue?
Comment 5 Chris Rankin 2016-02-17 22:58:01 UTC
(In reply to Samuel Pitoiset from comment #4)
> Could you please give a shot at the attached patch and tell me if it fixes
> the issue?

Yes, that patch fixes both WoW and glxinfo. Thanks.
Comment 6 Samuel Pitoiset 2016-02-17 23:22:25 UTC
Cool, thanks.

I have sent the fix on mesa-dev. It should be upstream soon.
Comment 7 Samuel Pitoiset 2016-02-18 19:43:05 UTC
Fixed.

commit dfc95ad6d129436a3d2383152583919fb2dde261
Author: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Date:   Thu Feb 18 00:18:29 2016 +0100

    gallium/cso: only enable compute shaders when TGSI is supported
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94186
    Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
    Reviewed-by: Marek Olšák <marek.olsak@amd.com>

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.