Debugging SIGKILL on glDrawArrays(). iPhone iOS
Asked Answered
S

1

7

I hope someone can help me to figure out what is going on.

I’m developing an iPhone game using cocos2d framework. From time to time I’m getting my code stopped because of SIGKIL signal. If I press “continue” button, the game continues without any issues. The console log is clear (no error or warning messages) I get it on my custom class that draws a texturized rectangle using OpenGL. This code executes about 300 times per second and I get SIGKILL only about one time per 1-2 hours.

Here is a piece of code:

glColor4f(1.f, 1.f, 1.f, 1.f);
i = 1;
glBindTexture(GL_TEXTURE_2D, curText);
glVertexPointer(2, GL_FLOAT, 0, screenCoord [i]);
glTexCoordPointer(2, GL_FLOAT, 0, textureCoord [i]);            
SIGKIL -->  glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

Here is the content of arrays on that moment:

(gdb) p *screenCoord[1]@8
$8 = {0, 296, 249.827072, 296, 0, -0, 249.827072, -0}
(gdb) p *textureCoord[1]@8
$12 = {0.456224144, 0.29296875, 0.700195312, 0.29296875, 0.456224144, 0.58203125, 0.700195312, 0.58203125}

Stack trace:

#0  0x123028a7 in <????> ()
#1  0x12301528 in <????> ()
#2  0x0a767092 in gldRenderFillPolygonPtr ()
#3  0x12300185 in <????> ()
#4  0x0a55c3e1 in gleDrawArraysOrElements_ExecCore ()
#5  0x0a555280 in glDrawArrays_IMM_Exec ()
#6  0x01522c7c in glDrawArrays ()
#7  0x0007e6bd in -[CLScrollingBack draw] at /MyProjects/_ROBOTS/RobotsAttack/AbductedAliens game template/CLScrollingBack.m:430
#8  0x001bfdaa in -[CCNode visit] ()
#9  0x001bfd7d in -[CCNode visit] ()
#10 0x001bfd7d in -[CCNode visit] ()
#11 0x0020f708 in -[CCDirectorIOS drawScene] ()
#12 0x00211bb4 in -[CCDirectorDisplayLink mainLoop:] ()

The last lines in the log are:

2012-06-20 13:05:27.368 RobotsAttack![9487:207] cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from [2] to [4].
2012-06-20 13:05:27.368 RobotsAttack![9487:207] cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from [4] to [6].
Current language:  auto; currently objective-c

I would be grateful if somebody can tell me how to debug this situation and determine what is going on.

Sos answered 20/6, 2012 at 12:17 Comment(5)
No. I just hope that it is only while working with xCode and will not affect real players. Since I've always got it while debugging with device connected to xCode.Sos
I get it very occasionally, when running in the simulators on Xcode. But I have never had it crash on me on a device though, although I dont usually leave device connected to Xcode when testing. So my thoughts are also that it is somehow Xcode related.Pipette
Getting the same problem when running in simulator connected to XCode. [CCNode visit]'s and then glDrawArrays() stop. It also can be cocos2d-iphone bug.Pricking
I too have been getting random traps into the debugger with cocos2d and the (iPad) Simulator. I just curse and click Continue. I also figure this is Xcode-related, though I don’t get that in a non-OpenGL game.Schiffman
I've been seeing this as well. Boo. Never happens on a real device.Craigcraighead
T
0

You probably know this, but SIGKILL is sent by iOS when the application needs to be terminated without a "crash" in the app. An obvious is example of this is when the user Double-taps home and presses the red minus on the app and terminates it.

SIGKILL can also be sent if the application is using too much memory. Make sure you're logging memory warnings and see if you get the warning before receiving the SIGKILL. If it's memory, just means you have some cleaning up you need to do or have a memory leak somewhere (solved easily by using the instruments).

Also, could just be Xcode being wonky... It's a less than perfect system so try playing on the simulator while xcode is closed and see if it still crashes on you.

Toothbrush answered 30/5, 2013 at 20:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.