Bug 92557

Summary: [3D Games] [HSW/SKL/BXT] Euro Truck simulator 2 stops unexpectedly when the game is loading
Product: Mesa Reporter: Humberto Israel Perez Rodriguez <humberto.i.perez.rodriguez>
Component: Drivers/DRI/i965Assignee: Ian Romanick <idr>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: danylo.piliaiev, eero.t.tamminen, intel-gfx-bugs
Version: 11.0   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: HSW i915 features:
Bug Depends on:    
Bug Blocks: 77449, 93185    
Attachments: dmesg
Xorg
SKL-dmesg.log

Description Humberto Israel Perez Rodriguez 2015-10-20 16:46:55 UTC
Created attachment 119014 [details]
dmesg

Kernel <4.3.0-rc5-drm-intel-nightly>


==Bug detailed description==
--------------------------------------------------
Euro Truck simulator 2 stops before starts the game

==Attachments==
--------------------------------------------------
dmesg
Xorg

==Steps to reproduce==
--------------------------------------------------
1- Install Euro Truck Simulator 2 from Steam
2- Open Euro Truck Simulator 2 and create one profile in order to start the game
3- After that the profile has been created the game looks like that starts but instead the game stops unexpectedly

==Actual results==
--------------------------------------------------
Euro Truck Simulator 2 stops when the game is loading

==Expected results==
--------------------------------------------------
Euro Truck Simulator 2 must be run without any issues


==Hardware configuration==
--------------------------------------------------

-- Platform: --
Processor: Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
Motherboard : D54250WYK
Memory : 8GB

-- Software --
Linux distribution: Ubuntu 14.04.03 LTS 64Bits
BIOS: 4.6


==Test Environment==
--------------------------------------------------
kernel: 4.3.0-rc5-drm-intel-nightly
xorg-server-1.17.2
libdrm-2.4.65
xf86-video-intel-2.99.917
mesa-11.1.0-devel (git 6f39546)
libva-1.6.1
intel-driver-1.6.1
cairo-1.14.2

Additional information :
​dmesg output (option "drm.debug=0x06")
Comment 1 Humberto Israel Perez Rodriguez 2015-10-20 16:47:44 UTC
Created attachment 119015 [details]
Xorg
Comment 2 Eero Tamminen 2015-12-01 08:16:24 UTC
I don't think the problem is with kernel or X for which you attached logs.  Please give the output from the game itself too.
Comment 3 Ian Romanick 2015-12-01 23:45:20 UTC
Unfortunately none of the information provided is particularly useful.  Please see http://www.paranormal-entertainment.com/idr/blog/ (esp. the script at the bottom) for the kind of information that we need.
Comment 4 Ian Romanick 2015-12-01 23:54:37 UTC
(In reply to Ian Romanick from comment #3)
> Please see http://www.paranormal-entertainment.com/idr/blog/ (esp. the
> script at the bottom) for the kind of information that we need.

That should have been http://www.paranormal-entertainment.com/idr/blog/posts/2015-10-14T16:18:47Z-Good_bug_reports/
Comment 5 Humberto Israel Perez Rodriguez 2015-12-03 18:32:21 UTC
The issue still present on SKL-Y with the following configuration :


Software versions:
    4.3.0-mainline+
    OpenGL version string: 3.0 Mesa 11.0.4 (git-31bf247)

GPU hardware:
    OpenGL renderer string: Mesa DRI Intel(R) Skylake ULX GT2 
    00:02.0 VGA compatible controller [0300]: Intel Corporation Sky Lake Integrated Graphics [8086:191e] (rev 07)

CPU hardware:
    x86_64
    Intel(R) Core(TM) m5-6Y57 CPU @ 1.10GHz

Attached SKL-dmesg.log
Comment 6 Humberto Israel Perez Rodriguez 2015-12-03 18:33:03 UTC
Created attachment 120314 [details]
SKL-dmesg.log
Comment 7 Kenneth Graunke 2015-12-03 19:37:50 UTC
Works for me on Broadwell.
Comment 8 Ian Romanick 2015-12-03 20:34:12 UTC
(In reply to Humberto Israel Perez Rodriguez from comment #5)
> The issue still present on SKL-Y with the following configuration :
> 
> Software versions:
>     4.3.0-mainline+
>     OpenGL version string: 3.0 Mesa 11.0.4 (git-31bf247)

Does the problem occur with 11.0.6 or master?

Is it possible to run the game inside GDB?  If the game crashes while running in GDB, can you provide a backtrace?
Comment 9 Humberto Israel Perez Rodriguez 2015-12-03 21:01:22 UTC
(In reply to Ian Romanick from comment #8)
> (In reply to Humberto Israel Perez Rodriguez from comment #5)
> > The issue still present on SKL-Y with the following configuration :
> > 
> > Software versions:
> >     4.3.0-mainline+
> >     OpenGL version string: 3.0 Mesa 11.0.4 (git-31bf247)
> 
> Does the problem occur with 11.0.6 or master?
> 
> Is it possible to run the game inside GDB?  If the game crashes while
> running in GDB, can you provide a backtrace?

This problem occur with Mesa 11.04.04, i did not try so far with Mesa 11.0.6.
Sorry but i dont know what's GDB :(
Comment 10 Eero Tamminen 2015-12-08 09:37:12 UTC
Dmesg and X log aren't useful.

Please run steam from terminal, then start the game and attach the output from the game here (you may need to increase in your terminal's settings how much output it buffers, to catch all output).
Comment 11 Eero Tamminen 2016-09-26 16:07:22 UTC
I'm able to reproduce crash with Ubuntu 16.04 on SKL.  Game crashes to memory corruption:
- With Mesa 11.2 on Ubuntu 16.04 it crashes to SIGBUS in memcpy AVX version
- With Mesa git it crashes to Glibc assert that says "free(): corrupted unsorted chunks".

Moving Steam's (Ubuntu 12.04) libstdc++ away so that system one is used didn't help.  Neither did disabling all game MODs (Rocket League one was installed automatically).

Because issue is memory corruption, any debugger backtraces are likely to be completely useless, corruption has happened already earlier.  It needs a memory debugger.

When I run the game under Valgrind, I get few warnings of code in the game itself without any good backtraces, for:
- Use of uninitialised value of size 8
- Conditional jump or move depends on uninitialised value(s)

There were no warnings for Mesa.  Game doesn't crash with Valgrind though, instead it freezes with 100% CPU usage in about same place at startup where it crashed without Valgrind.

Game works most times when starting it in safe mode, but not always.  Changing from safe mode to medium quality and full resolution almost always works without crash.  Changing to high quality always crashes.  I.e. the corruption bug is also somewhat random, which would indicate that it could be timing related (e.g. missing locking in game).

This game has worked for me earlier (maybe year back) on HSW & BDW, but I've never before tested it on SKL.  It may have been updated in the meanwhile (in addition to updates for Mesa, distro & Steam).
Comment 12 Eero Tamminen 2016-09-28 16:19:22 UTC
With today's Git version of Mesa, game also SIGBUSes in AVX memcpy(), like with v11.2 Mesa.

(gdb) info threads
  Id   Target Id         Frame 
* 1    Thread 0x7ffff7fbe740 (LWP 26461) "eurotrucks2" __memcpy_avx_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:238
  2    Thread 0x7fffe778c700 (LWP 26465) "Worker_0" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cd080)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  3    Thread 0x7fffe768b700 (LWP 26466) "Worker_1" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cd080)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  4    Thread 0x7fffe758a700 (LWP 26467) "Worker_2" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cd080)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  5    Thread 0x7fffe7489700 (LWP 26468) "IO_Worker_0" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cd0c0)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  6    Thread 0x7fffe7388700 (LWP 26469) "IO_Worker_1" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cd0c0)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  7    Thread 0x7fffe7287700 (LWP 26470) "IO_Worker_2" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cd0c0)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  8    Thread 0x7fffe7186700 (LWP 26471) "RT_Worker_0" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cd100)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  9    Thread 0x7fffe7085700 (LWP 26472) "RT_Worker_1" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cd100)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  10   Thread 0x7fffe6f84700 (LWP 26473) "RT_Worker_2" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cd100)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  11   Thread 0x7fffab96b700 (LWP 26474) "online_worker" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18cce00)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  13   Thread 0x7fffa758e700 (LWP 26477) "threaded-ml" 0x00007ffff6a48e8d in poll () at ../sysdeps/unix/syscall-template.S:84
  14   Thread 0x7fffa6d8d700 (LWP 26478) "eurotrucks2" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:143
  15   Thread 0x7fffa658c700 (LWP 26479) "sound_daemon" 0x00000000011c6a5b in ?? ()
  17   Thread 0x7fffa5eea700 (LWP 26483) "sector_manager" 0x00007ffff7994867 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x18e6400)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205

poll() & pthread_cond_wait() threads are from pulseaudio library, for rest I assume them to be directly from the game itself because Gdb couldn't show caller info for them.

Building Mesa with "--enable-debug" doesn't provide any additional info.
Comment 13 Eero Tamminen 2017-02-06 14:27:07 UTC
Still crashes to the AVX memcpy SIGBUS, both with Mesa 11.2 and today's git (on up to date Ubuntu 16.04).

Easiest way to reproduce the crash is by switching between "high" and "ultra" graphics options and resume the game.  Sometimes game crashes when doing the switch, but if not, it will crash at least after clicking "Drive" button to resume the game.

There's pulseaudio thread, something doing nanosleep, lot of semaphore wait threads and the crashing thread:
----------------------------------
Thread 1 "eurotrucks2" received signal SIGBUS, Bus error.
__memcpy_avx_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:204
204	../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S: No such file or directory.
(gdb) bt
#0  __memcpy_avx_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:204
#1  0x0000000000930c6b in ?? ()
#2  0x00000000009e43b5 in ?? ()
#3  0x00000000009ffb8c in ?? ()
#4  0x0000000000d5f8ad in ?? ()
#5  0x0000000000d5fc20 in ?? ()
#6  0x0000000000d60328 in ?? ()
#7  0x0000000000b2b552 in ?? ()
#8  0x0000000000623bc3 in ?? ()
#9  0x000000000063c829 in ?? ()
#10 0x0000000000578978 in ?? ()
#11 0x00000000008898dc in ?? ()
#12 0x000000000087cd8a in ?? ()
#13 0x0000000000418292 in ?? ()
#14 0x00007f6fb3db6830 in __libc_start_main (main=0x4181d0, argc=1, argv=0x7ffffa12b768, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffffa12b758) at ../csu/libc-start.c:291
----------------------------------

As none of the threads has anything going through Mesa, this looks more like problem in the game itself,
Comment 14 Danylo 2018-08-07 10:13:39 UTC
Tested Euro Truck Simulator 2 with newer setup and had no issues so far:

Ubuntu 18.04
Intel Core i5-6440HQ (Intel HD Graphics 530) - Skylake
Mesa 18.1.3, 18.3.0-devel
X.Org 1.19.6
Kernel: 4.17.0

Game can be launched and played with any quality settings.
Comment 15 Denis 2018-08-08 08:16:12 UTC
Hello. According to last Eero's comment - there are 2 things changed:
1. Provided steps look the same with this ticket https://bugs.freedesktop.org/show_bug.cgi?id=102316 - Danylo tested them both.
2. Even if the bug was in the game, it was fixed since that time. I also played a bit on it and couldn't reproduce it. So this one also can be closed.

And the last thing - it would be great if somebody who has BDW cpu - test the last issue with this game https://bugs.freedesktop.org/show_bug.cgi?id=97865
I think it is also not actual, but need to confirm this. Unfortunately I don't have BDW cpu.

The game has free demo on Steam.

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.