[Mesa-dev] [RFC PATCH 1/1] st/dri: add a new driconf option override_glsl_version for ARK games

Eero Tamminen eero.t.tamminen at intel.com
Wed Feb 8 13:23:07 UTC 2017


On 07.02.2017 15:29, Gustaw Smolarczyk wrote:
> 2017-02-07 14:11 GMT+01:00 Eero Tamminen <eero.t.tamminen at intel.com>:
>> Thanks, setting breakpoint on SDL_ShowMessageBox() I can catch where it
>> shows the dialog, but it appears to link SDL statically and not have debug
>> symbols so that I could directly get the message.
>> Unfortunately my gdb/assembly-foo is too weak to parse UTF-16 strings
>> through pointers in stack (or is register passing using on Intel for subset
>> of args?)...
> On x86-64 [1], the first argument should be in rdi register. If SDL2
> is used, it will point to SDL_MessageBoxData structure [2] which
> should have the message pointer at offset 24.
> [1] https://en.wikipedia.org/wiki/X86_calling_conventions#System_V_AMD64_ABI
> [2] https://wiki.libsdl.org/SDL_MessageBoxData


In case somebody else needs to debug something similar, log is at bottom 

While the updated patch doesn't get ARK running on Intel, just 
overriding the Mesa GLSL version [1] from command line actually does 
(e.g. with 320).

After that, the game main menu loads fine, but during actual single 
player game loading, it still crashes, like with Mesa 11.2.

"diagnostics.txt" file under 
ShooterGame/Binaries/Linux/crashinfo-*/diagnostics.txt tells following:
Exception was "SIGSEGV: invalid attempt to access memory at address 
Invalid BufferCount=0 while reading 
Pos=1886238581, Size=186863, PrecacheSize=2147483647, 

Above was with "ARK: Survival Evolved".  I took also a look at the 
free-to-play "ARK: Survival of the Fittest", but as it didn't have 
single player mode, I wasn't able to test it except to lobby.

Btw It's fairly educating to check what files the game is accessing:
	strace -f -e open -p $(pidof ShooterGame)

(Is it expecting CPU topology to change multiple times each frame?)

	- Eero


(gdb) disassemble
Dump of assembler code for function SDL_ShowMessageBox:
    0x0000000002998545 <+0>:	push   %rbp
    0x0000000002998546 <+1>:	mov    %rsp,%rbp
=> 0x0000000002998549 <+4>:	sub    $0x10,%rsp
    0x000000000299854d <+8>:	mov    %rdi,-0x8(%rbp)
    0x0000000002998551 <+12>:	mov    %rsi,-0x10(%rbp)
    0x0000000002998555 <+16>:	mov    0x1b53094(%rip),%rcx
    0x000000000299855c <+23>:	mov    -0x10(%rbp),%rdx
    0x0000000002998560 <+27>:	mov    -0x8(%rbp),%rax
    0x0000000002998564 <+31>:	mov    %rdx,%rsi
    0x0000000002998567 <+34>:	mov    %rax,%rdi
    0x000000000299856a <+37>:	callq  *%rcx
    0x000000000299856c <+39>:	leaveq
    0x000000000299856d <+40>:	retq

(gdb) x/4xg $rdi
0x7fffffffdbb8:	0x0000000000000040	0x0000000000000000
0x7fffffffdbc8:	0x00007fffffffdb20	0x0000000008318f00

<messagebox title>
(gdb) print (char *) 0x00007fffffffdb20
$8 = 0x7fffffffdb20 "Message"
-> Yes this is the dialog title

<messagebox text>
(gdb) print (char *) 0x0000000008318f00
$9 = 0x8318f00 "\200\220\061\b"
-> Looks garbage

<try UTF-16>
(gdb) dump memory message.utf16 0x0000000008318f00 (0x0000000008318f00+256)
[1]+  Stopped
$ iconv -f UTF-16 -t UTF-8 < message.utf16
<chinese looking characters>
$ less message.utf16
<80><90>^@^@^@^@^A^@^@^@hader cache file '/opt/steamapps/common/ARK 
SOTF/Engine/GlobalShaderCache-GLSL_430.bin' is missing.

You're running a version of the application built to load COOKED content 
only, however no COOKED content was found. Consider cooking content for 
this build, or build and run the UNCOOKED version of the application 
$ touch '/opt/steamapps/common/ARK 

And then running the game again:
Assertion failed: Tag == ReferenceTag 
[Line: 251]
Global shader map binary file is missing GSMB tag.

Thread 1 "ShooterGame" received signal SIGSEGV, Segmentation fault.
0x0000000000f09abb in _start ()

-> GLSL version causes issue also on Intel.

More information about the mesa-dev mailing list