【发布时间】:2012-06-20 12:17:32
【问题描述】:
我希望有人可以帮助我弄清楚发生了什么。
我正在使用 cocos2d framework 开发一款 iPhone 游戏。由于SIGKIL 信号,我有时会停止我的代码。如果我按“继续”按钮,游戏会继续进行,没有任何问题。
控制台日志清晰(没有错误或警告消息)
我在使用OpenGL 绘制纹理矩形的自定义类上得到它。
这段代码每秒执行大约 300 次,而我每 1-2 小时只得到一次 SIGKILL。
这是一段代码:
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);
这是当时数组的内容:
(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}
堆栈跟踪:
#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:] ()
日志的最后几行是:
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
如果有人能告诉我如何调试这种情况并确定发生了什么,我将不胜感激。
【问题讨论】:
-
你有想过这个吗?
-
没有。我只是希望它只在使用 xCode 时不会影响到真正的玩家。因为我总是在使用连接到 xCode 的设备进行调试时得到它。
-
在 Xcode 上的模拟器中运行时,我偶尔会得到它。但是我从来没有让它在我的设备上崩溃过,尽管我在测试时通常不会让设备连接到 Xcode。所以我的想法也是它在某种程度上与 Xcode 相关。
-
在连接到 XCode 的模拟器中运行时遇到同样的问题。 [CCNode 访问] 的然后 glDrawArrays() 停止。也可能是 cocos2d-iphone 的 bug。
-
我也一直在使用 cocos2d 和 (iPad) 模拟器将随机陷阱放入调试器。我只是诅咒并单击继续。我还认为这是与 Xcode 相关的,但在非 OpenGL 游戏中我没有。
标签: iphone ios opengl-es sigkill