Summary: | CreateDRIDrawable can't fail gracefully | ||
---|---|---|---|
Product: | Mesa | Reporter: | nobled <nobled> |
Component: | GLX | Assignee: | mesa-dev |
Status: | RESOLVED MOVED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | bugs.freedesktop |
Version: | git | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | small EGL program to produce BadDrawable error |
Description
nobled
2011-01-31 06:05:34 UTC
It looks like the same problem is also in glxcmds.c:glXCreateGLXPixmap (it returns the same xid whether or not driScreen->createDrawable() returned null) Okay, with debug symbols now the backtrace is: #0 0x00434e18 in XCreateDrawable (base=0x811caa0, xDrawable=102760449, drawable=102760449, modes=0x8170ff0) at drisw_glx.c:94 #1 driCreateDrawable (base=0x811caa0, xDrawable=102760449, drawable=102760449, modes=0x8170ff0) at drisw_glx.c:377 #2 0x004356a7 in driFetchDrawable (gc=0x8167468, glxDrawable=102760449) at dri_common.c:373 #3 0x004346f2 in drisw_bind_context (context=0x8167468, old=0x44a1c0, draw=102760449, read=102760449) at drisw_glx.c:266 #4 0x00412c3f in MakeContextCurrent (dpy=0x81400c0, draw=102760449, read=102760449, gc_user=0x8167468) at glxcurrent.c:263 #5 0x00412dd3 in glXMakeCurrent (dpy=0x81400c0, draw=102760449, gc=0x8167468) at glxcurrent.c:287 #6 0x00462e8c in GLX_eglMakeCurrent (drv=0x80ec2e0, disp=0x80eb680, dsurf=0x8164370, rsurf=0x8164370, ctx=0x816ed10) at egl_glx.c:760 #7 0x00454f8f in eglMakeCurrent (dpy=0x80eb680, draw=0x8164370, read=0x8164370, ctx=0x816ed10) at eglapi.c:478 XGetVisualInfo() returned null, and that doesn't get checked for. This patch by ajax back in May seems relevant, BTW. I'll test it (and Chad's patches) when I get a chance. http://lists.freedesktop.org/archives/mesa-dev/2011-May/007353.html Good news and bad news. Good news: I tested in an Ubuntu Maverick chroot, and I can't reproduce the segfault -- maybe it was fixed in Xlib? (In Lucid, libX11 is version 1.3.2; in Maverick, it's 1.3.3) Now, instead of silently segfaulting, it seems to call exit(1) after giving a much more informative printout. Which is a *very slight* improvement: (gdb) finish Run till exit from #0 drisw_bind_context (context=0x80690b0, old=0x4871e0, draw=106954753, read=106954753) at drisw_glx.c:267 X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) Major opcode of failed request: 55 (X_CreateGC) Resource id in failed request: 0x6600001 Serial number of failed request: 26 Current serial number in output stream: 28 Program exited with code 01. (gdb) quit Bad news is, ajax's patch no longer applies cleanly to master <773556e0f537eba82d9d68d618e229140f413620>, and I tested both of Chad's patches and the bug still happens. I'll attach a reduced testcase. Created attachment 48483 [details]
small EGL program to produce BadDrawable error
(Unrelatedly, I had to workaround another bug in the egl_glx driver by commenting out the EGL_RENDERABLE_TYPE line: otherwise, it failed to create the EGLSurface at all because it didn't recognize it: "libEGL warning: bad surface attribute 0x3040")
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/72. |
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.