Bug 26487 - freeglut segfault because it receives a __GLcontextModes instead of a GLXFBConfig
Summary: freeglut segfault because it receives a __GLcontextModes instead of a GLXFBCo...
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: git
Hardware: Other Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-09 01:46 UTC by rixed
Modified: 2019-09-18 17:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description rixed 2010-02-09 01:46:15 UTC
glXChooseFBConfig and friends happyly cast one structure to another, so I believe they are supposed to be equal. This is not the case here, as gdb shows it :

type = struct __GLcontextModesRec {
    struct __GLcontextModesRec *next;
    GLboolean rgbMode;
    GLboolean floatMode;
    GLboolean colorIndexMode;
    GLuint doubleBufferMode;
    GLuint stereoMode;
    GLboolean haveAccumBuffer;
    GLboolean haveDepthBuffer;
    GLboolean haveStencilBuffer;
    GLint redBits;
    GLint greenBits;
    GLint blueBits;
    GLint alphaBits;
    GLuint redMask;
    GLuint greenMask;
    GLuint blueMask;
    GLuint alphaMask;
    GLint rgbBits;
...

which comes from GL/internal/glcore.h from MESA, while the other is :

type = struct __GLXFBConfigRec {
    int visualType;
    int transparentType;
    int transparentRed;
    int transparentGreen;
    int transparentBlue;
    int transparentAlpha;
    int transparentIndex;
    int visualCaveat;
    int associatedVisualId;
    int screen;
    int drawableType;
    int renderType;
    int maxPbufferWidth;
    int maxPbufferHeight;
    int maxPbufferPixels;
    int optimalPbufferWidth;
    int optimalPbufferHeight;
    int visualSelectGroup;
    unsigned int id;
...

This later definition comes not from MESA but aparently from /use/include/GL/glxint.h on my host (which is a gentoo and this file is there installed by a package named glproto BTW).
Comment 1 Kristian Høgsberg 2010-05-07 15:44:30 UTC
Can you provide a test case please?
Comment 2 rixed 2010-06-02 22:17:33 UTC
Any opengl program using freeglut 2.6.0 will crash in fgOpenWindow as a result.
I downgraded freeglut to 2.4.0 which apears to work.
I have thus no test case to provide, but can point you to the problematic cast from __GLcontextModes to GLXFBConfig if you want :)
Or maybe these two structures are supposed to be equivalent ? If so, the poblem then comes from my distro which installed incompatible header files, and you can close this issue.
Comment 3 GitLab Migration User 2019-09-18 17:11:43 UTC
-- 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/60.


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.