Bug 41791 - Civilization V + Wine = Bug
Summary: Civilization V + Wine = Bug
Status: RESOLVED DUPLICATE of bug 44466
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 7.11
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Jose Fonseca
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-14 07:19 UTC by gabrielbyrnei
Modified: 2012-05-19 04:23 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg log (1.12 MB, text/x-log)
2011-11-26 02:53 UTC, Marc Bessieres
Details
valgrind report using clang built mesa 8.0.1 (93.66 KB, text/plain)
2012-03-01 23:51 UTC, vincent
Details
valgrind report using gcc built mesa 8.0.1 (and clang built llvm) (67.98 KB, text/plain)
2012-03-01 23:52 UTC, vincent
Details
patch w/ workaround attempt (1.09 KB, patch)
2012-05-16 08:11 UTC, Jose Fonseca
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description gabrielbyrnei 2011-10-14 07:19:21 UTC
This is what i get after issuing the command to run Civ V under Wine: HD4850

gabriel@linux-a7dy:~/.wine/drive_c/Archivos de programa/Sid Meier's Civilization V> wine CivilizationV.exe
fixme:ntdll:find_reg_tz_info Can't find matching timezone information in the registry for bias 240, std (d/m/y): 8/05/2011, dlt (d/m/y): 21/08/2011
wine: Unhandled page fault on read access to 0xffffffff at address 0xf6f6540d (thread 0009), starting debugger...
Unhandled exception: page fault on read access to 0xffffffff in 32-bit code (0xf6f6540d).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:f6f6540d ESP:00327798 EBP:f7251ff4 EFLAGS:00010246(  R- --  I  Z- -P- )
 EAX:7c61b62c EBX:7c4d5e98 ECX:7c611288 EDX:00000000
 ESI:00000000 EDI:7c4d5e70
Stack dump:
0x00327798:  7c611288 00000000 003277cc 7c61c6cc
0x003277a8:  f7251ff4 00000020 7c611278 7c4d5e40
0x003277b8:  f7579394 f7251ff4 f6fcd845 7c611208
0x003277c8:  f7579380 7c611208 00000000 f748159a
0x003277d8:  00327808 7c641940 7c4d5e70 f65c2ff4
0x003277e8:  00000020 f713d5e7 00327820 f658c927
000c: sel=0067 base=00000000 limit=00000000 32-bit r-x
Backtrace:
=>0 0xf6f6540d _ZN4llvm12PassRegistry21registerAnalysisGroupEPKvS2_RNS_8PassInfoEbb+0x2dd() in r600_dri.so (0xf7251ff4)
  1 0xf6e3d2fb _ZN4llvm18initializeNoAAPassERNS_12PassRegistryE+0x11a() in r600_dri.so (0xf7287914)
  2 0xf6df5198 _ZN4llvm36initializeAliasAnalysisAnalysisGroupERNS_12PassRegistryE+0x47() in r600_dri.so (0x7c4d0720)
  3 0xf6e8455b _ZN4llvm36initializeTypeBasedAliasAnalysisPassERNS_12PassRegistryE+0x4a() in r600_dri.so (0x7c4d0720)
  4 0xf6e846de _ZN4llvm32createTypeBasedAliasAnalysisPassEv+0x6d() in r600_dri.so (0x7c6114a8)
  5 0xf6bd7b04 _ZN4llvm17LLVMTargetMachine22addCommonCodeGenPassesERNS_15PassManagerBaseENS_10CodeGenOpt5LevelEbRPNS_9MCContextE+0x23() in r600_dri.so (0x7c6114a8)
  6 0xf6bd842c _ZN4llvm17LLVMTargetMachine26addPassesToEmitMachineCodeERNS_15PassManagerBaseERNS_14JITCodeEmitterENS_10CodeGenOpt5LevelEb+0x4b() in r600_dri.so (0x7c6114a8)
  7 0xf695fe11 _ZN4llvm3JITC1EPNS_6ModuleERNS_13TargetMachineERNS_13TargetJITInfoEPNS_16JITMemoryManagerENS_10CodeGenOpt5LevelEb+0x210() in r600_dri.so (0x7c6114a8)
  8 0xf695fa0f _ZN4llvm3JIT9createJITEPNS_6ModuleEPSsPNS_16JITMemoryManagerENS_10CodeGenOpt5LevelEbPNS_13TargetMachineE+0x8e() in r600_dri.so (0x7c640cec)
  9 0xf69751fa _ZN4llvm13EngineBuilder6createEv+0x159() in r600_dri.so (0x00000000)
0xf6f6540d _ZN4llvm12PassRegistry21registerAnalysisGroupEPKvS2_RNS_8PassInfoEbb+0x2dd in r600_dri.so: 
Modules:
Module  Address                 Debug info      Name (125 modules)
PE        330000-  343000       Deferred        zlib1
PE        350000-  378000       Deferred        lua51_win32
PE        390000-  3e3000       Deferred        steamclient
PE        400000- 6cd1000       Deferred        civilizationv
PE       6ce0000- 72ad000       Deferred        cvgamecoredllfinal release
PE       72b0000- 737d000       Deferred        cvlocalizationwin32final releaseC:\Archivos de programa\Sid Meier's Civilization V\CvLocalizationWin32Final Release.dll
PE       7380000- 7994000       Deferred        cvgamedatabasewin32final releaseC:\Archivos de programa\Sid Meier's Civilization V\CvGameDatabaseWin32Final Release.dll
PE       79a0000- 7a0b000       Deferred        mss32
PE      10000000-101e5000       Deferred        d3dx9_42
PE      3b400000-3b41e000       Deferred        steam_api
PE      78000000-78044000       Deferred        msvcrt
PE      78480000-7850e000       Deferred        msvcp90
PE      78520000-785c3000       Deferred        msvcr90
ELF     7b800000-7b9bb000       Deferred        kernel32<elf>
  \-PE  7b810000-7b9bb000       \               kernel32
ELF     7bc00000-7bcd5000       Deferred        ntdll<elf>
  \-PE  7bc10000-7bcd5000       \               ntdll
ELF     7bf00000-7bf04000       Deferred        <wine-loader>
ELF     7d230000-7d24b000       Deferred        spoolss<elf>
  \-PE  7d240000-7d24b000       \               spoolss
ELF     7d24b000-7d259000       Deferred        libnss_files.so.2
ELF     7d259000-7d265000       Deferred        libnss_nis.so.2
ELF     7d265000-7d27f000       Deferred        libnsl.so.1
ELF     7d27f000-7d288000       Deferred        libnss_compat.so.2
ELF     7d288000-7d29f000       Deferred        libresolv.so.2
ELF     7d29f000-7d2a8000       Deferred        libkrb5support.so.0
ELF     7d2a8000-7d2ad000       Deferred        libcom_err.so.2
ELF     7d2ad000-7d2d5000       Deferred        libk5crypto.so.3
ELF     7d2d5000-7d39e000       Deferred        libkrb5.so.3
ELF     7d39e000-7d540000       Deferred        libcrypto.so.1.0.0
ELF     7d540000-7d598000       Deferred        libssl.so.1.0.0
ELF     7d598000-7d5cf000       Deferred        libgssapi_krb5.so.2
ELF     7d5cf000-7d61d000       Deferred        libcups.so.2
ELF     7d624000-7d646000       Deferred        localspl<elf>
  \-PE  7d630000-7d646000       \               localspl
ELF     7d676000-7d67a000       Deferred        libkeyutils.so.1
ELF     7d6a8000-7d6df000       Deferred        uxtheme<elf>
  \-PE  7d6b0000-7d6df000       \               uxtheme
ELF     7db4e000-7db55000       Deferred        libxfixes.so.3
ELF     7db55000-7db61000       Deferred        libxcursor.so.1
ELF     7db61000-7db71000       Deferred        libxi.so.6
ELF     7db71000-7db75000       Deferred        libxcomposite.so.1
ELF     7db75000-7db7e000       Deferred        libxrandr.so.2
ELF     7db7e000-7db89000       Deferred        libxrender.so.1
ELF     7db89000-7db8f000       Deferred        libxxf86vm.so.1
ELF     7db8f000-7db93000       Deferred        libxinerama.so.1
ELF     7db93000-7db97000       Deferred        libxau.so.6
ELF     7db97000-7dbb7000       Deferred        libxcb.so.1
ELF     7dbb7000-7dbd2000       Deferred        libice.so.6
ELF     7dbd2000-7dd10000       Deferred        libx11.so.6
ELF     7dd39000-7ddea000       Deferred        winex11<elf>
  \-PE  7dd40000-7ddea000       \               winex11
ELF     7dec0000-7deea000       Deferred        libexpat.so.1
ELF     7deea000-7df20000       Deferred        libfontconfig.so.1
ELF     7df20000-7df37000       Deferred        libz.so.1
ELF     7df37000-7dfbf000       Deferred        libfreetype.so.6
ELF     7dfbf000-7e009000       Deferred        libncurses.so.5
ELF     7e00a000-7e010000       Deferred        libuuid.so.1
ELF     7e010000-7e022000       Deferred        libxext.so.6
ELF     7e022000-7e02b000       Deferred        libsm.so.6
ELF     7e032000-7e17e000       Deferred        wined3d<elf>
  \-PE  7e040000-7e17e000       \               wined3d
ELF     7e17e000-7e1bb000       Deferred        d3d9<elf>
  \-PE  7e180000-7e1bb000       \               d3d9
ELF     7e1bb000-7e1f7000       Deferred        winspool<elf>
  \-PE  7e1c0000-7e1f7000       \               winspool
ELF     7e1f7000-7e2f1000       Deferred        comdlg32<elf>
  \-PE  7e200000-7e2f1000       \               comdlg32
ELF     7e2f1000-7e407000       Deferred        oleaut32<elf>
  \-PE  7e310000-7e407000       \               oleaut32
ELF     7e407000-7e489000       Deferred        gdiplus<elf>
  \-PE  7e420000-7e489000       \               gdiplus
ELF     7e489000-7e49d000       Deferred        msimg32<elf>
  \-PE  7e490000-7e49d000       \               msimg32
ELF     7e49d000-7e4d1000       Deferred        ws2_32<elf>
  \-PE  7e4a0000-7e4d1000       \               ws2_32
ELF     7e4d1000-7e5d4000       Deferred        comctl32<elf>
  \-PE  7e4e0000-7e5d4000       \               comctl32
ELF     7e5d4000-7e648000       Deferred        shlwapi<elf>
  \-PE  7e5e0000-7e648000       \               shlwapi
ELF     7e648000-7e86d000       Deferred        shell32<elf>
  \-PE  7e660000-7e86d000       \               shell32
ELF     7e86d000-7e8d0000       Deferred        dbghelp<elf>
  \-PE  7e870000-7e8d0000       \               dbghelp
ELF     7e8d0000-7e8e4000       Deferred        psapi<elf>
  \-PE  7e8e0000-7e8e4000       \               psapi
ELF     7e8e4000-7e908000       Deferred        imm32<elf>
  \-PE  7e8f0000-7e908000       \               imm32
ELF     7e926000-7e95c000       Deferred        winhttp<elf>
  \-PE  7e930000-7e95c000       \               winhttp
ELF     7e95c000-7e987000       Deferred        msacm32<elf>
  \-PE  7e960000-7e987000       \               msacm32
ELF     7e987000-7ea06000       Deferred        rpcrt4<elf>
  \-PE  7e990000-7ea06000       \               rpcrt4
ELF     7ea06000-7eb37000       Deferred        ole32<elf>
  \-PE  7ea20000-7eb37000       \               ole32
ELF     7eb37000-7eba1000       Deferred        advapi32<elf>
  \-PE  7eb40000-7eba1000       \               advapi32
ELF     7eba1000-7ec58000       Deferred        gdi32<elf>
  \-PE  7ebb0000-7ec58000       \               gdi32
ELF     7ec58000-7edaa000       Deferred        user32<elf>
  \-PE  7ec70000-7edaa000       \               user32
ELF     7edaa000-7ee51000       Deferred        winmm<elf>
  \-PE  7edb0000-7ee51000       \               winmm
ELF     7efad000-7efd7000       Deferred        libm.so.6
ELF     7efe2000-7efe6000       Deferred        iso8859-1.so
ELF     7efe6000-7f000000       Deferred        version<elf>
  \-PE  7eff0000-7f000000       \               version
ELF     f64be000-f64dc000       Deferred        libgcc_s.so.1
ELF     f65cb000-f72cf000       Dwarf           r600_dri.so
ELF     f72cf000-f72d9000       Deferred        librt.so.1
ELF     f72d9000-f72e6000       Deferred        libdrm.so.2
ELF     f72e6000-f7342000       Deferred        libgl.so.1
ELF     f736b000-f73dd000       Deferred        ddraw<elf>
  \-PE  f7370000-f73dd000       \               ddraw
ELF     f73dd000-f7400000       Deferred        dxdiagn<elf>
  \-PE  f73e0000-f7400000       \               dxdiagn
ELF     f740a000-f740f000       Deferred        libdl.so.2
ELF     f740f000-f757c000       Deferred        libc.so.6
ELF     f757c000-f7597000       Deferred        libpthread.so.0
ELF     f75a1000-f75a5000       Deferred        libxdamage.so.1
ELF     f75a5000-f75c0000       Deferred        libglapi.so.0
ELF     f75c0000-f7704000       Dwarf           libwine.so.1
ELF     f7705000-f7726000       Deferred        ld-linux.so.2
ELF     ffffe000-fffff000       Deferred        [vdso].so
Threads:
process  tid      prio (all id:s are in hex)
00000008 (D) C:\Archivos de programa\Sid Meier's Civilization V\CivilizationV.exe
        00000009    0 <==
0000000e services.exe
        00000020    0
        0000001b    0
        00000016    0
        00000015    0
        00000014    0
        00000010    0
        0000000f    0
00000011 winedevice.exe
        00000017    0
        00000013    0
        00000012    0
00000018 plugplay.exe
        0000001c    0
        0000001a    0
        00000019    0
0000001d winedevice.exe
        00000021    0
        0000001f    0
        0000001e    0
00000022 explorer.exe
        00000023    0
Backtrace:
=>0 0xf6f6540d _ZN4llvm12PassRegistry21registerAnalysisGroupEPKvS2_RNS_8PassInfoEbb+0x2dd() in r600_dri.so (0xf7251ff4)
  1 0xf6e3d2fb _ZN4llvm18initializeNoAAPassERNS_12PassRegistryE+0x11a() in r600_dri.so (0xf7287914)
  2 0xf6df5198 _ZN4llvm36initializeAliasAnalysisAnalysisGroupERNS_12PassRegistryE+0x47() in r600_dri.so (0x7c4d0720)
  3 0xf6e8455b _ZN4llvm36initializeTypeBasedAliasAnalysisPassERNS_12PassRegistryE+0x4a() in r600_dri.so (0x7c4d0720)
  4 0xf6e846de _ZN4llvm32createTypeBasedAliasAnalysisPassEv+0x6d() in r600_dri.so (0x7c6114a8)
  5 0xf6bd7b04 _ZN4llvm17LLVMTargetMachine22addCommonCodeGenPassesERNS_15PassManagerBaseENS_10CodeGenOpt5LevelEbRPNS_9MCContextE+0x23() in r600_dri.so (0x7c6114a8)
  6 0xf6bd842c _ZN4llvm17LLVMTargetMachine26addPassesToEmitMachineCodeERNS_15PassManagerBaseERNS_14JITCodeEmitterENS_10CodeGenOpt5LevelEb+0x4b() in r600_dri.so (0x7c6114a8)
  7 0xf695fe11 _ZN4llvm3JITC1EPNS_6ModuleERNS_13TargetMachineERNS_13TargetJITInfoEPNS_16JITMemoryManagerENS_10CodeGenOpt5LevelEb+0x210() in r600_dri.so (0x7c6114a8)
  8 0xf695fa0f _ZN4llvm3JIT9createJITEPNS_6ModuleEPSsPNS_16JITMemoryManagerENS_10CodeGenOpt5LevelEbPNS_13TargetMachineE+0x8e() in r600_dri.so (0x7c640cec)
  9 0xf69751fa _ZN4llvm13EngineBuilder6createEv+0x159() in r600_dri.so (0x00000000)
Comment 1 Michel Dänzer 2011-10-14 09:11:06 UTC
Only LLVM in the backtrace, reassigning to core for now.

Maybe the environment variable DRAW_USE_LLVM=0 could work around the problem, but I'm not sure which Wine process you'd need to set that for...
Comment 2 Jose Fonseca 2011-10-14 10:10:24 UTC
I can't see how this would fail at this point.

It seems like a generic memory corruption...
Comment 3 Marc Bessieres 2011-11-26 02:53:13 UTC
Created attachment 53862 [details]
Xorg log
Comment 4 Marc Bessieres 2011-11-26 02:57:41 UTC
I have the same bug with all the games I tried with wine since I have updated my Opensuse Tumbleweed to 12.1.
I put in attachment the Xorg.0.log in order to have the version of the X server and the drivers.

Without the variable I have the crash, and with the variable it works fine:

guest@linux-30so:/essai/drive_c/Program Files/Microids/Egypte 3> unset DRAW_USE_LLVM
guest@linux-30so:/essai/drive_c/Program Files/Microids/Egypte 3> ~/wine-git/wine Game.exe                                                                                                                                        
fixme:ntoskrnl:KeInitializeTimerEx stub: 0x110fe8 0                                                                                                                                                                              
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels                                                                                                                
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels                                                                                                                
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels                                                                                                                
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels                                                                                                                
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels                                                                                                                
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels                                                                                                                
fixme:winmm:MXD_GetControlDetails What should the sw-side mixer controls map to?                                                                                                                                                 
wine: Unhandled page fault on read access to 0xffffffff at address 0x7d44b87d (thread 0009), starting debugger...                                                                                                                
Unhandled exception: page fault on read access to 0xffffffff in 32-bit code (0x7d44b87d).                                                                                                                                        
Register dump:                                                                                                                                                                                                                   
 CS:0073 SS:007b DS:007b ES:007b FS:0033 GS:003b                                                                                                                                                                                 
 EIP:7d44b87d ESP:0033ea38 EBP:7d73aff4 EFLAGS:00210246(  R- --  I  Z- -P- )                                                                                                                                                     
 EAX:7c5fff2c EBX:7c4cf8d0 ECX:7c5f5b18 EDX:00000000                                                                                                                                                                             
 ESI:00000000 EDI:7c4cf8a8                                                                                                                                                                                                       
Stack dump:                                                                                                                                                                                                                      
0x0033ea38:  7c5f5b18 00000000 0033ea6c 7c600fcc                                                                                                                                                                                 
0x0033ea48:  7d73aff4 7c600008 7c5f5b08 7c4bfb68                                                                                                                                                                                 
0x0033ea58:  b75dbff4 b74e2df3 7d4b5e95 7c5f5a98                                                                                                                                                                                 
0x0033ea68:  b75dbff4 7c5f5a98 00000000 00000020                                                                                                                                                                                 
0x0033ea78:  00000020 7d6271ef 00000020 b74e6ee1                                                                                                                                                                                 
0x0033ea88:  00000020 7ca76d05 7c625770 7caa8ff4                                                                                                                                                                                 
Backtrace:                                                                                                                                                                                                                       
=>0 0x7d44b87d _ZN4llvm12PassRegistry21registerAnalysisGroupEPKvS2_RNS_8PassInfoEbb+0x2dd() in r600_dri.so (0x7d73aff4)                                                                                                          
  1 0x7d322d1b _ZN4llvm18initializeNoAAPassERNS_12PassRegistryE+0x11a() in r600_dri.so (0x7d77213c)                                                                                                                              
  2 0x7d2da568 _ZN4llvm36initializeAliasAnalysisAnalysisGroupERNS_12PassRegistryE+0x47() in r600_dri.so (0x7c4c02c8)                                                                                                             
  3 0x7d36c3cb _ZN4llvm36initializeTypeBasedAliasAnalysisPassERNS_12PassRegistryE+0x4a() in r600_dri.so (0x7c4c02c8)                                                                                                             
  4 0x7d36c54e _ZN4llvm32createTypeBasedAliasAnalysisPassEv+0x6d() in r600_dri.so (0x7c5f5cc8)                                                                                                                                   
  5 0x7d0bce44 _ZN4llvm17LLVMTargetMachine22addCommonCodeGenPassesERNS_15PassManagerBaseENS_10CodeGenOpt5LevelEbRPNS_9MCContextE+0x23() in r600_dri.so (0x7c5f5cc8)                                                              
  6 0x7d0bd76c _ZN4llvm17LLVMTargetMachine26addPassesToEmitMachineCodeERNS_15PassManagerBaseERNS_14JITCodeEmitterENS_10CodeGenOpt5LevelEb+0x4b() in r600_dri.so (0x7c5f5cc8)                                                     
  7 0x7ce44a71 _ZN4llvm3JITC1EPNS_6ModuleERNS_13TargetMachineERNS_13TargetJITInfoEPNS_16JITMemoryManagerENS_10CodeGenOpt5LevelEb+0x210() in r600_dri.so (0x7c5f5cc8)                                                             
  8 0x7ce4466f _ZN4llvm3JIT9createJITEPNS_6ModuleEPSsPNS_16JITMemoryManagerENS_10CodeGenOpt5LevelEbPNS_13TargetMachineE+0x8e() in r600_dri.so (0x7c6255f4)                                                                       
  9 0x7ce59d1a _ZN4llvm13EngineBuilder6createEv+0x159() in r600_dri.so (0x00000000)                                                                                                                                              
0x7d44b87d _ZN4llvm12PassRegistry21registerAnalysisGroupEPKvS2_RNS_8PassInfoEbb+0x2dd in r600_dri.so:                                                                                                                            


With the variable
guest@linux-30so:/essai/drive_c/Program Files/Microids/Egypte 3> DRAW_USE_LLVM=0 ~/wine-git/wine Game.exe 
fixme:ntoskrnl:KeInitializeTimerEx stub: 0x110fe8 0
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels
fixme:alsa:AudioClient_GetMixFormat Don't know what to do with 10000 channels, pretending there's only 2 channels
fixme:winmm:MXD_GetControlDetails What should the sw-side mixer controls map to?
fixme:win:EnumDisplayDevicesW ((null),0,0x33f714,0x00000000), stub!
fixme:d3d:swapchain_init Add OpenGL context recreation support to context_validate_onscreen_formats
fixme:d3d:wined3d_device_decref Device released with resources still bound, acceptable but unexpected.
fixme:d3d:wined3d_device_decref Leftover resource 0x12fe58 with type WINED3DRTYPE_SURFACE (0x1).
fixme:win:EnumDisplayDevicesW ((null),0,0x33f710,0x00000000), stub!
fixme:ddraw:DirectDrawEnumerateExA flags 0x00000007 not handled
fixme:win:EnumDisplayDevicesW ((null),0,0x33e79c,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x33ebd4,0x00000000), stub!
fixme:d3d:swapchain_init Add OpenGL context recreation support to context_validate_onscreen_formats


If anyone has any idea on what I could do to give more information, more trace, I will try my best.
Comment 5 Henri Verbeet 2012-01-28 10:04:05 UTC
For what it's worth, all the cases of this bug that I've seen were on SUSE. I suppose this could be a packaging issue.
Comment 6 Marcus Meissner 2012-02-16 03:05:10 UTC
I opened suse bug:

https://bugzilla.novell.com/show_bug.cgi?id=747333

if you could install Mesa-debuginfo and Mesa-debugsource 
and get the baclktrace again?
Comment 7 Rafał Miłecki 2012-02-26 03:18:45 UTC
I'm also openSUSE 12.1 user and I experience the same problem, it's just Diablo II instead of Civilization in my case. When I let Mesa use LLVM, Diablo II crashes before even displaying anything, it was reported at Wine bugzilla: http://bugs.winehq.org/show_bug.cgi?id=14348
Workaround is to use DRAW_USE_LLVM=0.

I suspected some Mesa packaging issue, so I've switched to Mesa git and self-compiled it, but this didn't help.

Then I decided to downgrade LLVM. I've compiled & installed version 2.8 (instead of 3.0 provided by openSUSE) and then recompiled Mesa (same commit and config). It worked!

It seems there is some problem when using LLVM 3.0 with Wine. I guess we should try to find the regression in LLVM, however it will take a lot of time (llvm doesn't use git - no "git bisect" and I've to recompile Mesa every time I recompile llvm).
Comment 8 Henri Verbeet 2012-02-29 14:35:03 UTC
Note that https://bugs.freedesktop.org/show_bug.cgi?id=44466 / https://bugs.archlinux.org/task/27645 looks somewhat similar, although with a different backtrace and distribution. A comment in the Arch bug claims that compiling Mesa with -O1 instead of the default -O2 makes the bug go away.
Comment 9 Jose Fonseca 2012-03-01 00:07:13 UTC
(In reply to comment #7)
> I'm also openSUSE 12.1 user and I experience the same problem, it's just Diablo
> II instead of Civilization in my case. When I let Mesa use LLVM, Diablo II
> crashes before even displaying anything, it was reported at Wine bugzilla:
> http://bugs.winehq.org/show_bug.cgi?id=14348
> Workaround is to use DRAW_USE_LLVM=0.
> 
> I suspected some Mesa packaging issue, so I've switched to Mesa git and
> self-compiled it, but this didn't help.
> 
> Then I decided to downgrade LLVM. I've compiled & installed version 2.8
> (instead of 3.0 provided by openSUSE) and then recompiled Mesa (same commit and
> config). It worked!
> 
> It seems there is some problem when using LLVM 3.0 with Wine. I guess we should
> try to find the regression in LLVM, however it will take a lot of time (llvm
> doesn't use git - no "git bisect" and I've to recompile Mesa every time I
> recompile llvm).

There is a LLVM git mirror: http://llvm.org/git/llvm.git

Is it possible that wine is doing OpenGL rendering from multiple threads? LLVM is not very thread safe at the moment.
Comment 10 Jose Fonseca 2012-03-01 00:12:47 UTC
Brian reminded me that this could be related to the LLVM 3.0's elimination of LLVMInvalidateStructLayout()

A good thing to try is to replace all LLVMStructCreateNamed() calls with ordinary LLVMStructType(), as we don't use recursive types.

I'll provide a patch for that later on.
Comment 11 Jose Fonseca 2012-03-01 00:19:32 UTC
Hmm, I'm mixing  u(In reply to comment #10)
> Brian reminded me that this could be related to the LLVM 3.0's elimination of
> LLVMInvalidateStructLayout()
> 
> A good thing to try is to replace all LLVMStructCreateNamed() calls with
> ordinary LLVMStructType(), as we don't use recursive types.
> 
> I'll provide a patch for that later on.

I'm mixing up bugs. This comment only applies to bug 44466.

This one seems different, and probably the best thing to do is to bisect.
Comment 12 Henri Verbeet 2012-03-01 02:23:09 UTC
(In reply to comment #9)
> Is it possible that wine is doing OpenGL rendering from multiple threads? LLVM
> is not very thread safe at the moment.
We do use GL from multiple threads, depending on the application, but typically that means rendering from one thread and doing resource updates from others.
Comment 13 Iaroslav Andrusyak 2012-03-01 04:12:25 UTC
I confirm this bug, i try build mesa-git with standart static llvm-3.0 from opensuse and all DirectX games is unable to start. Now I use mesa-git and llvm-svn shared and do not have problems with DirectX games.
Comment 14 Rafał Miłecki 2012-03-01 08:23:27 UTC
I've bisected LLVM to find the first bad commit. This resulted (in twice confirmed) commit:

commit 42634836e999dfcb59f1f5ea50dfd33442be4b9a
Author: Eric Christopher <echristo@apple.com>
Date:   Fri Sep 16 20:36:16 2011 +0000

    Have the llvm configure process look for clang, then llvm-gcc, and then gcc
    on all platforms.
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139934 91177308-0d34-0410-b5e6-96231b3b80d8

I've reported issue on the llvm bugzilla: http://llvm.org/bugs/show_bug.cgi?id=12151

Not sure what else I can do to help fixing this bug. Any more info you need from me?
Comment 15 Henri Verbeet 2012-03-01 09:26:06 UTC
Does that mean it ends up using Clang to compile llvm and then linking it with gcc compiled Mesa?
Comment 16 vincent 2012-03-01 12:36:44 UTC
I think it is the case.
Opensuse build llvm with a 3 stage process :
At stage 1, it builds llvm + clang with gcc,
At stage 2 it builds llvm + clang with the gcc created clang,
At stage 3 it rebuilds llvm + clang with the clang created clang.

IMHO before the incriminated commit the configure script didn't properly pick clang in the PATH and then the 3 stages were redundant, that's why it was working with LLVM 2.8 from opensuse.

However it's weird that it does only affect opensuse.
Comment 17 Henri Verbeet 2012-03-01 12:47:52 UTC
(In reply to comment #16)
> However it's weird that it does only affect opensuse.
There could be several reasons, really. I'm not sure what versions of everything most distros are currently shipping, but you don't hit this if you built r600g without llvm or didn't link with llvm 3, and probably building llvm with gcc instead of clang will avoid it as well.
Comment 18 vincent 2012-03-01 23:50:43 UTC
I still have a crash with a clang built Mesa. However the backtrace is different :

Register dump:
 CS:0073 SS:007b DS:007b ES:007b FS:0033 GS:003b
 EIP:7b0a8cef ESP:0033e698 EBP:0033e700 EFLAGS:00210212(  R- --  I   -A- - )
 EAX:7c4a8358 EBX:7bbefff4 ECX:7bbefff4 EDX:7c4a83a8
 ESI:7bbefff4 EDI:7bbd45bc
Stack dump:
0x0033e698:  00001302 00172bd8 00000000 00000000
0x0033e6a8:  00000000 00000000 00110014 00000000
0x0033e6b8:  00172bf8 00000001 7c4a8358 00000000
0x0033e6c8:  b7740ff4 0000001c b77423c0 000c54c8
0x0033e6d8:  b764cd09 b764904e 00172bd8 00000005
0x0033e6e8:  7c33ab38 b77423c0 0000001c 7bbefff4
Backtrace:
fixme:dbghelp_dwarf:compute_location Unhandled attr op: d4
fixme:dbghelp_dwarf:compute_location Only supporting one breg (edi/24 -> st5/133)
fixme:dbghelp_dwarf:compute_location Unhandled attr op: 1
=>0 0x7b0a8cef dri_create_context+0x2f(api=<is not available>, visual=<has been optimized away by compiler>, cPriv=<is not available>, major_version=<is not available>, minor_version=<is not available>, flags=0, error=0x0(nil), sharedContextPrivate=0x0(nil)) [/home/vlj/mesa-8.0.1/src/gallium/state_trackers/dri/sw/dri_context.c:68] in swrast_dri.so (0x0033e700)
fixme:dbghelp_dwarf:compute_location Unhandled attr op: 0
fixme:dbghelp_dwarf:compute_location Unhandled attr op: 0
fixme:dbghelp_dwarf:compute_location Unhandled attr op: 0
  1 0x7b0a59bf driCreateContextAttribs+0x10e(screen=<has been optimized away by compiler>, api=<has been optimized away by compiler>, config=<has been optimized away by compiler>, shared=<is not available>, num_attribs=<internal error>, attribs=<internal error>, error=<has been optimized away by compiler>, data=<has been optimized away by compiler>) [/home/vlj/mesa-8.0.1/src/gallium/targets/dri-swrast/../../../../src/mesa/drivers/dri/common/drisw_util.c:178] in swrast_dri.so (0x0033e750)
fixme:dbghelp_dwarf:compute_location Unhandled attr op: 0
fixme:dbghelp_dwarf:compute_location Unhandled attr op: 0
fixme:dbghelp_dwarf:compute_location Unhandled attr op: 0
fixme:dbghelp_dwarf:compute_location Unhandled attr op: 9e
  2 0x7b0a5572 driCreateNewContext+0x51(psp=0x33e758, config=0x33e758, shared=0x33e758, data=0x33e758) [/home/vlj/mesa-8.0.1/src/gallium/targets/dri-swrast/../../../../src/mesa/drivers/dri/common/drisw_util.c:195] in swrast_dri.so (0x0033e780)
fixme:dbghelp_dwarf:compute_location Unhandled attr op: c8
  3 0x7d4ddc33 drisw_create_context+0xd2(base=<is not available>, config_base=<has been optimized away by compiler>, shareList=<internal error>, renderType=0x33e788) [/home/vlj/mesa-8.0.1/src/glx/drisw_glx.c:404] in libgl.so.1 (0x0033e7b0)
fixme:dbghelp_dwarf:compute_location Unhandled attr op: c7
fixme:dbghelp_dwarf:compute_location Unhandled attr op: 0
  4 0x7d4b8453 CreateContext+0x92(dpy=<is not available>, generic_id=<internal error>, config=<is not available>, shareList_user=<is not available>, allowDirect=<is not available>, code=<is not available>, renderType=<has been optimized away by compiler>, screen=<is not available>) [/home/vlj/mesa-8.0.1/src/glx/glxcmds.c:276] in libgl.so.1 (0x0033e7f0)
fixme:dbghelp_dwarf:compute_location Unhandled attr op: d1
  5 0x7d4b83ac glXCreateContext+0xcb(dpy=<internal error>, vis=<is not available>, shareList=<has been optimized away by compiler>, allowDirect=<has been optimized away by compiler>) [/home/vlj/mesa-8.0.1/src/glx/glxcmds.c:381] in libgl.so.1 (0x0033e840)
  6 0x7df03db2 in winex11 (+0x43db1) (0x00000015)
  7 0x7df08105 in winex11 (+0x48104) (0x00000015)
  8 0x7e9490a2 wglCreateContext+0x61() in gdi32 (0x01d04068)
  9 0x7d540bab in wined3d (+0x30baa) (0x01d04068)
  10 0x7d5e3ace in wined3d (+0xd3acd) (0x00000048)
  11 0x7d5e401f wined3d_swapchain_create+0x7e() in wined3d (0x0033ed98)
  12 0x7d65997f in ddraw (+0x997e) (0x0033ec40)
  13 0x7d551de8 wined3d_device_init_3d+0x237() in wined3d (0x0016a188)
  14 0x7d65cbdd in ddraw (+0xcbdc) (0x00133278)
  15 0x7d65df89 in ddraw (+0xdf88) (0x00000000)
0x7b0a8cef dri_create_context+0x2f [/home/vlj/mesa-8.0.1/src/gallium/state_trackers/dri/sw/dri_context.c:68] in swrast_dri.so: 
68         memset(&attribs, 0, sizeof(attribs));


Clang is more strict about C compliance (I experienced crashes because of a uninitialized pointer that passed with gcc) so this output should be taken with a grain of salt as it might be unrelated to the current bug.

I'm attaching valgrinds report with clang built mesa and gcc built mesa.
Comment 19 vincent 2012-03-01 23:51:29 UTC
Created attachment 57892 [details]
valgrind report using clang built mesa 8.0.1
Comment 20 vincent 2012-03-01 23:52:09 UTC
Created attachment 57893 [details]
valgrind report using gcc built mesa 8.0.1 (and clang built llvm)
Comment 21 Johannes Obermayr 2012-03-03 10:40:56 UTC
(In reply to comment #19)
> Created attachment 57892 [details]
> valgrind report using clang built mesa 8.0.1

How did you compile mesa with clang?

Did you set "CC=clang" and "CXX=clang++"?

I am just wondering because I get errors in core parts:
http://llvm.org/bugs/attachment.cgi?id=8140
Comment 22 Laurent carlier 2012-03-15 16:06:18 UTC
(In reply to comment #10)
> Brian reminded me that this could be related to the LLVM 3.0's elimination of
> LLVMInvalidateStructLayout()
> 
> A good thing to try is to replace all LLVMStructCreateNamed() calls with
> ordinary LLVMStructType(), as we don't use recursive types.
> 
> I'll provide a patch for that later on.

Any news about this patch ?
Comment 23 Jose Fonseca 2012-05-16 08:11:16 UTC
Created attachment 61717 [details] [review]
patch w/ workaround attempt
Comment 24 Jose Fonseca 2012-05-16 08:12:33 UTC
Please re-try with latest master which includes

commit 9af1ba565dfd5cef9ee938bb7c04767d14878fbf
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed May 16 15:00:23 2012 +0100

    draw,llvmpipe: Avoid named struct types on LLVM 3.0 and later.
    
    Starting with LLVM 3.0, named structures are meant not for debugging, but
    for recursive data types, previously also known as opaque types.
    
    The recursive nature of these types leads to several memory management
    difficulties.  Given that we don't actually need recursive types, avoid
    them altogether.
    
    This is an attempt to address fdo bugs 41791 and 44466. The issue is
    somewhat random so there's no easy way to check how effective this is.


And if that doesn't work, try the attached path w/ another workaround attempt.
Comment 25 Jose Fonseca 2012-05-19 04:23:23 UTC
Merging with bug 44466. Seems the same issue.

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


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.