Bug 85199 (woskimi@yahoo.de)

Summary: glxinfo segfaults when mesa was compiled with clang & libc++
Product: Mesa Reporter: Michi <woskimi>
Component: GLXAssignee: Michi <woskimi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: brianp
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: strace glxinfo
gdb glxinfo
glxinfo: fix segfault when core profile is not available

Description Michi 2014-10-19 14:54:33 UTC
Created attachment 108064 [details]
strace glxinfo

1)
$ glxinfo
name of display: :0
Segmentation fault

2)
$ glxinfo -i
name of display: :0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  40
  Current serial number in output stream:  43

I don't know anything about what happens, but I know that this crash happens only when mesa was compiled with clang (from git) against libc++.
Building clang and mesa against libstdc++ with otherwise the same build config does not produce the crash.

I originally stumbled upon this issue because kwin was always crashing with OpenGL enabled.

thx for your time.
Michi
Comment 1 Michel Dänzer 2014-10-20 02:04:22 UTC
(In reply to Michi from comment #0)
> $ glxinfo
> name of display: :0
> Segmentation fault

Please run glxinfo in gdb, then after the segmentation fault, run 'bt full' on the gdb prompt and attach the output from that here.
Comment 2 Michi 2014-10-20 07:02:31 UTC
Created attachment 108084 [details]
gdb glxinfo
Comment 3 Michel Dänzer 2014-10-20 07:28:28 UTC
#0  0x00007ffff724da74 in ?? () from /usr/lib64/libexpat.so.1
#1  0x00000000004040ae in build_core_profile_extension_list (extfuncs=extfuncs@entry=0x7fffffffd710) at glinfo_common.c:291

Weird, looks like glXGetProcAddressARB((GLubyte *) "glGetStringi") returns a pointer to somewhere in libexpat...
Comment 4 Julien Isorce 2015-05-19 07:37:51 UTC
Created attachment 115890 [details] [review]
glxinfo: fix segfault when core profile is not available
Comment 5 Brian Paul 2015-05-20 00:47:59 UTC
Thanks for fixing that.  Looks good to me.  I've got some other glxinfo/wglinfo changes queued up so I'll push this with those.
Comment 6 Julien Isorce 2015-06-08 22:32:07 UTC
No problem :) It seems you pushed it here http://cgit.freedesktop.org/mesa/demos/commit/?id=fca824431608101298ff0735db4c09954dcf64ab so I am marking the bug as fixed. Please re-open if something is still missing.

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.