[Bug 32559] Warlock - Master of the Arcane 1.4 (Steam) crashes on startup (game engine writes past the end of mip level, mipchain must be allocated contiguously)

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Apr 29 15:24:36 CDT 2014


https://bugs.winehq.org/show_bug.cgi?id=32559

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE
            Summary|Warlock - Master of the     |Warlock - Master of the
                   |Arcane 1.4 (Steam) crashes  |Arcane 1.4 (Steam) crashes
                   |on startup                  |on startup (game engine
                   |                            |writes past the end of mip
                   |                            |level, mipchain must be
                   |                            |allocated contiguously)

--- Comment #24 from Anastasius Focht <focht at gmx.net> ---
Hello Henri,

--- quote ---
This could be a duplicate of bug 34480. On windows writing past the end of mip
levels tends to work because the entire mipchain is allocated contiguously.
That assumes that the application behaves like this on Windows as well though.
--- quote ---

it's indeed as you say.
I did what Stefan suggested in bug 34480
(https://bugs.winehq.org/show_bug.cgi?id=34480#c7)

--- quote ---
A quick and dirty workaround would be to allocate twice the amount of memory
for each resource in wined3d_resource_allocate_sysmem().
--- quote ---

and the game starts fine. The graphics/gameplay is looking good :)

Relay log with hack applied, showing the game really assumes contiguous
mipchain allocation:

11 levels:  0x2000,0x1000,0x800,0x400,0x200,0x100,0x80,0x40,0x20,0x10,0x8

--- snip ---
005a:trace:d3d9:d3d9_device_CreateTexture iface 0x19b4a0, width 2048, height
512, levels 11, usage 0, format 0x35545844, pool 0x1, texture 0x189772e4,
shared_handle (nil).
005a:Call ntdll.RtlAllocateHeap(00110000,00000008,00000018) ret=7edd74fc
005a:Ret  ntdll.RtlAllocateHeap() retval=12bfcc78 ret=7edd74fc
005a:Call wined3d.wined3d_mutex_lock() ret=7edeaa8c
005a:Ret  wined3d.wined3d_mutex_lock() retval=00000000 ret=7edeaa8c
005a:Call
wined3d.wined3d_texture_create(001b7b78,0431f7c8,0000000b,00000001,12bfcc78,7edfce78,12bfcc88)
ret=7edeaaca
005a:Call ntdll.RtlAllocateHeap(00110000,00000008,00000148) ret=7ed5540e
005a:Ret  ntdll.RtlAllocateHeap() retval=12bfcc98 ret=7ed5540e
005a:trace:d3d:device_resource_add device 0x1b7b78, resource 0x12bfcc98.
005a:Call ntdll.RtlAllocateHeap(00110000,00000008,0000002c) ret=7ed50f1e
005a:Ret  ntdll.RtlAllocateHeap() retval=12bfcde8 ret=7ed50f1e
005a:fixme:d3d:debug_d3dusage Unrecognized usage flag(s) 0x10000000
005a:trace:d3d_surface:wined3d_surface_create container 0x12bfcc98, width 2048,
height 512, format WINED3DFMT_DXT5, usage 0 (0x10000000), pool
WINED3D_POOL_MANAGED, multisample_type 0, multisample_quality 0, target 0xde1,
level 0, flags 0x1, surface 0x431f630.
005a:Call ntdll.RtlAllocateHeap(00110000,00000008,00000114) ret=7ed4c890
005a:Ret  ntdll.RtlAllocateHeap() retval=12bfce20 ret=7ed4c890
005a:Call ntdll.RtlAllocateHeap(00110000,00000008,00200013) ret=7ece32fe
005a:Ret  ntdll.RtlAllocateHeap() retval=2277a020 ret=7ece32fe
005a:trace:d3d:device_resource_add device 0x1b7b78, resource 0x12bfce20.
005a:trace:d3d_surface:surface_set_container surface 0x12bfce20, container
0x12bfcc98.
005a:trace:d3d_surface:surface_validate_location surface 0x12bfce20, location
WINED3D_LOCATION_SYSMEM.
005a:trace:d3d_surface:surface_private_setup surface 0x12bfce20.
005a:trace:d3d9:device_parent_surface_created device_parent 0x19b4a4,
container_parent 0x12bfcc78, surface 0x12bfce20, parent 0x431f5a4, parent_ops
0x431f5a8. 
...
005a:trace:d3d_surface:wined3d_surface_map surface 0x12bfce20, map_desc
0x431f704, rect (null), flags 0.
005a:trace:d3d_surface:surface_prepare_system_memory surface 0x12bfce20.
005a:trace:d3d_surface:surface_load_location surface 0x12bfce20, location
WINED3D_LOCATION_SYSMEM.
005a:trace:d3d_surface:surface_load_location Location already up to date.
005a:fixme:d3d:wined3d_debug_location Unrecognized location flag(s) 0xfffffc00.
005a:trace:d3d_surface:surface_invalidate_location surface 0x12bfce20, location
WINED3D_LOCATION_DISCARDED | WINED3D_LOCATION_USER_MEMORY |
WINED3D_LOCATION_DIB | WINED3D_LOCATION_BUFFER | WINED3D_LOCATION_TEXTURE_RGB |
WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_DRAWABLE |.
005a:trace:d3d_surface:wined3d_surface_get_pitch surface 0x12bfce20.
005a:trace:d3d_surface:wined3d_surface_get_pitch Returning 8192.
005a:trace:d3d_surface:wined3d_surface_map Locked rect (0,0)-(2048,512).
005a:trace:d3d_surface:wined3d_surface_map Returning memory 0x2277a030, pitch
8192.
005a:Ret  wined3d.wined3d_surface_map() retval=00000000 ret=7ede5b06 
...
005a:Call msvcr90.memcpy(2277a030,17457000,00002000) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=2277a030 ret=04359c04
005a:Call msvcr90.memcpy(2277c030,17459000,00002000) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=2277c030 ret=04359c04
005a:Call msvcr90.memcpy(2277e030,1745b000,00002000) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=2277e030 ret=04359c04  
...
005a:Call msvcr90.memcpy(22876030,17553000,00002000) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=22876030 ret=04359c04
005a:Call msvcr90.memcpy(22878030,17555000,00002000) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=22878030 ret=04359c04
005a:Call msvcr90.memcpy(2287a030,17557000,00001000) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=2287a030 ret=04359c04
005a:Call msvcr90.memcpy(2287b030,17558000,00001000) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=2287b030 ret=04359c04 
...
005a:Call msvcr90.memcpy(228b8030,17595000,00001000) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228b8030 ret=04359c04
005a:Call msvcr90.memcpy(228b9030,17596000,00001000) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228b9030 ret=04359c04
005a:Call msvcr90.memcpy(228ba030,17597000,00000800) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228ba030 ret=04359c04
005a:Call msvcr90.memcpy(228ba830,17597800,00000800) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228ba830 ret=04359c04 
...
005a:Call msvcr90.memcpy(228c9030,175a6000,00000800) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228c9030 ret=04359c04
005a:Call msvcr90.memcpy(228c9830,175a6800,00000800) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228c9830 ret=04359c04
005a:Call msvcr90.memcpy(228ca030,175a7000,00000400) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228ca030 ret=04359c04
005a:Call msvcr90.memcpy(228ca430,175a7400,00000400) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228ca430 ret=04359c04 
...
005a:Call msvcr90.memcpy(228cd830,175aa800,00000400) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cd830 ret=04359c04
005a:Call msvcr90.memcpy(228cdc30,175aac00,00000400) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cdc30 ret=04359c04
005a:Call msvcr90.memcpy(228ce030,175ab000,00000200) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228ce030 ret=04359c04
005a:Call msvcr90.memcpy(228ce230,175ab200,00000200) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228ce230 ret=04359c04 
...
005a:Call msvcr90.memcpy(228cec30,175abc00,00000200) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cec30 ret=04359c04
005a:Call msvcr90.memcpy(228cee30,175abe00,00000200) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cee30 ret=04359c04
005a:Call msvcr90.memcpy(228cf030,175ac000,00000100) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf030 ret=04359c04
005a:Call msvcr90.memcpy(228cf130,175ac100,00000100) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf130 ret=04359c04 
005a:Call msvcr90.memcpy(228cf230,175ac200,00000100) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf230 ret=04359c04
005a:Call msvcr90.memcpy(228cf330,175ac300,00000100) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf330 ret=04359c04
005a:Call msvcr90.memcpy(228cf430,175ac400,00000080) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf430 ret=04359c04
005a:Call msvcr90.memcpy(228cf4b0,175ac480,00000080) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf4b0 ret=04359c04
005a:Call msvcr90.memcpy(228cf530,175ac500,00000040) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf530 ret=04359c04
005a:Call msvcr90.memcpy(228cf570,175ac540,00000020) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf570 ret=04359c04
005a:Call msvcr90.memcpy(228cf590,175ac560,00000010) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf590 ret=04359c04
005a:Call msvcr90.memcpy(228cf5a0,175ac570,00000008) ret=04359c04
005a:Ret  msvcr90.memcpy() retval=228cf5a0 ret=04359c04
005a:trace:d3d9:d3d9_texture_2d_UnlockRect iface 0x12bfcc78, level 0.
005a:Call wined3d.wined3d_mutex_lock() ret=7ede8260
005a:Ret  wined3d.wined3d_mutex_lock() retval=00000000 ret=7ede8260
005a:Call wined3d.wined3d_texture_get_sub_resource(12bfcc98,00000000)
ret=7ede8275
005a:Ret  wined3d.wined3d_texture_get_sub_resource() retval=12bfce20
ret=7ede8275
005a:Call wined3d.wined3d_resource_get_parent(12bfce20) ret=7ede8292
005a:Ret  wined3d.wined3d_resource_get_parent() retval=12bfcf40 ret=7ede8292
005a:trace:d3d9:d3d9_surface_UnlockRect iface 0x12bfcf40.
005a:Call wined3d.wined3d_mutex_lock() ret=7ede5bb3
005a:Ret  wined3d.wined3d_mutex_lock() retval=00000000 ret=7ede5bb3
005a:Call wined3d.wined3d_surface_unmap(12bfce20) ret=7ede5bc2
005a:trace:d3d_surface:wined3d_surface_unmap surface 0x12bfce20.
005a:trace:d3d_surface:surface_unmap surface 0x12bfce20.
005a:Ret  wined3d.wined3d_surface_unmap() retval=00000000 ret=7ede5bc2  
--- snip ---

$ wine --version
wine-1.7.17-129-gb84e112

Regards

*** This bug has been marked as a duplicate of bug 34480 ***

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list