Bug 93577 - Total war: Attila crashes at startup
Summary: Total war: Attila crashes at startup
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 11.0
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-04 14:59 UTC by Médéric Boquien
Modified: 2016-01-08 14:41 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
apitrace trace (746.09 KB, text/plain)
2016-01-04 14:59 UTC, Médéric Boquien
Details

Description Médéric Boquien 2016-01-04 14:59:54 UTC
Created attachment 120792 [details]
apitrace trace

Hello,

Total war: Attila crashes at startup with the Intel and R600 (AMD JUNIPER, DRM 2.43.0, LLVM 3.7.0) drivers. When run in gdb, I get the following backtrace:

Thread 14 (Thread 0x7fffbeffb700 (LWP 4213)):
#0  0x00007ffff69392d7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007ffff6939384 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x00007ffff543d76e in ?? () from /usr/lib/libSDL2-2.0.so.0
#3  0x0000000002848222 in CA::Semaphore::acquire_one (this=<optimized out>) at ../CALibs/include/POSIX/CAThread.inl:28
#4  MP_LIB::SERVICE_CONNECTION_CURL<unsigned long>::start_monitor (this=0x10e93f80) at Source/mp_lib/ca_libs/service_connection_curl.cpp:350
#5  0x00000000028815e6 in MP_LIB::SERVICE_CONNECTION_CURL<unsigned long>::cstyle_start_monitor (data=0x110d8f90) at Source/mp_lib/ca_libs/service_connection_curl.h:150
#6  0x00000000004e473d in CA::run_fun_in_native_thread (lpThreadParameter=0x7fffffffe140) at /TW/branches/attila/charlemagne/common/CALibs/src/POSIX/CAThread.cpp:294
#7  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#8  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 13 (Thread 0x7fffbf7fc700 (LWP 4212)):
#0  0x00007ffff433b91d in nanosleep () from /usr/lib/libc.so.6
#1  0x00007ffff43655e4 in usleep () from /usr/lib/libc.so.6
#2  0x0000000002842047 in CA::ThreadPlatform::sleep_current_thread (ms=<optimized out>, ms=<optimized out>) at ../CALibs/include/POSIX/CAThreadPlatform.h:28
#3  CA::sleep_current_thread (ms=<optimized out>, ms=<optimized out>) at ../CALibs/include/POSIX/CAThread.inl:20
#4  CA_NETWORK::steam_updater_thread_function (data=0x5160ae8 <CA_NETWORK::STEAMWORKS_UPDATER::steamwork_updater_singleton()::steamworks_updater+4840>)
    at Source/mp_lib/ca_libs/steam_updater.cpp:134
#5  0x00000000004e473d in CA::run_fun_in_native_thread (lpThreadParameter=0x7fffffffe490) at /TW/branches/attila/charlemagne/common/CALibs/src/POSIX/CAThread.cpp:294
#6  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#7  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 12 (Thread 0x7ffff7e0b700 (LWP 4205)):
#0  0x00007ffff69392d7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007ffff6939384 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x00000000036ebea9 in AKPLATFORM::AkWaitForEvent (in_event=...) at ../../../../include/AK/Tools/POSIX/AkPlatformFuncs.h:117
#3  CAkAudioThread::EventMgrThreadFunc (lpParameter=0x7fffd52a20d0) at ../POSIX/AkAudioThread.cpp:61
#4  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 11 (Thread 0x7fffbfffd700 (LWP 4204)):
#0  0x00007ffff4363251 in ppoll () from /usr/lib/libc.so.6
#1  0x00007ffff37bf61d in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#2  0x00007ffff37bfc0e in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#3  0x00007ffff542a0a7 in ?? () from /usr/lib/libSDL2-2.0.so.0
#4  0x00007ffff538e38f in ?? () from /usr/lib/libSDL2-2.0.so.0
#5  0x00007ffff53f082c in ?? () from /usr/lib/libSDL2-2.0.so.0
#6  0x00007ffff543d439 in ?? () from /usr/lib/libSDL2-2.0.so.0
#7  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#8  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 10 (Thread 0x7fffe09e7700 (LWP 4203)):
#0  0x00007ffff4363251 in ppoll () from /usr/lib/libc.so.6
#1  0x00007ffff37bf61d in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#2  0x00007ffff37bfc0e in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#3  0x00007ffff37bfcc0 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#4  0x00007ffff542a19f in ?? () from /usr/lib/libSDL2-2.0.so.0
#5  0x00007ffff53f082c in ?? () from /usr/lib/libSDL2-2.0.so.0
#6  0x00007ffff543d439 in ?? () from /usr/lib/libSDL2-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#7  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#8  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 9 (Thread 0x7ffff7e13700 (LWP 4198)):
#0  0x00007ffff69392d7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007ffff6939384 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x000000000370c6d7 in AKPLATFORM::AkWaitForEvent (in_event=...) at ../../../../include/AK/Tools/POSIX/AkPlatformFuncs.h:117
#3  CAkThreadedBankMgr::BankThreadFunc (lpParameter=0x7fffd529c828) at ../Common/AkThreadedBankMgr.cpp:136
#4  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 8 (Thread 0x7ffff7e1d700 (LWP 4197)):
#0  0x00007ffff693707f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x0000000003736e46 in AK::StreamMgr::CAkIOThread::IOSchedThread (lpParameter=0xd5071e0) at ../POSIX/AkIOThread.cpp:220
#2  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#3  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 7 (Thread 0x7fffe30a6700 (LWP 4105)):
#0  0x00007ffff69392d7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007ffff6939384 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x00007ffff543d76e in ?? () from /usr/lib/libSDL2-2.0.so.0
#3  0x0000000002dff18d in CA::Semaphore::acquire_one (this=<optimized out>) at ../CALibs/include/POSIX/CAThread.inl:28
#4  CA_STD::MESSAGE_LIST<std::shared_ptr<VFS_IMPL::ALLOCATION>, CA_STD::ALLOCATOR<std::shared_ptr<VFS_IMPL::ALLOCATION> > >::pop (this=0x7fffdc0008d8)
    at ../UtilityLib/Redist/CAStdList.h:2029
#5  0x0000000002dd285d in VFS_IMPL::io_thread_inner () at Source/OfflineData/VFSAsyncFileIOThread.cpp:344
#6  0x0000000002dd2ca6 in VFS_IMPL::io_thread () at Source/OfflineData/VFSAsyncFileIOThread.cpp:361
#7  0x00000000004e473d in CA::run_fun_in_native_thread (lpThreadParameter=0x7fffffffe490) at /TW/branches/attila/charlemagne/common/CALibs/src/POSIX/CAThread.cpp:294
#8  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#9  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 6 (Thread 0x7fffe38a7700 (LWP 4104)):
#0  0x00007ffff69392d7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007ffff6939384 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x00007ffff543d76e in ?? () from /usr/lib/libSDL2-2.0.so.0

#3  0x0000000003061da0 in CA::Semaphore::acquire_one (this=<optimized out>) at ../CALibs/include/POSIX/CAThread.inl:28
#4  tbb::JobState::wait_for_tasks (this=<optimized out>) at Source/TBB.cpp:79
#5  tbb::NativeTaskThread::wait_for_tasks (this=<optimized out>, this=<optimized out>) at Source/TBB.cpp:583
#6  tbb::NativeTaskThread::run_loop (this=0x5692350) at Source/TBB.cpp:542
#7  0x0000000003061d57 in tbb::NativeTaskThread::tbb_thread_func (this_pointer=0x5692350) at Source/TBB.cpp:469
#8  0x00000000004e473d in CA::run_fun_in_native_thread (lpThreadParameter=0x7fffffffe3c0) at /TW/branches/attila/charlemagne/common/CALibs/src/POSIX/CAThread.cpp:294
#9  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#10 0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 5 (Thread 0x7fffe40a8700 (LWP 4103)):
#0  0x00007ffff69392d7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007ffff6939384 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x00007ffff543d76e in ?? () from /usr/lib/libSDL2-2.0.so.0
#3  0x0000000003061da0 in CA::Semaphore::acquire_one (this=<optimized out>) at ../CALibs/include/POSIX/CAThread.inl:28
#4  tbb::JobState::wait_for_tasks (this=<optimized out>) at Source/TBB.cpp:79
#5  tbb::NativeTaskThread::wait_for_tasks (this=<optimized out>, this=<optimized out>) at Source/TBB.cpp:583
---Type <return> to continue, or q <return> to quit---
#6  tbb::NativeTaskThread::run_loop (this=0x57094e0) at Source/TBB.cpp:542
#7  0x0000000003061d57 in tbb::NativeTaskThread::tbb_thread_func (this_pointer=0x57094e0) at Source/TBB.cpp:469
#8  0x00000000004e473d in CA::run_fun_in_native_thread (lpThreadParameter=0x7fffffffe3c0) at /TW/branches/attila/charlemagne/common/CALibs/src/POSIX/CAThread.cpp:294
#9  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#10 0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7fffe48a9700 (LWP 4102)):
#0  0x00007ffff69392d7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007ffff6939384 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x00007ffff543d76e in ?? () from /usr/lib/libSDL2-2.0.so.0
#3  0x0000000003061da0 in CA::Semaphore::acquire_one (this=<optimized out>) at ../CALibs/include/POSIX/CAThread.inl:28
#4  tbb::JobState::wait_for_tasks (this=<optimized out>) at Source/TBB.cpp:79
#5  tbb::NativeTaskThread::wait_for_tasks (this=<optimized out>, this=<optimized out>) at Source/TBB.cpp:583
#6  tbb::NativeTaskThread::run_loop (this=0x5648c40) at Source/TBB.cpp:542
#7  0x0000000003061d57 in tbb::NativeTaskThread::tbb_thread_func (this_pointer=0x5648c40) at Source/TBB.cpp:469
#8  0x00000000004e473d in CA::run_fun_in_native_thread (lpThreadParameter=0x7fffffffe3c0) at /TW/branches/attila/charlemagne/common/CALibs/src/POSIX/CAThread.cpp:294
#9  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#10 0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 3 (Thread 0x7fffe52af700 (LWP 4095)):
#0  0x00007ffff693707f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007fffe8d21c93 in ?? () from /usr/lib/xorg/modules/dri/r600_dri.so
#2  0x00007fffe8d213e7 in ?? () from /usr/lib/xorg/modules/dri/r600_dri.so
#3  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#4  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 2 (Thread 0x7fffe9f79700 (LWP 4094)):
#0  0x00007ffff69392d7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007ffff6939384 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x00007ffff543d76e in ?? () from /usr/lib/libSDL2-2.0.so.0
#3  0x00007ffff543d8c5 in ?? () from /usr/lib/libSDL2-2.0.so.0
#4  0x00007ffff53f0c93 in ?? () from /usr/lib/libSDL2-2.0.so.0
#5  0x00007ffff53f082c in ?? () from /usr/lib/libSDL2-2.0.so.0
#6  0x00007ffff543d439 in ?? () from /usr/lib/libSDL2-2.0.so.0
#7  0x00007ffff69314a4 in start_thread () from /usr/lib/libpthread.so.0
#8  0x00007ffff436c13d in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7ffff7eed840 (LWP 4090)):

#0  0x00007ffff4314078 in __memcpy_sse2_unaligned () from /usr/lib/libc.so.6

#1  0x000000000318ae9a in WARSCAPE::TEXTURE_MANAGER_ENTRY::update<CA::Pixel8888> (this=0x173e47c0, image=..., mip_map_level=0, _src_rect=0x0, dest_x=0, dest_y=0, 
    dest_z=<optimized out>, update_gpu=<optimized out>) at Source/platform/TextureManager.inl:333
#2  0x000000000344011f in WARSCAPE::TEXTURE_MANAGER_ENTRY::update<CA::Pixel8888> (this=<optimized out>, image=..., mip_map_level=<optimized out>, dest_x=<optimized out>, 
    dest_y=<optimized out>, dest_z=<optimized out>, update_gpu=<optimized out>, this=<optimized out>, image=..., mip_map_level=<optimized out>, dest_x=<optimized out>, 
    dest_y=<optimized out>, dest_z=<optimized out>, update_gpu=<optimized out>) at Source/platform/TextureManager.inl:86
#3  WARSCAPE::TEXTURE_MANAGER_ENTRY::create_resource (this=<optimized out>, out_of_video_memory=<optimized out>) at Source/platform/TextureManagerEntry.cpp:3131
#4  0x000000000310e804 in WARSCAPE::TEXTURE_MANAGER::register_texture (this=0xa9fdcd0, texture=..., flags=(TF_DYNAMIC | TF_READABLE | TF_UI_RESOURCE), file_name=..., alt_filename=..., 
    original_filename=..., from_file=<optimized out>, texel_format=<optimized out>, width=<optimized out>, height=<optimized out>, depth=<optimized out>, 
    num_mip_map_levels=<optimized out>, image=<optimized out>, critical=<optimized out>, screen_size_multiplier=<optimized out>, aa_setting=<optimized out>)
    at Source/platform/TextureManager.cpp:2230
#5  0x0000000003111389 in WARSCAPE::WS_CONTEXT::texture_manager () at Source/WarscapeBase.h:125
---Type <return> to continue, or q <return> to quit---
#6  WARSCAPE::TEXTURE::register_texture (this=<optimized out>, filename=..., alt_filename=..., orig_filename=..., from_file=<optimized out>, texel_format=<optimized out>, 
    width=<optimized out>, height=<optimized out>, depth=<optimized out>, num_mip_map_levels=<optimized out>, image=<optimized out>, critical=<optimized out>, 
    aa_setting=<optimized out>, this=<optimized out>, flags=<optimized out>, filename=..., alt_filename=..., orig_filename=..., from_file=<optimized out>, 
    texel_format=<optimized out>, width=<optimized out>, height=<optimized out>, depth=<optimized out>, num_mip_map_levels=<optimized out>, image=<optimized out>, 
    critical=<optimized out>, screen_size_multiplier=<optimized out>, aa_setting=<optimized out>) at Source/resource/Texture.cpp:135
#7  WARSCAPE::TEXTURE::TEXTURE (this=0x17067bd0, category=<optimized out>, image=0xc33ddf0, flags=(TF_DYNAMIC | TF_READABLE | TF_UI_RESOURCE), 
    texel_format=TEXTURE_TEXEL_FORMAT::TTF_NUM_FORMATS) at Source/resource/Texture.cpp:210
#8  0x00000000030b09ff in WARSCAPE::TEXTURE_MANAGER::create_default_textures (this=0xa9fdcd0) at Source/platform/TextureManager.cpp:924
#9  0x00000000030b05b0 in WARSCAPE::SCENE::create (this=0x10ff0150, reg_scene=0xaf860f0) at Source/scene/Scene.cpp:1243
#10 0x000000000310066c in WARSCAPE::WS_ENGINE_IMP::registration_end (this=0xa0b2680, register_scene=0xaf860f0) at Source/platform/Engine.cpp:2497
#11 0x0000000000570385 in EMPIRE::MVC_MANAGER::open_handler (this=0x10e96880) at Source/MVCManager.cpp:938
#12 0x0000000000570763 in EMPIRE::MVC_MANAGER::update (this=0x10e96880, anti_piracy_v2_cracked_1=0, anti_piracy_v2_cracked_2=0, anti_piracy_v2_cracked_3=0, anti_piracy_v2_cracked_4=0)
    at Source/MVCManager.cpp:1198
#13 0x000000000058a699 in EMPIRE::EMPIRE_APP_MODULE::run_loop (this=0x57f5100, anti_piracy_v2_cracked_1=0, anti_piracy_v2_cracked_2=0, anti_piracy_v2_cracked_3=0, 
    anti_piracy_v2_cracked_4=0) at Source/Empire.cpp:2326
#14 0x0000000000576431 in TOTALWAR::on_app_update (main_thread=<optimized out>) at Source/POSIX/AppModuleWrapper.cpp:224
#15 0x00000000004e3c33 in run_thread (argc=<optimized out>, argv=<optimized out>) at Source/TotalWar.cpp:163
#16 0x00000000004e3e1b in main (argc=1, argv=0x7fffffffe798) at Source/TotalWar.cpp:177

I also attach the output of apitrace.

Note that the producers of Total War: Attila explicitly state that they only support the NVidia binary driver at the exclusion of everything else, but they do not state what's missing/buggy in the Mesa drivers.

Thanks!
Comment 1 Michel Dänzer 2016-01-06 03:08:44 UTC
Reassigning to Mesa core since it happens with the i965 driver as well, but it looks like it might be a game bug.

BTW, an apitrace is only useful if replaying it reproduces the problem.
Comment 2 Jose Fonseca 2016-01-06 12:15:01 UTC
(In reply to Michel Dänzer from comment #1)
> Reassigning to Mesa core since it happens with the i965 driver as well, but
> it looks like it might be a game bug.
> 
> BTW, an apitrace is only useful if replaying it reproduces the problem.

Actually the apitrace shows the problem:

2347 glXCreateContextAttribsARB(dpy = 0x6c00ec0, config = 0x6d081a0, share_context = NULL, direct = True, attrib_list = {GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 3, GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, 0}) = NULL
2348 glXMakeCurrent(dpy = 0x6c00ec0, drawable = 0, ctx = NULL) = True
2350 glGenTextures(n = 1, textures = &0)
...
2595 glMapBufferRange(target = GL_PIXEL_PACK_BUFFER, offset = 0, length = 0, access = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT | GL_MAP_FLUSH_EXPLICIT_BIT) = NULL

The game requests a 4.3 context, it doesn't get one, but happily proceeds using a null context as if nothing happened ... until it gets a NULL glMapBufferRange and segfaults.

glretrace skips gl calls with a NULL context (because on Windows the OPENGL32.DLL silently drops them so quite a few Windows apps inadvertebntly do it when shutting, so glretrace needs to ignore when replaying on Linux to prevent crashes)
Comment 3 Jose Fonseca 2016-01-06 12:21:03 UTC
(In reply to Médéric Boquien from comment #0)
> Note that the producers of Total War: Attila explicitly state that they only
> support the NVidia binary driver at the exclusion of everything else, but
> they do not state what's missing/buggy in the Mesa drivers.

It seems they require at least OpenGL 4.3 core profile support.

But given they make no attempt to check for errors it seems a lost cause. I wouldn't be surprised if they used proprietary NVIDIA extensions without checking.

I don't think there's a bug here: if they specifically state they only support NVIDIA blob there's nothing we can do but short of emulation NVIDIA blob (extension etc.)
Comment 4 Médéric Boquien 2016-01-06 12:27:59 UTC
Thanks for the investigation. Is there a way I can find the list of extensions they are using? That way I can keep an eye with upcoming Mesa versions and try again when everything is in place.
Comment 5 ArneJ 2016-01-06 20:59:40 UTC
You're right, it needs a GL 4.3 Core Context. I was able to start the game with the following launch options in steam:

MESA_GL_VERSION_OVERRIDE=4.3 MESA_GLSL_VERSION_OVERRIDE=430 %command%

It runs quite well with medium settings at 1920x1080 on my R9 270X with mesa 11.1.0 (I just tested a little bit of the prologue). I didn't see any issues so it's quite possible that the game requests a 4.3 context but doesn't need any extensions that are not available on radeonsi.
Comment 6 Médéric Boquien 2016-01-08 14:41:59 UTC
To add to what ArneJ has said, for people trying to run Attila with the r600 driver, one needs 1. to run Mesa git as the GL_ARB_copy_image extension did not make it in time for 11.1 as far as I understand, and 2. to add R600_DEBUG=nosb to the command line. Otherwise the map appears almost entirely white. Maybe related to this, it seems there are issues with the shaders as it keeps repeating this error message:

EE r600_shader.c:183 r600_pipe_shader_create - translation from TGSI failed !
EE r600_state_common.c:826 r600_shader_select - Failed to build shader variant (type=1) -1

At any rate the performance is quite poor even on the lowest settings.


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.