Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

freeglut seems very fragile.

281 views
Skip to first unread message

Rob

unread,
Sep 1, 2012, 10:32:19 PM9/1/12
to
I've taken to putting the infamous glxgears back under glut so that I can
port it to a variety of different VMs where I'm testing performance against
the native linux host with an NVIDIA 460 GPU.

In an openSUSE guest the thing segfaulted even though it compiled and ran
on a 32 bit XP guest, and the native 64 bit fedora host.

see below:
//-------------------------------------------------------------------------
int main(int argc, char *argv[])

{

glutInit(&argc,argv);

glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE|GLUT_DEPTH);



glutInitWindowSize(800,800);

glutInitWindowPosition(300,100);

/* absolutely no good reason why the glutGet() is required before
glutCreateWindow(), but without it I get:
OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x76de90
OpenGL Warning: Retry with 0x8002 returned 0 visuals
Segmentation fault
My only theory is that there exists a syncronization "bug" between glut
and the underlying Xwindows system. Possibly the window cannot be realized
because some setup at the X11 level hasn't finished and the glutGet()
possibly flushes out the cobwebs. In any case this is extremely fragile
and should not be required!
*/

if (!glutGet(GLUT_DISPLAY_MODE_POSSIBLE)) // <- my point of contention

exit(1);
glutCreateWindow("Glxgears");

//-------------------------------------------------------------------------


The inline comment says it all. It only seems to require the glutGet() in openSUSE.
Any thoughts or comments? Note that it executes without the glutGet() but cannot
find the correct visual. When I add glutGet() it ALWAYS succeeds...Weird!

Alberto Luaces

unread,
Sep 2, 2012, 3:33:08 AM9/2/12
to
Rob writes:

> I've taken to putting the infamous glxgears back under glut so that I can
> port it to a variety of different VMs where I'm testing performance against
> the native linux host with an NVIDIA 460 GPU.
>
> In an openSUSE guest the thing segfaulted even though it compiled and ran
> on a 32 bit XP guest, and the native 64 bit fedora host.
>

[...]

> The inline comment says it all. It only seems to require the glutGet() in openSUSE.
> Any thoughts or comments? Note that it executes without the glutGet() but cannot
> find the correct visual. When I add glutGet() it ALWAYS succeeds...Weird!

As a comment, it seems that the freeglut version that your openSUSE is
providing is at fault. Try other version if possible; if not, you can
also compile freeglut from the latest source available.

Leclerc

unread,
Sep 2, 2012, 3:51:54 AM9/2/12
to
Why are you so sure it's freeglut issue?


anyway, you can pick up sources of origial glut and try it out.

Alberto Luaces

unread,
Sep 2, 2012, 4:19:16 AM9/2/12
to
Leclerc writes:

> Why are you so sure it's freeglut issue?
>
>
> anyway, you can pick up sources of origial glut and try it out.

I don't know who you are addressing, but anyway: do you mean that it
could be any other component in the OpenGL or windowing system? I
assumed GL worked well for the OP.

Leclerc

unread,
Sep 3, 2012, 6:05:35 AM9/3/12
to
> I don't know who you are addressing,

sorry, I obviously made a mistake; my intention was to answer to OP.

jbwest

unread,
Sep 11, 2012, 9:15:30 PM9/11/12
to

"Rob" <no...@all.com> wrote in message
news:5042c533$0$15662$a826...@newsreader.readnews.com...
Try running valgrind on the app.

jbw


0 new messages