http://bugs.winehq.org/show_bug.cgi?id=36506
Bug ID: 36506 Summary: Wolfenstein - The New Order fails to start Product: Wine Version: 1.7.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: opengl Assignee: wine-bugs@winehq.org Reporter: mail@dasprids.de
Created attachment 48581 --> http://bugs.winehq.org/attachment.cgi?id=48581 Stack trace
Just tried running Wolfenstein - The New Order on the latest Wine version. As this game only exists as 64-bit binary, this only affects wine-amd64. I'm not really good at reading stack traces, but if I read this correc,t glGetString() in opengl32 is crashing. See attached stack trace.
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #1 from dasprid mail@dasprids.de --- Just as a side-note: The new Wolfenstein is using the same engine as Rage, which (at least in 32bit) runs just fine on Wine.
http://bugs.winehq.org/show_bug.cgi?id=36506
Lam winehq@lam.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winehq@lam.pl
--- Comment #2 from Lam winehq@lam.pl --- Created attachment 48582 --> http://bugs.winehq.org/attachment.cgi?id=48582 run with WINEDEBUG=+opengl,+relay,+wgl
Same here. Here's output from a run with WINEDEBUG=+opengl,+relay,+wgl
Looks like it creates window and stuff so shouldn't have problems with glGetString, and yet it still does.
http://bugs.winehq.org/show_bug.cgi?id=36506
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |win64 Status|UNCONFIRMED |NEW CC| |focht@gmx.net Summary|Wolfenstein - The New Order |Wolfenstein - The New Order |fails to start |fails to start | |(glGetString(GL_VENDOR) | |without a current WGL | |context) Ever confirmed|0 |1
--- Comment #3 from Anastasius Focht focht@gmx.net --- Hello folks,
the game calls 'glGetString(GL_VENDOR)' on a secondary thread without a current WGL context.
There is no previous call to 'wglMakeCurrent' hence the TEB GL function pointer table pointer is obviously not set. Anything doing 'funcs->gl.ptr( ...)' will crash.
--- snip --- $ pwd /home/focht/wine-games/wineprefix-wothneor/wineprefix/drive_c/Program Files (x86)/Wolfenstein The New Order
$ WINEDEBUG=+tid,+seh,+relay,+wgl,+debugstr wine ./WolfNewOrder_x64.exe
log.txt 2>&1
... 0009:Call KERNEL32.OutputDebugStringA(0c1ca360 "CreateOpenGLContextForCurrentThread: Assuming pre-checked Graphics Vendor: "NVIDIA Corporation"\n") ret=1409c8e54 0009:warn:debugstr:OutputDebugStringA "CreateOpenGLContextForCurrentThread: Assuming pre-checked Graphics Vendor: "NVIDIA Corporation"\n" 0009:Ret KERNEL32.OutputDebugStringA() retval=00000000 ret=1409c8e54 0009:Call user32.CreateWindowExA(00000000,140ee7938 "wolf_CONTEXT",140ee7918 "Wolfenstein The New Order",00cf0000,00000000,100000000,00000020,00000020,00000000,00000000,140000000,00000000) ret=14046ca87 0009:Call winex11.drv.CreateDesktopWindow(00010020) ret=7f6c535ea56f 0009:Ret winex11.drv.CreateDesktopWindow() retval=00000001 ret=7f6c535ea56f ... 0009:Ret window proc 0x7f6c53538c84 (hwnd=0x10068,msg=WM_CREATE,wp=00000000,lp=0c1ce200) retval=00000000 0009:Call winex11.drv.CreateWindow(00010068) ret=7f6c535e8dd3 0009:Ret winex11.drv.CreateWindow() retval=00000001 ret=7f6c535e8dd3 0009:Ret user32.CreateWindowExA() retval=00010068 ret=14046ca87 0009:Call user32.GetDC(00010068) ret=14046caaa 0009:Call winex11.drv.GetDC(00180043,00010068,00010068,0c1ce130,0c1ce120,00000014) ret=7f6c535c26e1 0009:Ret winex11.drv.GetDC() retval=00000001 ret=7f6c535c26e1 0009:Call winex11.drv.EnumDisplayMonitors(00000000,00000000,7f6c535d2dcd,0c1ce010) ret=7f6c535bad33 0009:Ret winex11.drv.EnumDisplayMonitors() retval=00000001 ret=7f6c535bad33 0009:Ret user32.GetDC() retval=00180043 ret=14046caaa 0009:Call gdi32.SetPixelFormat(00180043,00000003,141d1e8e4) ret=14046c24a 0009:Call opengl32.wglSetPixelFormat(00180043,00000003,141d1e8e4) ret=7f6c53238c78 0009:Call gdi32.__wine_get_wgl_driver(00180043,0000000b) ret=7f6c50b3b381 0009:Ret gdi32.__wine_get_wgl_driver() retval=7f6c509bc2a0 ret=7f6c50b3b381 0009:trace:wgl:set_pixel_format (0x180043,3) 0009:trace:wgl:get_pixel_format Returning fmt_id=0x107 for iPixelFormat=3 0009:trace:wgl:set_pixel_format FBConfig have : 0009:trace:wgl:set_pixel_format - FBCONFIG_ID 0x107 0009:trace:wgl:set_pixel_format - VISUAL_ID 0x24 0009:trace:wgl:set_pixel_format - DRAWABLE_TYPE 0x7 0009:trace:wgl:set_win_format created GL drawable 4e00003 for win 0x10068 format 107 0009:Call winex11.drv.WindowPosChanging(00010068,00000000,0000181f,0c1cdf00,0c1cdef0,0c1cde70,0c1cde48) ret=7f6c535f6bb5 0009:Call winex11.drv.SystemParametersInfo(00000029,00000000,0c1cd2f0,00000000) ret=7f6c535d4ea3 0009:Ret winex11.drv.SystemParametersInfo() retval=00000000 ret=7f6c535d4ea3 0009:Ret winex11.drv.WindowPosChanging() retval=00000000 ret=7f6c535f6bb5 0009:Call winex11.drv.WindowPosChanged(00010068,00000000,0000181f,0c1cdf00,0c1cdef0,0c1cde70,00000000,00000000) ret=7f6c535f7145 0009:Ret winex11.drv.WindowPosChanged() retval=00000000 ret=7f6c535f7145 0009:Ret opengl32.wglSetPixelFormat() retval=00000001 ret=7f6c53238c78 0009:Ret gdi32.SetPixelFormat() retval=00000001 ret=14046c24a 0009:Call opengl32.glGetString(00001f00) ret=14046c8bc 0009:trace:seh:raise_exception code=c0000005 flags=0 addr=0x7f6c50b42159 ip=7f6c50b42159 tid=0009 0009:trace:seh:raise_exception info[0]=0000000000000000 0009:trace:seh:raise_exception info[1]=00000000000003f8 0009:trace:seh:raise_exception rax=0000000000000000 rbx=00000000085a60a0 rcx=0000000000001f00 rdx=00007f6c531adcb5 0009:trace:seh:raise_exception rsi=000000000c1ce380 rdi=000000000c1ce300 rbp=000000000c1ce2d0 rsp=000000000c1ce1f0 0009:trace:seh:raise_exception r8=0005006800170004 r9=0000000000000000 r10=0000000000000000 r11=0000003157381420 0009:trace:seh:raise_exception r12=0000000000000000 r13=00000000012c31e8 r14=000000000c1cf700 r15=000000014161db20 --- snip ---
I had a look at the calls following the (failing) call:
wglCreateContextAttribsARB() wglMakeCurrent()
This indicates the engine indeed assumes 'glGetString()' can be called without WGL context or it must have been implicitly created by previous SetPixelFormat().
Interestingly there is another GL render thread already set up which does all things in correct order (also calling 'glGetString(GL_VENDOR)').
--- snip --- ... 0024:Call KERNEL32.OutputDebugStringA(012becf0 "---registered context window class\n") ret=1409c8e54 0024:warn:debugstr:OutputDebugStringA "---registered context window class\n" 0024:Ret KERNEL32.OutputDebugStringA() retval=00000000 ret=1409c8e54 0024:Call user32.CreateWindowExA(00000000,140ee7580 "wolf_WGL_FAKE",140ee7560 "Wolfenstein The New Order",00cf0000,00000028,100000028,00000280,000001e0,00000000,00000000,140000000,00000000) ret=14046c5cd ... 0024:Ret user32.CreateWindowExA() retval=0001005c ret=14046c5cd 0024:Call user32.GetDC(0001005c) ret=14046c5f5 0024:Ret user32.GetDC() retval=00080039 ret=14046c5f5 0024:Call opengl32.wglCreateContext(00080039) ret=14046c601 0024:Call gdi32.__wine_get_wgl_driver(00080039,0000000b) ret=7f6c50b3b381 0024:Ret gdi32.__wine_get_wgl_driver() retval=7f6c509bc2a0 ret=7f6c50b3b381 0024:trace:wgl:glxdrv_wglCreateContext 0x80039 -> 0x85a3c00 0024:Call ntdll.RtlAllocateHeap(00010000,00000008,00000028) ret=7f6c50b3c584 0024:Ret ntdll.RtlAllocateHeap() retval=085d9020 ret=7f6c50b3c584 0024:Ret opengl32.wglCreateContext() retval=00010000 ret=14046c601 0024:Call opengl32.wglMakeCurrent(00080039,00010000) ret=14046c610 0024:trace:wgl:glxdrv_wglMakeCurrent (0x80039,0x85a3c00) 0024:trace:wgl:describeContext Context 0x85a3c00 have (vis:0x7f6c4c216120): 0024:trace:wgl:describeContext - FBCONFIG_ID 0x107 0024:trace:wgl:describeContext - VISUAL_ID 0x24 0024:trace:wgl:glxdrv_wglMakeCurrent hdc 0x80039 drawable 4800004 fmt 0x85a1d40 ctx 0x7f6c4c097ca8 0024:trace:wgl:glxdrv_wglMakeCurrent 0x80039,0x85a3c00 returning 1 0024:Ret opengl32.wglMakeCurrent() retval=00000001 ret=14046c610 0024:Call opengl32.glGetString(00001f00) ret=14046c61b 0024:Ret opengl32.glGetString() retval=3883f49cf4 ret=14046c61b 0024:Call opengl32.glGetString(00001f01) ret=14046c62d 0024:Ret opengl32.glGetString() retval=68046044 ret=14046c62d 0024:Call opengl32.glGetString(00001f02) ret=14046c63f 0024:Ret opengl32.glGetString() retval=68000080 ret=14046c63f 0024:Call KERNEL32.GetLastError() ret=140acb2cc 0024:Ret KERNEL32.GetLastError() retval=00000000 ret=140acb2cc 0024:Call KERNEL32.GetLastError() ret=140acb2cc 0024:Ret KERNEL32.GetLastError() retval=00000000 ret=140acb2cc 0024:Call KERNEL32.GetTickCount() ret=1409da649 0024:Ret KERNEL32.GetTickCount() retval=00174963 ret=1409da649 0024:Call ntdll.RtlTryEnterCriticalSection(00063b90) ret=1409de2a9 0024:Ret ntdll.RtlTryEnterCriticalSection() retval=00000001 ret=1409de2a9 0024:Call KERNEL32.WriteFile(00000274,012bed00,00000044,012bec70,00000000) ret=1409d54df 0024:Ret KERNEL32.WriteFile() retval=00000001 ret=1409d54df 0024:Call KERNEL32.OutputDebugStringA(012bed00 "GetWGLExtensionsWithFakeWindow: OpenGL Vendor: "NVIDIA Corporation"\n") ret=1409c8e54 0024:warn:debugstr:OutputDebugStringA "GetWGLExtensionsWithFakeWindow: OpenGL Vendor: "NVIDIA Corporation"\n" ... --- snip ---
Regards
https://bugs.winehq.org/show_bug.cgi?id=36506
Yuri Shishenko yurishish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |yurishish@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=36506
Andrey Gusev andrey.goosev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |andrey.goosev@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #4 from Lam winehq@lam.pl --- How does this relate to bug #13599 for example?
In that bug it's confirmed that Windows OpenGL's glGetString doesn't crash without a context, but it also says this has been worked around in Wine, so I don't get why it crashes here.
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #5 from Bruno Jesus 00cpxxx@gmail.com --- The change from bug 13599 was moved/removed between 1.5.9 and 1.5.10:
http://source.winehq.org/source/dlls/opengl32/wgl.c?v=wine-1.5.9#L1270 http://source.winehq.org/source/dlls/opengl32/wgl.c?v=wine-1.5.10#L1547
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #6 from Anastasius Focht focht@gmx.net --- Hello folks,
well Alexandre removed the workaround during restructuring of opengl. Since this issue affects only very few (broken) apps/games it simply went under the radar.
I'm surprised WTNO relies on this broken behaviour. Anyway, it can be easily worked around (add a check for 'funcs == NULL', return NULL).
The game also needs XAudio2 (bug 26808). Besides that the game works surprisingly well with Wine.
Regards
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #7 from Lam winehq@lam.pl --- I confirm the work-around resolves the crash (actually I've copied that old patch, doing an if(wglGetCurrentContext() == NULL) at function entry :))
It was kind of hard to install and make it recognize the 64-bit XAudio2, thanks for the hint in the other thread.
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #8 from Andrey Gusev andrey.goosev@gmail.com --- I not quite understand what needed to be added. Can someone make a patch for 1.7.19?
http://bugs.winehq.org/show_bug.cgi?id=36506
Anthony Mattheakakis antony256@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |antony256@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #9 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 48593 --> http://bugs.winehq.org/attachment.cgi?id=48593 patch
I think this is what Anastasius is talking about.
http://bugs.winehq.org/show_bug.cgi?id=36506
Eike Hein hein@kde.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hein@kde.org
--- Comment #10 from Eike Hein hein@kde.org --- Created attachment 48594 --> http://bugs.winehq.org/attachment.cgi?id=48594 Patch to make glGetString() do something "useful" without a context
I ran into this independently and am attaching my personal patch here for posterity only. It's not a reasonable solution since it hardcodes returning NVIDIA Corporation for GL_VENDOR if the context is null - an earlier comment suggests always returning null is good enough (and in fact, returning anything else could also send calling code down a bad path), but I wasn't sure what the game wanted the value for so I decided to return the right thing for my system at the time, and it worked for me.
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #11 from Anastasius Focht focht@gmx.net --- Hello Eike,
--- quote --- and in fact, returning anything else could also send calling code down a bad path --- quote ---
you patch might indeed turn to wrong code paths for non-nvidia. There is code following the call that specifically checks for certain vendors.
It's better to return nothing, just avoiding the crash. This worked a long time ago for multiple broken apps until Alexandre removed it (by accident I think).
The game engine already got the graphics adapter/specs before this point (see log files and +debugstr channel).
The problem is that many people mindlessly pick up patches floating around and build their own Wine versions/wrappers without understanding what it is about and possible side-effects. Then new bug reports appear in Bugzilla where one wastes time just to figure out they've applied some "custom" patches/hacks, making the report invalid.
Regards
http://bugs.winehq.org/show_bug.cgi?id=36506
Didier M. d-bugzilla@moens.cc changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |d-bugzilla@moens.cc
http://bugs.winehq.org/show_bug.cgi?id=36506
Béla Gyebrószki gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |turgut@kalfaoglu.com
--- Comment #12 from Béla Gyebrószki gyebro69@gmail.com --- *** Bug 36543 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #13 from Bruno Jesus 00cpxxx@gmail.com --- *** Bug 36543 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=36506
Julian Rüger jr98@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jr98@gmx.net
http://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #14 from Bruno Jesus 00cpxxx@gmail.com --- Most likely fixed by http://source.winehq.org/git/wine.git/?a=commit;h=b72c8a7680ad2b5bc1963f63fd...
Please retest in wine-git.
http://bugs.winehq.org/show_bug.cgi?id=36506
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |b72c8a7680ad2b5bc1963f63fd3 | |42f60ab445a41 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #15 from Anastasius Focht focht@gmx.net --- Hello folks,
this is fixed by commit http://source.winehq.org/git/wine.git/commitdiff/b72c8a7680ad2b5bc1963f63fd3...
Thanks Alexandre and Bruno for his efforts.
One-liner for the 64 bits XAudio2 issue (bug 26808):
--- snip --- cabextract -F "*.dll" "$(winepath -u "c:\Program Files (x86)\Wolfenstein The New Order\_CommonRedist\DirectX\Jun2010\Jun2010_XAudio_x64.cab")" -d "$(wine64 winepath -u "$(wine cmd /c "echo | set /p=%WINDIR%\system32")")" && wine64 regsvr32 XAudio2_7.dll --- snip ---
Regards
https://bugs.winehq.org/show_bug.cgi?id=36506
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #16 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.21.
https://bugs.winehq.org/show_bug.cgi?id=36506
hoot893@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hoot893@gmail.com
--- Comment #17 from hoot893@gmail.com --- This bug is NOT fixed on the Radeon FOSS drivers (see comments: https://appdb.winehq.org/objectManager.php?sClass=version&iId=30403&... ). I still get "FATAL ERROR: wglCreateContextAttribsARB failed".
Distro: Arch Linux Wine version: 1.9.15 Mesa version: 12.0.1 ATI driver version: 7.7.0
Let me know if you need anything else.
https://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #18 from Matteo Bruni matteo.mystral@gmail.com --- (In reply to hoot893 from comment #17)
This bug is NOT fixed on the Radeon FOSS drivers (see comments: https://appdb.winehq.org/objectManager. php?sClass=version&iId=30403&iTestingId=87553 ). I still get "FATAL ERROR: wglCreateContextAttribsARB failed".
That sounds like a different bug.
Given that apparently it fails in wglCreateContextAttribsARB for you on Mesa drivers, it's possible the game wants to create a GL 3.2+ compatibility context. If that's actually the case there isn't much we can do.
Anyway, if you want to go deeper into that, please open a new bug attaching a +tid,+wgl trace.
https://bugs.winehq.org/show_bug.cgi?id=36506
--- Comment #19 from Ken Thomases ken@codeweavers.com --- (In reply to Matteo Bruni from comment #18)
Given that apparently it fails in wglCreateContextAttribsARB for you on Mesa drivers, it's possible the game wants to create a GL 3.2+ compatibility context. If that's actually the case there isn't much we can do.
Yes, I know from testing on macOS that it does need a compatibility context. I even tried to fake it by ignoring the request for the compatibility context and giving it a core context instead, but it unsurprisingly failed when it attempted to use compatibility functionality.
https://bugs.winehq.org/show_bug.cgi?id=36506
hoot893@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|hoot893@gmail.com |