Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8549589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:45:01+00:00 2026-06-11T13:45:01+00:00

I developed an iPhone game a year ago and decided to pick up where

  • 0

I developed an iPhone game a year ago and decided to pick up where i left.
So I downloaded the latest version of Xcode (4.4.1) which I run on Mac OS X 10.7.4 and I built my game using the iOS 5.1 SDK (building for iOS 4.0) and run it in the simulator on iOS 5.1 and… it crashes on the first glDrawArrays() call.

So I figured that was weird, because it surely ran perfectly fine when I last worked on it. I then tried running on iOS 4.3 and it works fine!
Turns out it crashes from iOS. 5.0 and up. I also tried building for a higher target OS version, but that doesn’t make any difference.

The application crashes at a gleRunVertexSubmitImmediate call (with a EXC_BAD_ACCESS message, address 0x0) which is executed by glDrawArrays. It always goes wrong at the first glDrawArrays call, cause if I comment the first one, it runs fine (black screen) until I initiate what was supposed to be the 2nd glDrawArrays call and it crashes again.

Did some inspection of the arrays that are loaded (texturepointers, vertices, gl context), but I can’t spot any null references.
Running with zombie enabled doesn’t provide me with more info.

I wonder if anyone has experienced the same problem or has any idea what could cause it.

EDIT: Code example was request. It happens in the GLTexture.m (v1.7) that is issues by Apple, because that is the first point in code where glDrawArrays is called.

- (void) drawInRect:(CGRect)rect
{
    CLogGL();
    GLfloat  coordinates[] = {  0,      _maxT,
                                _maxS,  _maxT,
                                0,      0,
                                _maxS,  0  };
    GLfloat vertices[] = {  rect.origin.x,                          rect.origin.y,                          0.0,
                            rect.origin.x + rect.size.width,        rect.origin.y,                          0.0,
                            rect.origin.x,                          rect.origin.y + rect.size.height,       0.0,
                            rect.origin.x + rect.size.width,        rect.origin.y + rect.size.height,       0.0 };

    glBindTexture(GL_TEXTURE_2D, _name);
    glVertexPointer(3, GL_FLOAT, 0, vertices);
    glTexCoordPointer(2, GL_FLOAT, 0, coordinates);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);  // Crash happens here
}

EDIT: Screenshots of the stack trace:
stacktrace1.jpg
stacktrace2.jpg
stacktrace3.jpg

EDIT: Seems that it crashes on 4.2.2 too (on my iPod touch), but still runs fine in 4.3 simulator.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:45:02+00:00Added an answer on June 11, 2026 at 1:45 pm

    Perhaps your normal_array or color_array is enabled somewhere. Try disabling them:

    glDisableClientState(GL_COLOR_ARRAY);
    glDisableClientState(GL_NORMAL_ARRAY);
    

    If they are enabled but not set glDrawArrays will crash

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just replaced my XCode 4.0.1 with 4.2. Trying to run the iPhone game project
I had developed an API Rest for an iPhone Game and it works properly.
I developed a game using Cocos2d API for iPhone/iPod touch. My game supports normal
So I've developed an engine for the iPhone with which I'd like to build
I have developed a Cocos2d-X app with XCode which works perfectly when I launch
So I have developed iphone/ipad apps before using Xcode and Phonegap/Cordova for a while
I'm new to iPhone and Mac programming (developed for Windows before), and I've got
i am using box2d to developed iphone game.But i have not a lot of
I developed a board game app (for android/iphone) and added a multiplayer component to
I need to convert our existing iPhone 3-D action game code to run on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.