Note that there are some explanatory texts on larger screens.

plurals
  1. PORandom crash on iPhone OpenGL app when navigating
    primarykey
    data
    text
    <p>I'm working on a iPhone application which is hybrid OpenGL ES and regular iPhone UI. This means there is an <code>EAGLView</code> greeting the user, then some regular <code>UIView</code>s that gets pushed over it (there is a <code>UINavigationController</code> as root controller).</p> <p>I've got a random (but very frequent) crash when navigating back from a subview. Here is a (...censored...) stack trace, from a Release build, but it crashes just the same in Debug.</p> <pre><code>#0 0x006863d0 in GetFBOBuffers () #1 0x00660120 in TerminateScene () #2 0x00660314 in FlushScene () #3 0x00660cd4 in FlushHW () #4 0x0066a6a0 in GLESPresentView () #5 0x323533a4 in -[EAGLContext presentRenderbuffer:] () #6 0x000026c0 in -[EAGLView presentFramebuffer] (self=0x11ce60, _cmd=&lt;value temporarily unavailable, due to optimizations&gt;) at (...)/Classes/EAGLView.m:157 #7 0x00004fdc in -[(...)ViewController drawFrame] (self=&lt;value temporarily unavailable, due to optimizations&gt;, _cmd=&lt;value temporarily unavailable, due to optimizations&gt;) at (...) ViewController.m:380 #8 0x336ebd9a in __NSFireTimer () #9 0x323f54c2 in CFRunLoopRunSpecific () #10 0x323f4c1e in CFRunLoopRunInMode () #11 0x335051c8 in GSEventRunModal () #12 0x324a6c30 in -[UIApplication _run] () #13 0x324a5230 in UIApplicationMain () #14 0x0000214c in main (argc=1, argv=0x2ffff568) at (...)/main.m:14 </code></pre> <p>Here is a list of things I know:</p> <ul> <li>My app doesn't get a memory warning.</li> <li>My app has no identified leak under Instruments.</li> <li>No crash on Simulator, but sometimes a very noticeable lag.</li> <li>There is a significant amount of released data in Instruments/OpenGL/ResourceBytes just before the crash.</li> <li>I'm using both VBOs and vertex/texcoord/normals arrays.</li> </ul> <p>So I know it must be some kind of data that gets released or destroyed, but I don't know how to find which. Any tips and tricks would be appreciated ;-)</p> <p><strong>UPDATE:</strong> </p> <p>After setting some breakpoints, moving along the stack, poking at various variables, I've found the reason for the crash, but not yet the source.</p> <p>In EAGLView, in the method <code>presentFramebuffer</code> where and when the crash occurs, the colorRenderBuffer ivar is 0 if I can believe gdb, even though trying to breakpoint when it's 0 doesn't seem to work.</p> <p>It seems the <code>deleteFrameBuffer</code> call from <code>layoutSubviews</code> isn't matched by a <code>createFramebuffer</code>.</p> <p><strong>UPDATE 2:</strong> </p> <p>Lots of breakpoints later... I've found a wrong situation: <code>[EAGLView layoutSubviews]</code> gets called <em>in the middle of a <code>drawFrame</code></em> ! So the buffers get deleted while in use... BAM!</p> <p>Now how do I fix <em>that</em>?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload