Bug 92944 - [Fiji/LLVM/RadeonSI] CS:GO segfaults in llvm
Summary: [Fiji/LLVM/RadeonSI] CS:GO segfaults in llvm
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 77449
  Show dependency treegraph
 
Reported: 2015-11-13 20:10 UTC by Ernst Sjöstrand
Modified: 2016-01-25 22:01 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
backtrace (80.60 KB, text/plain)
2015-11-13 20:10 UTC, Ernst Sjöstrand
Details
cs-go-llvm.txt (2.51 MB, text/plain)
2015-11-20 16:13 UTC, Ernst Sjöstrand
Details
cs_go console log with R600_DEBUG=vs,gs,ps with patched LLVM-git and mesa-svn (110.61 KB, text/plain)
2015-11-23 18:16 UTC, Bogar Boris
Details

Description Ernst Sjöstrand 2015-11-13 20:10:21 UTC
Created attachment 119654 [details]
backtrace

Every time CS:GO has finished loading a level and is about to draw 3D graphics it crashes with this error before any 3D graphics is displayed.
Attaching the backtrace.

Hardware:
Radeon Fury
Intel 2500k

Software:
64-bit Ubuntu 15.10
LLVM 3.8~svn252698-0~padoka0
Mesa 11.1~git151113012700.2de2e17~padoka0
Linux both 4.3.0 and agd5f/powerplay tested

Other games work fine, Borderlands, Civ 5, Shadow of Mordor, Metro: Last Light (old version).
Comment 1 Bogar Boris 2015-11-15 16:04:05 UTC
I got the same trouble on arch with mesa-git and llvm-svn. Working fine with the stable release.
Comment 2 Michel Dänzer 2015-11-19 02:34:38 UTC
Might be a duplicate of bug 92709.

If http://lists.freedesktop.org/archives/mesa-dev/2015-November/100742.html doesn't help, please run the game with the environment variable R600_DEBUG=vs,gs,ps and attach its stderr output.
Comment 3 Ernst Sjöstrand 2015-11-20 16:13:38 UTC
Created attachment 119989 [details]
cs-go-llvm.txt

Oh, haven't tried the patch yet. Here's the log with R600_DEBUG=vs,gs,ps anyway.
Comment 4 Bogar Boris 2015-11-23 18:16:09 UTC
Created attachment 120065 [details]
cs_go console log with R600_DEBUG=vs,gs,ps with patched LLVM-git and mesa-svn

Hi, i tried to recompile llvm-git and mesa-svn including both the patch that i found in  Michel Dänzer message. The attachment contain the last two mesa debug dump from the console. Honestly I don't know if you need the full log from the game start to the crash, but the full log is over 3Mb. I hope this can help, and this is the dmesg generated from the crash.

[nov23 19:01] csgo_linux[8027]: segfault at c ip 00000000f17cb7ed sp 00000000d3d56a0c error 4 in libLLVM-3.8svn.so[f11b6000+29d3000]
Comment 5 Michel Dänzer 2015-11-24 03:25:39 UTC
Doesn't look related to bug 92709. I was able to reproduce the crash with llc and the LLVM IR from the attached debugging output. Tom/Matt/Nicolai could any of you take a look?
Comment 6 Michel Dänzer 2015-11-24 03:26:55 UTC
(In reply to Bogar Boris from comment #1)
> I got the same trouble on arch with mesa-git and llvm-svn. Working fine with
> the stable release.

Can you first isolate whether the crash was introduced by a change in Mesa or LLVM, and then bisect that component?
Comment 7 Bogar Boris 2015-12-10 12:31:07 UTC
(In reply to Michel Dänzer from comment #6)
> (In reply to Bogar Boris from comment #1)
> > I got the same trouble on arch with mesa-git and llvm-svn. Working fine with
> > the stable release.
> 
> Can you first isolate whether the crash was introduced by a change in Mesa
> or LLVM, and then bisect that component?

I tried but i can't. I looked on my package manager log and i see that i discover the bug around 2015/10/09. So i tried to compiled an old revision of mesa but around that date i found that the mesa fail to configure/compile because of some new virgl driver. And the compilation fail for an huge gap of commit, so, finding out this is beyond my knowledge.
Comment 8 Ernst Sjöstrand 2015-12-10 12:50:55 UTC
With my current git snapshots of everything I can actually load a game and play one round if I set shader detail to Low, everything else can be set to max it seems.
However it crashes a bit later when loading the next round. Haven't captured the tracebacks from that yet...
Comment 9 Michel Dänzer 2015-12-11 00:56:05 UTC
(In reply to Bogar Boris from comment #7)
> So i tried to compiled an old revision of mesa but around that date i found
> that the mesa fail to configure/compile because of some new virgl driver.

Can't you just disable the virgl driver build? If that doesn't work either, please attach the failure output from configure / make.
Comment 10 Tobias Droste 2015-12-11 19:30:22 UTC
It's not a mesa change that caused this. 

I have the same problem with Hawaii. The first time I saw this I tried an older version of mesa which worked a day before and the problem was still there.

I can't say which change in llvm caused this, because I'm only building mesa on my own and receive a prebuilt llvm copy from a repository.

I can upload a backtrace as well if you want, but the segfault I see also happens in SlotIndex::getIndex().
Comment 11 Tobias Droste 2015-12-11 19:51:59 UTC
The change in LLVM happend somewhere between November 9th (known good) and yesterday (known bad).
Comment 12 Tobias Droste 2015-12-12 01:16:49 UTC
Okaaay... sorry for the noise, I don't have the _same_ problem.

My problem is not due to a change in either mesa or llvm but cs go as it seems.
I switched to a llvm r251632 (October 29th) and mesa c6b24448b578c4a8ab031923df3ef1e2d865d5bb (also October 29th) and my problems is still there.

I'm opening a new bug.
Comment 13 Ernst Sjöstrand 2016-01-25 21:52:56 UTC
Couldn't reproduce this today. Could set shaders to very high, change graphics settings on the fly (though slow), run multiple matches in a row etc...
Latest padoka-ppa + drm-next-4.6-wip kernel.
Comment 14 Nicolai Hähnle 2016-01-25 22:01:02 UTC
Indeed, the offending shaders no longer crash. Not sure which of the recent LLVM changes is responsible, let's just be happy it works :)


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.