[Bug 80673] New: XCOM: Enemy Unknown - Wrong read access when starting the game

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Jun 29 04:46:29 PDT 2014


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

          Priority: medium
            Bug ID: 80673
          Assignee: dri-devel at lists.freedesktop.org
           Summary: XCOM: Enemy Unknown - Wrong read access when starting
                    the game
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: freedesktop at psydk.org
          Hardware: x86-64 (AMD64)
            Status: NEW
           Version: 10.1
         Component: Drivers/Gallium/r600
           Product: Mesa

Created attachment 101971
  --> https://bugs.freedesktop.org/attachment.cgi?id=101971&action=edit
callstack of the wrong read access

Some background:
I am trying to understand why "XCOM: Enemy Uknown" (a game that was released
for Linux x64 last week on Steam), leads to crashes when running with the open
source Radeon driver. The people who did the port do not officialy support the
open source driver but seems to be open to the idea of making it run on it.

My system:
Ubuntu 14.04 x64
Readon HD 4870
Mesa 10.1.3

Unfortunately that Radeon model is not supported by AMD's closed source driver.
However, the game runs very well with the open source driver, with the
exception of several random crashes. This bug report is one of the problem I
have found and for which I have some information.

The main crash I was experimenting was corrupting the heap, so I used a tool to
detect illegal read and write accesses. The first problem it found is an
illegal read access at the start of the game, after the different logos, when
the main menu is about to appear.

What is happening is that a memcpy with a size of 1360 bytes is made with a
source buffer of only 1280 bytes in u_upload_data(). I will attach the
callstack to this ticket.

In that context, the entry point in the driver is:
 vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
                                      GLuint start, GLuint end,
                                      GLsizei count, GLenum type,
                                      const GLvoid *indices,
                                      GLint basevertex)

Here are the values of the parameters:

---------------------------------------------------------------
mode: 4 (GL_TRIANGLES)
start: 0
end: 16
count: 24
type: 5123 (GL_UNSIGNED_SHORT)
indices: 72 bytes:
  00 00 02 00 03 00 00 00 01 00 02 00 04 00 06 00
  07 00 04 00 05 00 06 00 08 00 0a 00 0b 00 08 00
  09 00 0a 00 0c 00 0e 00 0f 00 0c 00 0d 00 0e 00
  00 00 04 00 06 00 00 00 06 00 02 00 01 00 03 00
  07 00 01 00 07 00 05 00
  reordered as 36 u16:
  0000 0002 0003 0000 0001 0002 0004 0006
  0007 0004 0005 0006 0008 000a 000b 0008
  0009 000a 000c 000e 000f 000c 000d 000e
  0000 0004 0006 0000 0006 0002 0001 0003
  0007 0001 0007 0005

basevertex: 0
---------------------------------------------------------------
Now I'm no expert in OpenGL and it is the first time I look at Mesa code, so I
can't identify the main reason for the error. Hopefully you will have a clue.

A tip to debug the game: if you have Steam and the game, I renamed the main
exectuable in ".../Steam/SteamApps/common/XCom-Enemy-Unknown/binaries/linux/"
named "game.x86_64" as "game.x86_64_real" and created a shell script named
"game.x86_64" that performs necessary settings for debugging and then launch
"game.x86_64_real". In my case I am setting LD_PRELOAD with a library that
catches malloc() calls and fences the buffer before returning it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140629/1c037235/attachment.html>


More information about the dri-devel mailing list