Crash in glLoadIdentity? (Linux)

Hi, I have a strange crash under Linux. I got my little test app compiling
and running under Win98 just fine, but before it even gets to main(…) when
running under Linux it core dumps. I only have one global variable (the
game class) that gets initiated before main. It does make it to the
constructor for that, but then craps out before ever entering main. When I
gdbed the core file it said it crashed in glLoadIndentity. However, GL
never event got a chance to be instantiated. If anyone has a clue as to
what’s going on please tell. :slight_smile: Oh, this may help…

http://www.cs.purdue.edu/homes/poyntetm/SDLtest/

  • main(…) is in winMain.cpp
  • could it be my compiler options in the Makefile?

Thanks.

Hi, I have a strange crash under Linux. I got my little test app compiling
and running under Win98 just fine, but before it even gets to main(…) when
running under Linux it core dumps. I only have one global variable (the
game class) that gets initiated before main. It does make it to the
constructor for that, but then craps out before ever entering main. When I
gdbed the core file it said it crashed in glLoadIndentity. However, GL
never event got a chance to be instantiated. If anyone has a clue as to
what’s going on please tell. :slight_smile: Oh, this may help…

http://www.cs.purdue.edu/homes/poyntetm/SDLtest/

  • main(…) is in winMain.cpp
  • could it be my compiler options in the Makefile?

This is why it’s a bad idea to have automatically constructed objects.

The constructor for CCamera calls myRenderer.resetMatrix(), which in
turn calls glLoadIdentity() before a GL context has been created.
Hence the crash.

One of the reasons IMHO that UNIX software is usually more stable than
Windows software is if you get it wrong, it often crashes right away. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Very true. Good catch.> ----- Original Message -----

From: slouken@devolution.com (Sam Lantinga)
Newsgroups: loki.open-source.sdl
Sent: Tuesday, March 07, 2000 1:25 AM
Subject: Re: Crash in glLoadIdentity? (Linux)

Hi, I have a strange crash under Linux. I got my little test app
compiling

and running under Win98 just fine, but before it even gets to main(…)
when

running under Linux it core dumps. I only have one global variable (the
game class) that gets initiated before main. It does make it to the
constructor for that, but then craps out before ever entering main.
When I

gdbed the core file it said it crashed in glLoadIndentity. However, GL
never event got a chance to be instantiated. If anyone has a clue as to
what’s going on please tell. :slight_smile: Oh, this may help…

http://www.cs.purdue.edu/homes/poyntetm/SDLtest/

  • main(…) is in winMain.cpp
  • could it be my compiler options in the Makefile?

This is why it’s a bad idea to have automatically constructed objects.

The constructor for CCamera calls myRenderer.resetMatrix(), which in
turn calls glLoadIdentity() before a GL context has been created.
Hence the crash.

One of the reasons IMHO that UNIX software is usually more stable than
Windows software is if you get it wrong, it often crashes right away. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec