http://bugs.winehq.org/show_bug.cgi?id=12191
Summary: X11DRV_ChoosePixelFormat fails (Wing Commander: Secret Ops) Product: Wine Version: 0.9.58. Platform: PC-x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdi32 AssignedTo: wine-bugs@winehq.org ReportedBy: BurnSpamAddress@gmail.com
Created an attachment (id=11591) --> (http://bugs.winehq.org/attachment.cgi?id=11591) Stacktrace
WC: Secret Ops, segfaults when you try to select your video card, with the following error message:
"wine: Unhandled page fault on execute access to 0x00000000 at address (nil) (thread 001f), starting debugger..."
I am running on Ubuntu 7.10 (x86_64), with an Ati X1950Pro card (fglrx 8.47), and 6GB of ram.
The same error occurs on both Wine 0.9.46 (default Gutsy package) and 0.9.58 (found on this site).
Attached is a stacktrace.
http://bugs.winehq.org/show_bug.cgi?id=12191
Roderick Colenbrander thunderbird2k@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|gdi32 |opengl
--- Comment #1 from Roderick Colenbrander thunderbird2k@gmx.net 2008-03-24 05:35:04 --- Could you run the app using WINEDEBUG=+wgl,+opengl and attach the log to here?
http://bugs.winehq.org/show_bug.cgi?id=12191
--- Comment #2 from BlackStar BurnSpamAddress@gmail.com 2008-03-24 07:16:01 --- Created an attachment (id=11592) --> (http://bugs.winehq.org/attachment.cgi?id=11592) Stacktrace with WINEDEBUG=+wgl,+opengl
http://bugs.winehq.org/show_bug.cgi?id=12191
--- Comment #3 from BlackStar BurnSpamAddress@gmail.com 2008-03-24 07:59:53 --- IMHO, it looks like the error occurs in gdi, not opengl:
=>1 0x00000000 (0x0034c79c) 2 0x7e7727fb in winex11 (+0x327fb) (0x0034c7cc) 3 0x7e77a082 X11DRV_ChoosePixelFormat+0xa2() in winex11 (0x0034c85c) 4 0x7ecf3940 ChoosePixelFormat+0xb0() in gdi32 (0x0034c88c) 5 0x7e26be00 InitAdapters+0x2eb0() in wined3d (0x0034cd4c) 6 0x7e2dcc72 WineDirect3DCreate+0x22() in wined3d (0x0034cd7c) 7 0x7e3707fc in ddraw (+0x207fc) (0x0034cddc) 8 0x7e370dfd DirectDrawCreate+0xbd() in ddraw (0x0034ce2c)
Note, this is ChoosePixelFormat, not wglChoosePixelFormat.
What's more, the crash occurs regardless of whether you install the (addon) opengl driver (by default WC: Secret Ops comes with ddraw, D3D and glide drivers).
Anything I can do to help debug the issue?
http://bugs.winehq.org/show_bug.cgi?id=12191
--- Comment #4 from Roderick Colenbrander thunderbird2k@gmx.net 2008-03-24 09:09:35 --- ChoosePixelFormat is basically a wgl call. Somehow it generates a null pointer dereference exception. I have no idea how this could be happening. The pfd we are sending to it from wined3d should be valid, so that would mean that something in the gdi32 <-> winex11.drv iterface isn't working well ..
If you can code try to figure out what's happening in winex11.drv/opengl.c
http://bugs.winehq.org/show_bug.cgi?id=12191
--- Comment #5 from BlackStar BurnSpamAddress@gmail.com 2008-03-24 09:34:37 --- I'm trying to understand the interface. Is it something like the following? - Program calls DirectDrawCreate - Wine calls WineDirect3DCreate (in wined3d.c) - ChoosePixelFormat is called (gdi32.c?) - X11DRV_ChoosePixelFormat is called (winex11.drv/??.c)
I guess I fail to see how wglChoosePixelFormat comes into play (it's not visible in the stacktraces above).
I'm also a little confused on wgl- and gdi- ChoosePixelFormat. It looks like there are three ChoosePixelFormat functions: undercorated, wgl and gdi (internal), but it isn't entirely clear which one calls what (see also: http://bugs.winehq.org/show_bug.cgi?id=5310)
My guess is ChoosePixelFormat calls wglChoosePixelFormat / gdiChoosePixelFormat internally (according to MSDN it is recommended that you call the undecorated function, unless you dynamically load opengl32.dll).
Are you certain that wgl (opengl.c) comes into play here? I'll try to take a look, but my job does not allow much free time unfortunately.
http://bugs.winehq.org/show_bug.cgi?id=12191
--- Comment #6 from Roderick Colenbrander thunderbird2k@gmx.net 2008-03-25 17:51:22 --- When using WineD3D on Windows it uses opengl32.dll and WGL. On Wine we directly use libGL.so for GL functions (using some evil hack I added) and WGL functions are called using some evil mechanism as well.
The function ChoosePixelFormat is part of gdi32 but in essence it is an opengl function. In case of Wine wglChoosePixelFormat is forwarded to gdi32's ChoosePixelFormat.
Anyway ChoosePixelFormat is in the end implemented in the display driver which is winex11.drv. Inside winex11.drv it is X11DRV_ChoosePixelFormat which is in opengl.c. The function looks for a 'best' matching pixel format against the available GLX pixel formats.
Anyway the function should not crash inside X11DRV_ChoosePixelFormat. Likely the function is reading some bad memory or so.
http://bugs.winehq.org/show_bug.cgi?id=12191
--- Comment #7 from Roderick Colenbrander thunderbird2k@gmx.net 2008-04-01 07:50:31 --- Latest git contains some ChoosePixelFormat fixes perhaps they help.
http://bugs.winehq.org/show_bug.cgi?id=12191
BlackStar BurnSpamAddress@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #8 from BlackStar BurnSpamAddress@gmail.com 2008-04-18 13:17:18 --- I just upgraded my video drivers to 8.4 (fglrx) and Wine to 0.9.59, and the problem no longer occurs.
Thumbs up guys!
http://bugs.winehq.org/show_bug.cgi?id=12191
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2008-05-02 12:37:43 --- Closing bugs fixed in 0.9.61.