Skip to contentSkip to conversation

Divinity: Original Sin Enhanced Edition(Native) crash on start

Bug 93551 [email protected] 1 participant 11 messages Jan 1, 2016 – Apr 26, 2016

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=93551

Bug ID: 93551
Summary: Divinity: Original Sin Enhanced Edition(Native) crash
on start
Product: Mesa
Version: git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/radeonsi
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

LD_LIBRARY_PATH="." ./EoCApp
[S_API FAIL] SteamAPI_Init() failed; no appID found.
Either launch the game from Steam, or put the file steam_appid.txt containing the correct appID in your game folder.
Thread "EoCApp" (3053090816)
received signal 11

Call stack:

(0) /usr/lib/libpthread.so.0 : +0x10d60 [0x7f1fb1a53d60] Ошибка сегментирования (core dumped)

Radeon HD 7950, ArchLinux 64, kernel 4.3.1, mesa|llvm from git.

Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff47fa563 in api::OpenGLRenderer::ChangeShader(ls::ObjectHandle, bool) () from ./libOGLBinding.so
#2 0x00007ffff44a01f5 in rf::Renderer::Apply(bool) () from ./libRenderFramework.so
#3 0x00007ffff47ec7bd in api::OpenGLRenderer::OpenGLRenderer(api::IAPI*, void*) () from ./libOGLBinding.so
#4 0x00007ffff47ebe19 in api::OpenGLAPI::CreateRenderer() () from ./libOGLBinding.so

#5  0x00007ffff47eba38 in api::OpenGLAPI::Init() () from ./libOGLBinding.so
#6  0x00007ffff45fa28a in BaseApp::InitAPI() () from ./libGameEngine.so
#7  0x00007ffff45f8e58 in BaseApp::Start(ls::InitStruct*) () from

./libGameEngine.so
#8 0x00000000006d4410 in main ()

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=93551

--- Comment #1 from Vladimir Usikov <[email protected]> --- With llvm-pipe same crash

LIBGL_ALWAYS_SOFTWARE=1 LD_LIBRARY_PATH="." ./EoCApp
[S_API FAIL] SteamAPI_Init() failed; no appID found.
Either launch the game from Steam, or put the file steam_appid.txt containing the correct appID in your game folder.
Thread "EoCApp" (2800719872)
received signal 11

Call stack:

(0) /usr/lib/libpthread.so.0 : +0x10d60 [0x7fd9a29a3d60] Ошибка сегментирования (core dumped)

(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff47fa563 in api::OpenGLRenderer::ChangeShader(ls::ObjectHandle, bool) () from ./libOGLBinding.so
#2 0x00007ffff44a01f5 in rf::Renderer::Apply(bool) () from ./libRenderFramework.so
#3 0x00007ffff47ec7bd in api::OpenGLRenderer::OpenGLRenderer(api::IAPI*, void*) () from ./libOGLBinding.so
#4 0x00007ffff47ebe19 in api::OpenGLAPI::CreateRenderer() () from ./libOGLBinding.so

#5  0x00007ffff47eba38 in api::OpenGLAPI::Init() () from ./libOGLBinding.so
#6  0x00007ffff45fa28a in BaseApp::InitAPI() () from ./libGameEngine.so
#7  0x00007ffff45f8e58 in BaseApp::Start(ls::InitStruct*) () from

./libGameEngine.so
#8 0x00000000006d4410 in main ()

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93551

--- Comment #2 from Nicolai Hähnle <[email protected]> ---
Thanks for the report, but to be honest, the backtrace looks like this is a game bug. The last function on the stack belongs to the game, and then it jumps to 0. This is what you would see if a game doesn't properly check extension support, for example.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93551

--- Comment #3 from Vladimir Usikov <[email protected]> ---
I run with MESA_GL_VERSION_OVERRIDE=4.2 MESA_GLSL_VERSION_OVERRIDE=420 and receive call stack:

(0) /usr/lib/libpthread.so.0 : +0x10d60 [0x7f360f099d60]
(1) ./libOGLBinding.so : api::OpenGLRenderer::ApplyConstants()+0x65 [0x7f360ffd57d5]
(2) ./libRenderFramework.so : rf::Renderer::Apply(bool)+0x57 [0x7f360fc74207]
(3) ./EoCApp : ig::IggyBinding::Swap(rf::Renderer*)+0xfc [0xebf16c]
(4) ./libGameEngine.so : BaseApp::EndDrawGUI(rf::Renderer*)+0x9b [0x7f360fdd288b]
(5) ./libGameEngine.so : BaseApp::MakeFrame()+0x3a4 [0x7f360fdd2db4]
(6) ./libGameEngine.so : BaseApp::OnIdle()+0xe0 [0x7f360fdd1590]
(7) ./EoCApp : main+0x170 [0x6d4430]
(8) /usr/lib/libc.so.6 : __libc_start_main+0xf0 [0x7f360ed01610]
(9) ./EoCApp : _start+0x29 [0x6d41a9]

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93551

--- Comment #4 from Andrei Amuraritei <[email protected]> ---
(0) /lib64/libpthread.so.0 : +0x109f0 [0x7f7dde77b9f0]
(1) ./libOGLBinding.so : api::OpenGLRenderer::ApplyConstants()+0x65 [0x7f7ddf6bf7d5]
(2) ./libRenderFramework.so : rf::Renderer::Apply(bool)+0x57 [0x7f7ddf35e207]
(3) ./EoCApp : ig::IggyBinding::Swap(rf::Renderer*)+0xfc [0xebf16c]
(4) ./libGameEngine.so : BaseApp::EndDrawGUI(rf::Renderer*)+0x9b [0x7f7ddf4bc88b]
(5) ./libGameEngine.so : BaseApp::MakeFrame()+0x3a4 [0x7f7ddf4bcdb4]
(6) ./libGameEngine.so : BaseApp::OnIdle()+0xe0 [0x7f7ddf4bb590]
(7) ./EoCApp : main+0x170 [0x6d4430]
(8) /lib64/libc.so.6 : __libc_start_main+0xf0 [0x7f7dde3c3580]
(9) ./EoCApp : _start+0x29 [0x6d41a9]

I get the above in a window when trying to start the game with MESA_GL_VERSION_OVERRIDE=4.2 MESA_GLSL_VERSION_OVERRIDE=420, after clicking OK, I get a black screen with the mouse cursor from the game and a bit of sound, and the game exits.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93551

--- Comment #5 from Nicolai H�hnle <[email protected]> --- Thanks for the backtrace, but again, without further evidence to the contrary I'd say that this is a game bug. The crash happens in pthread, which is called directly by the game. I suspect that the game isn't using the OpenGL API correctly.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93551

--- Comment #6 from [email protected] ---
I disassembled ApplyConstants() where the game crashes when using OpenGL override to 4.2. It is indeed a game bug, caused by possible NULL dereference. Crash occurs at line marked by =>

   0x00007ffff48467e0 <+0>:    push   r15
   0x00007ffff48467e2 <+2>:    push   r14
   0x00007ffff48467e4 <+4>:    push   r12
   0x00007ffff48467e6 <+6>:    push   rbx
   0x00007ffff48467e7 <+7>:    push   rax
   0x00007ffff48467e8 <+8>:    mov    r14,rdi
   0x00007ffff48467eb <+11>:    mov    eax,DWORD PTR [r14+0x6f8]
   0x00007ffff48467f2 <+18>:    mov    rcx,QWORD PTR [rip+0xd297]        #
0x7ffff4853a90
   0x00007ffff48467f9 <+25>:    cmp    eax,DWORD PTR [rcx]
   0x00007ffff48467fb <+27>:    je     0x7ffff4846959
<_ZN3api14OpenGLRenderer14ApplyConstantsEv+377>
   0x00007ffff4846801 <+33>:    xor    r15d,r15d
   0x00007ffff4846804 <+36>:    test   eax,0x3ff0000
   0x00007ffff4846809 <+41>:    je     0x7ffff4846845
<_ZN3api14OpenGLRenderer14ApplyConstantsEv+101>
   0x00007ffff484680b <+43>:    movzx  ecx,ax
   0x00007ffff484680e <+46>:    mov    edx,DWORD PTR [r14+0xc4]
   0x00007ffff4846815 <+53>:    xor    r15d,r15d
   0x00007ffff4846818 <+56>:    cmp    rcx,rdx
   0x00007ffff484681b <+59>:    jae    0x7ffff4846845
<_ZN3api14OpenGLRenderer14ApplyConstantsEv+101>
   0x00007ffff484681d <+61>:    shr    eax,0x10
   0x00007ffff4846820 <+64>:    mov    rdx,QWORD PTR [r14+0xe0]
   0x00007ffff4846827 <+71>:    xor    r15d,r15d
   0x00007ffff484682a <+74>:    movzx  edx,WORD PTR [rdx+rcx*2]
   0x00007ffff484682e <+78>:    and    eax,0x3ff
   0x00007ffff4846833 <+83>:    cmp    eax,edx
   0x00007ffff4846835 <+85>:    jne    0x7ffff4846845
<_ZN3api14OpenGLRenderer14ApplyConstantsEv+101>
   0x00007ffff4846837 <+87>:    imul   r15,rcx,0x110
   0x00007ffff484683e <+94>:    add    r15,QWORD PTR [r14+0xb8]

=> 0x00007ffff4846845 <+101>: mov rcx,QWORD PTR [r15+0x10]
......

//0x00007ffff48467eb:
eax = this->variable_at_offset_0x6f8
//0x00007ffff48467f2:
rcx = some_related_global_or_static_variable
//0x00007ffff48467fb:

  if (eax != rcx) {
    // 0x00007ffff4846801:
    r15 = NULL
    if ((eax & 0x3ff0000) != 0) {
       // ...
       // r15 is set in this block to valid value
       // ...
    }
    // 0x00007ffff4846845:
    rcx = r15->variable_at_offset_0x10 // crash here because r15 can be NULL

}
// function end

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93551

--- Comment #7 from Laurent carlier <[email protected]> --- See https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93551

--- Comment #8 from Kamil P�ral <[email protected]> --- Would somebody care to contact the game developers and describe the issue in detail? And if you did, do you have a link (to a forum topic, public bug report, etc)? Thanks.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93551

--- Comment #9 from [email protected] ---
(In reply to Kamil P�ral from comment #8)

Quoted 3 lines

Would somebody care to contact the game developers and describe the issue in detail? And if you did, do you have a link (to a forum topic, public bug report, etc)? Thanks.

I posted it as a reply to nouveau issue topic in forum. Maybe someone will pick it up there.

http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=580880&#Post580880

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93551

Jamey Sharp <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 OS|Linux (All)                 |All
                 CC|                            |[email protected]
          Component|Drivers/Gallium/radeonsi    |Mesa core
         QA Contact|[email protected] |[email protected].
                   |.org                        |org
           Hardware|x86-64 (AMD64)              |All
           Assignee|[email protected] |[email protected].
                   |.org                        |org

--- Comment #10 from Jamey Sharp <[email protected]> --- (In reply to smidjar2.reg from comment #6)

Quoted 2 lines

I disassembled ApplyConstants() where the game crashes when using OpenGL override to 4.2.

I spent a while poking at this crash in gdb, and I was definitely seeing the same segfault at the same instruction and call-stack.

I've sent a (one-line!) patch to mesa-dev that fixes this segfault on startup:

https://lists.freedesktop.org/archives/mesa-dev/2016-April/114614.html

And a Piglit patch that tests for the non-conforming behavior that led to this crash:

https://lists.freedesktop.org/archives/mesa-dev/2016-April/114613.html

Thanks to Karol Herbst's mesa-dev post, linked from comment #7, for pointing me in the right direction to find this Mesa bug.

Granted, the game developers ought to check for errors returned from glLinkProgram and fail more gracefully than a segfault, but I doubt we're going to get them to do *that*...

I can now play this game somewhat successfully on i965 with MESA_GL_VERSION_OVERRIDE=4.2. There are still plenty of rendering bugs I haven't dug into yet, but I played for an hour without crashes, at least!

I don't have (or particularly want) a commit bit on Mesa or Piglit, so now we need somebody to review and hopefully merge these patches.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel