Stumped by EXC_BAD_ACCESS

Member
Posts: 129
Joined: 2005.02
Post: #1
I have no clue why I am getting a EXC_BAD_ACCESS by a simple glDisable:

Thread 0 Crashed:
0 libGL.dylib 0x90c32c1c glDisable + 0x2c

is there ANY troubleshooting I can do to figure out the real cause?

Edit (5minutes later): Wow, I am a moron Smile I think I didn't initialize my context yet. I commeted out a lot of AGL code (to move to NSGL), and was just compiling libraries to see what ran and what didn't. Well, I forgot to add the NSGL context init code Wink

We'll see...
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #2
It's really a big PITA that gl calls crash when you don't have a context. For beginners, this is usually the first thing that gets them stumped. It could give you some sensible information at least.
Quote this message in a reply
Member
Posts: 129
Joined: 2005.02
Post: #3
I just have so many things going on at once Wink Trying to push the Carbon version out of the door, but I want to get the Cocoa version done by the time we support Localized strings.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #4
Crashing is giving you more information than silently doing nothing.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #5
arekkusu Wrote:Crashing is giving you more information than silently doing nothing.
True, but it doesn't tell you what is wrong either. If you are a seasoned OpenGL dev, you will know where to search, but a beginner isn't helped.
Quote this message in a reply
Member
Posts: 198
Joined: 2005.01
Post: #6
It may also be incorrect OpenGL behavior. Shouldn't it set an error code you can retrieve with glGetError()? It does on Win32 if you try to do that. It's a pretty weird error (the same one you get if you try to do invalid operations inside a glBegin/glEnd) but it does give one.

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Member
Posts: 129
Joined: 2005.02
Post: #7
It's not, I already fixed the problem (listed above). Just a matter of not updated commented out Carbon code to Cocoa code. Now on to mind boggling event stuff... Sad
Quote this message in a reply
Member
Posts: 277
Joined: 2004.10
Post: #8
DoG Wrote:True, but it doesn't tell you what is wrong either. If you are a seasoned OpenGL dev, you will know where to search, but a beginner isn't helped.

Hmmm.....
In my first game I had trouble with arrays and aglSwapContext.
I over-stepped an array with a while loop and called some glvertex functions...Sad
When I call aglSwapContex the video card would freeze (mouse and all would freeze).

I learned a long, long, time ago to check your if, while, for, and arrays for any problems first.
(pointers second)
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #9
Dan Potter Wrote:Shouldn't it set an error code you can retrieve with glGetError()?
You can't ask the context what the last error was if you don't have an active context.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  EXC_BAD_ACCESS with gluBuild2DMipmaps Marjock 3 3,402 Aug 5, 2007 01:38 AM
Last Post: Marjock
  OpenAL, Ogg/Vorbis music, and EXC_BAD_ACCESS 0ctane 10 7,223 May 28, 2006 01:43 PM
Last Post: OneSadCookie
  open AL crash with EXC_BAD_ACCESS carlo 9 4,139 Apr 12, 2006 09:23 PM
Last Post: Sabrina
  glGenTextures and EXC_BAD_ACCESS BobbyWatson 1 4,682 Aug 31, 2002 01:48 PM
Last Post: BobbyWatson