http://bugs.winehq.org/show_bug.cgi?id=26763
Summary: Wolfenstein: crashes on start Product: Wine Version: 1.3.17 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: sa@whiz.se
Created an attachment (id=34086) --> (http://bugs.winehq.org/attachment.cgi?id=34086) Log of crash
Hi,
I'm trying to get the game Wolfenstein running with Wine, a title which according to the appdb entry should be well supported.
Unfortunately I'm getting nowhere, the game crashes directly after the splash screen appears, and I don't even get a backtrace...
wine: Unhandled page fault on read access to 0x00000000 at address 0x10185da4 (thread 0009), starting debugger... fixme:dbghelp_dwarf:dwarf2_lookup_type Unable to load forward reference for tag 26 fixme:dbghelp_dwarf:dwarf2_lookup_type Unable to load forward reference for tag 26 fixme:dbghelp_dwarf:dwarf2_lookup_type Unable to load forward reference for tag 26 Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x10185da4).
Full log is attached.
If I use winedbg I also get these messages:
wine client error:26: write: Bad file descriptor Inconsistency detected by ld.so: dl-open.c: 221: dl_open_worker: Assertion `_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT' failed!
If I try the multiplayer binary instead, I get an error dialog "Error creating game rendering context", and a console with these warnings:
WARNING: idRenderContextWGL::Create : wglChoosePixelFormatARB failed to find a suitable format. WARNING: idRenderContextWGL::Create : wglChoosePixelFormatARB failed to find a suitable format.
After some googling, I found bug 9186 which mentions the same error in game using the same engine, so I made another log with WINEDEBUG=+wgl.
For graphics I use Mesa with the r300g driver (tried both 7.10 and using git) which I guess could be the cause of the problem. If so it would be great to know what the problem is, so I can file a bug with the Mesa devs.
I'm using Wine 1.3.17 (tried both the Ubuntu packages and compiling myself) in a clean wineprefix (the only addition is native d3dx9_39.dll for GetShaderConstantTableEx support) on Debian unstable 32-bit.
The game is updated to version 1.11 and Securom worked around with a patched binary.
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #1 from Sven Arvidsson sa@whiz.se 2011-04-13 12:10:13 CDT --- Created an attachment (id=34087) --> (http://bugs.winehq.org/attachment.cgi?id=34087) wgl trace
http://bugs.winehq.org/show_bug.cgi?id=26763
Sven Arvidsson sa@whiz.se changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |opengl Summary|Wolfenstein: crashes on |Wolfenstein / ETQW: "Error |start |creating game rendering | |context" with Mesa
--- Comment #2 from Sven Arvidsson sa@whiz.se 2011-04-14 12:12:03 CDT --- I just gave the ETQW demo a try, and I'm getting the same error, "Error creating game rendering context"
It would be interesting to know if this is a regression, or if it still works with drivers from Nvidia or ATI?
I'm reassigning the bug to the opengl component, I hope that's correct.
http://bugs.winehq.org/show_bug.cgi?id=26763
Roderick Colenbrander thunderbird2k@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |thunderbird2k@gmail.com
--- Comment #3 from Roderick Colenbrander thunderbird2k@gmail.com 2011-04-16 21:37:09 CDT --- The single and multiplayer binaries should be considered two different games. The single player version is a Direct3D game and for some reason there is a crash inside game code (perhaps driver related, but hard to say).
The multiplayer version is in fact an OpenGL game and for that one a +wgl log could help. The unable to find a pixel format error could be a bug in the wine WGL layer, but it may also reveal a bug in the Mesa GLX layer.
http://bugs.winehq.org/show_bug.cgi?id=26763
Sven Arvidsson sa@whiz.se changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #34087|0 |1 is obsolete| |
--- Comment #4 from Sven Arvidsson sa@whiz.se 2011-04-18 14:08:51 CDT --- Created an attachment (id=34172) --> (http://bugs.winehq.org/attachment.cgi?id=34172) wgl log from wolf2mp
(In reply to comment #3)
The single and multiplayer binaries should be considered two different games. The single player version is a Direct3D game and for some reason there is a crash inside game code (perhaps driver related, but hard to say).
The multiplayer version is in fact an OpenGL game and for that one a +wgl log could help. The unable to find a pixel format error could be a bug in the wine WGL layer, but it may also reveal a bug in the Mesa GLX layer.
Oh, I see. In that case, let's focus on the OpenGL issues. I'm attaching +wgl logs from both Wolf2MP.exe and the ETQW demo.
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #5 from Sven Arvidsson sa@whiz.se 2011-04-18 14:09:14 CDT --- Created an attachment (id=34173) --> (http://bugs.winehq.org/attachment.cgi?id=34173) wgl log from etqw demo
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #6 from Roderick Colenbrander thunderbird2k@gmail.com 2011-04-18 15:52:06 CDT --- I had quick glance but don't see anything suspicious on the opengl side in those logs. The last calls in the log are to dxdiag / devenum, so perhaps it is something related to that.
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #7 from Henri Verbeet hverbeet@gmail.com 2011-04-18 16:54:00 CDT --- For the ETQW issue, does the native Linux version work? IIRC that one is supposed to work with r300g, provided you have the necessary s3tc bits setup. If the native linux version is broken as well it may make more sense to try to get that fixed first, but if it isn't I suppose it makes sense to look at this from the Wine side.
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #8 from Sven Arvidsson sa@whiz.se 2011-04-18 17:10:25 CDT --- The native version is working fine.
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #9 from Sven Arvidsson sa@whiz.se 2011-04-22 09:14:23 CDT --- Not sure how relevant this is but:
Forcing software rendering with LIBGL_ALWAYS_SOFTWARE=1 makes no difference.
According to the game log, only 64 MB of video memory is detected, manually setting the correct value in VideoMemorySize makes no difference.
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #10 from Sven Arvidsson sa@whiz.se 2011-04-23 11:37:42 CDT --- Just FYI Wolfenstein singleplayer started working. I did a quick bisect and it seems this is the commit fixing things: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e28d842d192e69ba8cae4f9754...
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #11 from Sven Arvidsson sa@whiz.se 2011-04-24 16:03:53 CDT --- Turns out this is a regression, both ETQW and Wolfenstein MP is working with 1.1.32. I'm going to try bisecting to find the regression when I have more time.
Guess I got confused when I first looked up Wolfenstein in AppDB and saw it was rated platinum. But on closer examination most submitters haven't tried running the multiplayer version.
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #12 from Sven Arvidsson sa@whiz.se 2011-04-26 14:37:39 CDT --- The winner is:
e7590fcfb51bb149a6cf8272f5576861f2193183 is the first bad commit commit e7590fcfb51bb149a6cf8272f5576861f2193183 Author: Roderick Colenbrander thunderbird2k@gmail.com Date: Fri Nov 13 12:28:48 2009 +0100
wgl: Make sure we set a valid value for GLX_DRAWABLE_TYPE. Right now we default to 0 which is illegal.
:040000 040000 18c42aa22adede3c11c377d311dd9e1ed90a38ad 6988f46168fb6b19f72688f7e0984f9d29e3eb06 M dlls
I confirmed this by commenting out this change from git master, and without it both ETQW and Wolfenstein multiplayer runs.
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #13 from Roderick Colenbrander thunderbird2k@gmail.com 2011-04-26 18:30:40 CDT --- This part of the log clearly shows the 'failure': trace:wgl:ConvertAttribWGLtoGLX pAttr[0] = 2010 trace:wgl:ConvertAttribWGLtoGLX pAttr[1] = WGL_SUPPORT_OPENGL_ARB: 1 trace:wgl:ConvertAttribWGLtoGLX pAttr[2] = 2015 trace:wgl:ConvertAttribWGLtoGLX pAttr[3] = GLX_RED_SIZE: 8 trace:wgl:ConvertAttribWGLtoGLX pAttr[4] = 2017 trace:wgl:ConvertAttribWGLtoGLX pAttr[5] = GLX_GREEN_SIZE: 8 trace:wgl:ConvertAttribWGLtoGLX pAttr[6] = 2019 trace:wgl:ConvertAttribWGLtoGLX pAttr[7] = GLX_BLUE_SIZE: 8 trace:wgl:ConvertAttribWGLtoGLX pAttr[8] = 201b trace:wgl:ConvertAttribWGLtoGLX pAttr[9] = GLX_ALPHA_SIZE: 8 trace:wgl:ConvertAttribWGLtoGLX pAttr[10] = 2022 trace:wgl:ConvertAttribWGLtoGLX pAttr[11] = GLX_DEPTH_SIZE: 24 trace:wgl:ConvertAttribWGLtoGLX pAttr[12] = 2023 trace:wgl:ConvertAttribWGLtoGLX pAttr[13] = GLX_STENCIL_SIZE: 8 trace:wgl:ConvertAttribWGLtoGLX pAttr[14] = 2011 trace:wgl:ConvertAttribWGLtoGLX pAttr[15] = GLX_DOUBLEBUFFER: 1 trace:wgl:ConvertAttribWGLtoGLX pAttr[?] = GLX_DRAWABLE_TYPE: 0xffffffff trace:wgl:ConvertAttribWGLtoGLX pAttr[?] = GLX_RENDER_TYPE: 0xffffffff warn:wgl:X11DRV_wglChoosePixelFormatARB Compatible Pixel Format not found
I have an idea on what's wrong though and after another read of the GLX specs, I think it is a Mesa bug. Just in case can you attach the output of 'glxinfo -c'?
ConvertAttribWGLtoGLX is used as part of wglChoosePixelFormatARB which the game uses to select a 'pixel format' to use for its OpenGL window. In Wine we use glXChooseFBConfig to implement this call. In case of WGL if you don't specify a 'drawable type' it returns formats for all types of drawables it can support (window, bitmap, pbuffer), but GLX only returns info for windows. If I remember correctly this patch was for a part needed to make fglrx happy and to make things more correctly.
The problem is that Mesa doesn't like me passing in '0xffffffff' as the GLX_DRAWABLE_TYPE (actually it dislikes RENDER_TYPE of 0xffffffff as well). In the end Mesa does about the following in its fbconfig checking:
for(i=0; i<config_list_size; i++) fbconfigs_compatible(requested_config, config_list[i]);
static int fbconfigs_compatible(config *a, config *b) { ... MATCH_EXACT(level);
MATCH_MASK(drawableType); MATCH_MASK(renderType); ... }
where MATCH_MASK: #define MATCH_MASK(param) do { if ((a->param & ~b->param) != 0) return False; } while (0);
The problem is that the configurations in config_list have at max a few bits set (e.g. GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT) while I'm passing in ~0 (which is equal to GLX_DONT_CARE). Because a different number of bits is set in a->param and b->param, MATCH_MASK fails and no configuration gets selected.
There are two things in the GLX specs. First of all it mentions that when you pass a bitmask to glXChooseFBConfig ALL bits set in the mask have to match. The second thing it mentions is that if GLX_DONT_CARE is specified as a value for one of the attributes (which is the case here), the option in question should be ignored.
Some of the other MATCH_ macros in Mesa check for GLX_DONT_CARE, but not the MATCH_MASK one, so I would guess the bug is there but I don't have a Mesa system to test on. I could write a quick test app. (I could also just not set GLX_RENDER_TYPE / GLX_DRAWABLE_TYPE when either of the two is 0, but not sure what sort of issues that may cause ..)
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #14 from Sven Arvidsson sa@whiz.se 2011-04-27 06:22:16 CDT --- Created an attachment (id=34372) --> (http://bugs.winehq.org/attachment.cgi?id=34372) glxinfo -v output
Hmm, glxinfo doesn't have a "-c" option, at least not on my system, did you mean "-v"?
As for the rest, I'm afraid I'm in over my head. Could you or Henri bring it up with the Mesa devs directly?
http://bugs.winehq.org/show_bug.cgi?id=26763
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression CC| |wylda@volny.cz
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #15 from Sven Arvidsson sa@whiz.se 2011-06-28 10:41:24 CDT --- By the way, instead of a test app, it might be possible to use apitrace to trace the start of either of the games with a working driver and get a reproducible testcase for the Mesa devs that way: https://github.com/apitrace/apitrace
I might try this myself if I ever try out fglrx.
http://bugs.winehq.org/show_bug.cgi?id=26763
Henri Verbeet hverbeet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |e7590fcfb51bb149a6cf8272f55 | |76861f2193183
http://bugs.winehq.org/show_bug.cgi?id=26763
MD.IMAM HOSSAIN imamdxl8805@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |imamdxl8805@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #16 from MD.IMAM HOSSAIN imamdxl8805@gmail.com 2011-08-14 00:44:52 CDT --- Same here for Intel GMA 4500 Mesa 7.12-devel with WINE 1.3.26
if I remove commit
e7590fcfb51bb149a6cf8272f5576861f2193183
wgl: Make sure we set a valid value for GLX_DRAWABLE_TYPE. Right now we default to 0 which is illegal.
then the game works.
http://bugs.winehq.org/show_bug.cgi?id=26763
--- Comment #17 from Sven Arvidsson sa@whiz.se 2012-03-18 12:57:23 CDT --- (In reply to comment #15)
By the way, instead of a test app, it might be possible to use apitrace to trace the start of either of the games with a working driver and get a reproducible testcase for the Mesa devs that way: https://github.com/apitrace/apitrace
I might try this myself if I ever try out fglrx.
Doing this with apitrace didn't work. The few frames I managed to trace did play back with Mesa so it was useless as a way of reproducing the bug.
I decided to file a bug with Mesa anyway: https://bugs.freedesktop.org/show_bug.cgi?id=47478
http://bugs.winehq.org/show_bug.cgi?id=26763
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com See Also| |https://bugs.freedesktop.or | |g/show_bug.cgi?id=47478
http://bugs.winehq.org/show_bug.cgi?id=26763
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |UPSTREAM
--- Comment #18 from Alexandre Julliard julliard@winehq.org 2013-07-02 04:08:30 CDT --- Upstream bug then.
http://bugs.winehq.org/show_bug.cgi?id=26763
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #19 from Jerome Leclanche adys.wh@gmail.com 2013-07-02 05:33:28 CDT --- Fixed upstream by 9cda3560048e8595d3ffa315b76487f4479bff2c according to the bug.
http://bugs.winehq.org/show_bug.cgi?id=26763
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|regression | Regression SHA1|e7590fcfb51bb149a6cf8272f55 | |76861f2193183 |