problem with glutCreateWindow

Hello All
I have the following problem and hope that somebody could help.

My program crashes within function
glutCreateWindow which is called at some point
as “glutCreateWindow(“Volume”)”. When trying to
debug with ‘gdb’ on Linux, I get the following:

Program received signal SIGFPE, Arithmetic exception.
0x40865357 in gl_test_os_katmai_exception_support ()
from /usr/X11R6/lib/modules/dri/r128_dri.so
(gdb) where
#0 0x40865357 in gl_test_os_katmai_exception_support ()
from /usr/X11R6/lib/modules/dri/r128_dri.so
#1 0x4086505e in check_os_katmai_support ()
from /usr/X11R6/lib/modules/dri/r128_dri.so
#2 0x408651c2 in gl_init_all_x86_transform_asm ()
from /usr/X11R6/lib/modules/dri/r128_dri.so
#3 0x4079464f in one_time_init () from /usr/X11R6/lib/modules/dri/r128_dri.so
#4 0x407967e7 in _mesa_initialize_context ()
from /usr/X11R6/lib/modules/dri/r128_dri.so
#5 0x40796aed in gl_create_context () from /usr/X11R6/lib/modules/dri/r128_dri.so
#6 0x4076b49f in driMesaCreateContext () from /usr/X11R6/lib/modules/dri/r128_dri.so
#7 0x4020d69f in CreateContext () from /usr/lib/libGL.so.1
#8 0x0809e340 in ?? ()

I am not sure what failed since the function doesn’t have
numerical varaiables and the problem seems to be inside.

Thanks!!

do you want to show us your code around the createwindow command?

Here is the part of the code around the
mentioned problem:


/* Set up the form library */
fl_initialize(&argc,argv,“Volume Visualisation”,0,0);

/* Set things (glut) up */
glutInit(&argc,argv);
if (!stereo)
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
else
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STEREO);

    /* Create the window and handlers */

glutCreateWindow(“Volume Visualisation”);
camera.screenwidth = 800;
camera.screenheight = 600;
glutReshapeWindow(camera.screenwidth,camera.screenheight);
if (fullscreen)
glutFullScreen();
glutDIsplayFunc(HandleDisplay);
glutReshapeFunc(HandleReshape);
glutVisibilityFunc(HandleVisibility);
glutKeyboardFunc(HandleKeyboard);
glutSpecialFunc(HandleSpecialKeyboard);
glutMouseFunc(HandleMouse);
glutMotionFunc(HandleMouseMotion);
CreateEnvironment();
/* glutSetCursor(GLUT_CURSOR_NONE); */

    CreateMenus();

Thanks!

Do you have to give it dims before you create it?

I see two things:

first use this to set window size before calling glutCreateWindow:

glutInitWindowSize (500, 500);
glutInitWindowPosition (10, 10);

second:
You call glutReshapeWindow before you define the call back with glutReshapeFunc command.
Also I not sure you can call glutResphapeWindow before calling glutMainLoop.

[This message has been edited by nexusone (edited 04-26-2003).]

Hello there,
and thanks for your help.
UNforutnately, even when I set window size and position
as suggested before creating the window, I sill run into the
same problem at the same place (with the same error messages)!

Masha

p.s. I moved glutWindowReshape after glutReshapeFunc,
but program doesn’t even reach there due to the 1st
problem

I don’t think you can call the glutReshapeWindow before the glutMainLoop is called!!

I really would have to see more code to see what else maybe going on. You can just e-mail what you have to me and I will look at it.

Originally posted by Masha:
[b]Hello there,
and thanks for your help.
UNforutnately, even when I set window size and position
as suggested before creating the window, I sill run into the
same problem at the same place (with the same error messages)!

Masha

p.s. I moved glutWindowReshape after glutReshapeFunc,
but program doesn’t even reach there due to the 1st
problem[/b]

Does your GPU support stereo (quad buffer)? Try your code with stereo = false and see if it runs.

Hey there,
Actually, stereo=false is a default and gives problems as
described previously.
Speaking of the devil, when you run it with a stereo option
it gives “Fatal error: visual with necessary capabilities not found” which is the problem with the viedo card,
I presume.

Originally posted by shinpaughp:
Does your GPU support stereo (quad buffer)? Try your code with stereo = false and see if it runs.

Just wanted to make sure that wasn’t the problem. Mine crashes immediately when I request stero mode.

What does your fl_initialise function do? Seems it is the only unknown (to us that is) at this point… Could it be something there?

fl_initilize is “Xforms” function. It doesn’t have an
impact on the problem - if commented, the problem
still persist.
Thanks!
Masha

Originally posted by shinpaughp:
[b]Just wanted to make sure that wasn’t the problem. Mine crashes immediately when I request stero mode.

What does your fl_initialise function do? Seems it is the only unknown (to us that is) at this point… Could it be something there?[/b]

What are these modules that report the problem used for?
( /usr/X11R6/lib/modules/dri/r128_dri.so )

What is dri?

dri is the openGL hardware drivers.

I got your code in the e-mail, but a file called forms.h is missing

Also this part of the code:

glutMainLoop(); // once main loop enter never exits, until program end.
camera.screenwidth = 800; // Program never see these lines
camera.screenheight = 600; // not used
glutReshapeWindow(camera.screenwidth,camera.screenheight); // never called
return(0);

Originally posted by Masha:
[b]What are these modules that report the problem used for?
( /usr/X11R6/lib/modules/dri/r128_dri.so )

What is dri?[/b]

[This message has been edited by nexusone (edited 04-29-2003).]

Search google… looks like drivers for ATI rage 128.

Epilogue:
Code is just fine, but my video card(ATI Rage Ultra 128) ended up was the source of the problem -
drivers were not completely compatible (drivers
are for ATI Rage 128 and no others are available).

In the meantime I discovered a serious of problems
with almost any OpenGL based software (Inventor,
Geomview) - they would simply freeze the machine.

I had to upgrade Xfree86 & Linux kernel (which solved problems with Inventor and geomview) and for the above mentioned code even with those changes I still have to use the executable that has been compiled on another machine [though my machine does not give compilation errors].

Thanks for everybody’s help.