Bug 110632

Summary: "glx: Fix synthetic error generation in __glXSendError" broke wine games on 32-bit
Product: Mesa Reporter: Andrew Randrianasulu <randrik>
Component: GLXAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: Hi-Angel, zegentzy
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: apitrace from failed run (mesa git without revert)

Description Andrew Randrianasulu 2019-05-07 03:44:39 UTC
with normal mesa build (up to commit d4a249aa09d0571e07859f847494f728acb6ee77):

wine UnrealTournament.exe
0029:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\zntport": c0000142
0015:err:service:process_send_command service protocol error - failed to write pipe!
000f:fixme:service:scmdatabase_autostart_services Auto-start service L"zntport" failed to start: 1114
0009:fixme:process:GetProcessWorkingSetSizeEx (0xffffffff,0x32f39c,0x32f394,(nil)): stub
0009:err:winediag:wined3d_dll_init Setting multithreaded command stream to 0.
0009:fixme:win:EnumDisplayDevicesW ((null),0,0x32c0c8,0x00000000), stub!
X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  890
  Current serial number in output stream:  890
--------------

with e91ee763c378d03883eb88cf0eadd8aa916f7878 reverted locally:

wine UnrealTournament.exe
002a:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\zntport": c0000142
0014:err:service:process_send_command service protocol error - failed to write pipe!
000f:fixme:service:scmdatabase_autostart_services Auto-start service L"zntport" failed to start: 1114
0009:fixme:process:GetProcessWorkingSetSizeEx (0xffffffff,0x32f39c,0x32f394,(nil)): stub
0009:err:winediag:wined3d_dll_init Setting multithreaded command stream to 0.
0009:fixme:win:EnumDisplayDevicesW ((null),0,0x32c0c8,0x00000000), stub!
0009:fixme:win:EnumDisplayDevicesW ((null),0,0x32c488,0x00000000), stub!
0009:fixme:ddraw:ddraw7_Initialize Ignoring guid {00000000-0000-0000-0000-000000000000}.
0009:fixme:ddraw:ddraw_surface7_Flip Ignoring flags 0x1.
0009:err:ole:CoGetClassObject class {92fa2c24-253c-11d2-90fb-006008a1f441} not registered
0009:err:ole:CoGetClassObject no class object {92fa2c24-253c-11d2-90fb-006008a1f441} could be created for context 0x1
0009:err:ole:CoGetClassObject class {d8f1eee0-f634-11cf-8700-00a0245d918b} not registered
0009:err:ole:CoGetClassObject no class object {d8f1eee0-f634-11cf-8700-00a0245d918b} could be created for context 0x1
0009:fixme:d3d:state_linepattern_w Setting line patterns is not supported in OpenGL core contexts.

and game starts normally.

wine version:
wine-4.5
Comment 1 Ian Romanick 2019-05-07 04:00:21 UTC
Is it possible to get a backtrace from __glXSendError?  I don't understand why this particular commit would change behavior from "not error" to "error".
Comment 2 Andrew Randrianasulu 2019-05-07 05:08:04 UTC
Created attachment 144184 [details]
apitrace from failed run (mesa git without revert)
Comment 3 Andrew Randrianasulu 2019-05-07 05:09:20 UTC
(In reply to Ian Romanick from comment #1)
> Is it possible to get a backtrace from __glXSendError?  I don't understand
> why this particular commit would change behavior from "not error" to "error".

sorry, not familiar enough with gdb. Should I set breakpoint somewhere in libGL?
Comment 4 Andrew Randrianasulu 2019-05-07 05:14:16 UTC
(In reply to Andrew Randrianasulu from comment #2)
> Created attachment 144184 [details]
> apitrace from failed run (mesa git without revert)

hm, last line from apitrace:

12665 glXCreateContextAttribsARB(dpy = 0x7cbb2e18, config = 0x7c880b90, share_context = NULL, direct = True, attrib_list = {GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 4, 0}) // incomplete

does this mean it tries to create 4.4 core context? If so, my hardware doesn't support this (nv92 with nouveau drivers, only up to OpenGL 3.3)
Comment 5 Michel Dänzer 2019-05-07 07:51:39 UTC
*** Bug 110590 has been marked as a duplicate of this bug. ***
Comment 6 Hi-Angel 2019-05-07 08:36:42 UTC
(In reply to Ian Romanick from comment #1)
> Is it possible to get a backtrace from __glXSendError?  I don't understand
> why this particular commit would change behavior from "not error" to "error".

Sure, can you tell offhand though, in which line can I set an "abort()" to cause a core dump on the error?

I tried to get a stacktrace both from gdb and winedbg, but for various reasons neither works.
Comment 7 Timothy Arceri 2019-05-08 03:18:55 UTC
I've reverted this for now. We can try again later once this regression is figured out.

commit a01b393c397c846345f03f76f1167dd667e0ee96
Author: Timothy Arceri <tarceri@itsqueeze.com>
Date:   Tue May 7 13:55:32 2019 +1000

    Revert "glx: Fix synthetic error generation in __glXSendError"
    
    This reverts commit e91ee763c378d03883eb88cf0eadd8aa916f7878.
    
    This seems to have broken a number of wine games. Lets revert
    everything for now and try again later.
    
    Acked-by: Adam Jackson <ajax@redhat.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110632
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110590

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.