Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

iOS OpenGL Crash

Discussion in 'iOS and tvOS' started by genelee2050, Jan 20, 2017.

  1. genelee2050

    genelee2050

    Joined:
    Sep 22, 2015
    Posts:
    1
    Hi Everyone,

    My iOS build crashes randomly and I'm running out of ideas where the problem might be. From the stack trace, it seems to be related to OpenGL. I'm using a native plugin to render models in some scenes, so I disable the 'Automatic' option in graphics API and set OpenGL2 as default. And the game crashes at random point. If 'Metal' is set as default, the game works fine (only that my plugin won't work, since when GL.IssuePluginEvent calls my render function, it is not passing a OpenGL context (null), but that is another problem entirely).

    The game either crashes at 'Drawbuffers()' or 'PresentGLES()' function. I've searched through the forum for similar problems, but to no avail. The closest I could find is the one below:
    https://issuetracker.unity3d.com/is...presentgles-when-loading-a-scene-on-iphone-6s

    I've also attached a screenshot of the crash stack trace in the picture. I'm relatively new to game development. Anyone could shed light on this? Thanks much!
    P.S: It's only reproducible with iphone 5s and above. I suspect it has something to do with A7 chipset and higher, but I don't know where to start looking.


     
  2. zTrojan

    zTrojan

    Joined:
    Feb 15, 2013
    Posts:
    14
    Similar problem here with 2017.2.x and OpenGLES 2 or 3 on any device. With Metal problem disappears.
    Stacktrace:

    #0. Crashed: com.apple.main-thread
    0 GLEngine 0x1a1da9108 gleRunVertexSubmitARM + 2976
    1 GLEngine 0x1a1dd7f50 <redacted> + 11576
    2 GLEngine 0x1a1da61b8 gleSetVertexArrayFunc + 144
    3 GLEngine 0x1a1d50980 glDrawElements_IMM_ES2Exec + 1144
    4 testapp 0x1013b5eac GfxDeviceGLES::DrawBufferRanges(GfxBuffer*, VertexStreamSource const*, int, DrawBuffersRange const*, int, VertexDeclaration*, ShaderChannelMask, unsigned long, bool) (GfxDeviceGLES.cpp:1904)
    5 testapp 0x1013b61c8 GfxDeviceGLES::DrawBuffers(GfxBuffer*, VertexStreamSource const*, int, DrawBuffersRange const*, int, VertexDeclaration*, ShaderChannelMask) (GfxDeviceGLES.cpp:1963)
    6 testapp 0x10162f8c0 GenericDynamicVBO::DrawChunkInternal(DynamicVBOChunkHandle const&, ShaderChannelMask, ShaderChannelMask, VertexDeclaration*, DrawBuffersRange*, int, unsigned int) (GenericDynamicVBO.cpp:201)
    7 testapp 0x10162e4ac DynamicVBO::DrawChunk(DynamicVBOChunkHandle const&, ShaderChannelMask, ShaderChannelMask, VertexDeclaration*, DynamicVBO::DrawParams const*, int) (MemoryMacros.h:276)
    8 testapp 0x10186b85c RenderDynamicBatch(GfxDevice&, RenderNodeQueue const&, BatchInstanceData const*, unsigned long, unsigned long, unsigned long, ShaderChannelMask, ShaderChannelMask, VertexChannelsLayout const&, GfxPrimitiveType) (BatchRendering.cpp:494)
    9 testapp 0x10186a7f8 RenderMultipleMeshes(RenderNodeQueue const&, RenderMultipleData const&, ShaderChannelMask) (BatchRendering.cpp:833)
    10 testapp 0x1014cab20 BatchRenderer::RenderBatch(BatchInstanceData const*, unsigned long, ShaderChannelMask) (BatchRenderer.cpp:370)
    11 testapp 0x1014ca9c0 BatchRenderer::Flush(BatchBreakCause) (dynamic_array.h:486)
    12 testapp 0x1014d24ac ForwardRenderLoopJob(GfxDeviceAsyncCommand::ArgScratch*, GfxDeviceAsyncCommand::Arg const*) (ForwardShaderRenderLoop.cpp:638)
    13 testapp 0x101871c3c GfxDevice::ExecuteAsync(int, void (*)(GfxDeviceAsyncCommand::ArgScratch*, GfxDeviceAsyncCommand::Arg const*), GfxDeviceAsyncCommand::ArgScratch**, GfxDeviceAsyncCommand::Arg const*, JobFence const&) (GfxDevice.cpp:1601)
    14 testapp 0x1014d1b4c ForwardShaderRenderLoop::StartRenderJobs(JobFence&, bool, bool, ShaderPassContext&) (ForwardShaderRenderLoop.cpp:1079)
    15 testapp 0x1014d2f00 ForwardShaderRenderLoop::performRendering(JobFence&, ActiveLight const*, ShadowJobData const&, bool, bool, bool, Camera::RenderFlag) (ForwardShaderRenderLoop.cpp:1129)
    16 testapp 0x1014d3c3c DoForwardShaderRenderLoop(RenderLoopContext&, dynamic_array<RenderObjectData, 8ul>&, CullResults const&, bool, bool, bool, Camera::RenderFlag) (Profiler.h:268)
    17 testapp 0x1014e1de0 DoRenderLoop(RenderLoop&, RenderingPath, CullResults&, ShadowMapCache&, bool) (RenderLoopPrivate.cpp:529)
    18 testapp 0x101471de4 Camera::DoRender(CullResults&, SharedRendererScene const&, Camera::RenderFlag, Camera::performRenderFunction*) (Camera.cpp:1611)
    19 testapp 0x101472c2c Camera::CustomRender(CullResults&, ShaderPassContext&, CameraRenderingParams const*, Camera::RenderFlag, Camera::performRenderFunction*, void (*)()) (Camera.h:924)
    20 testapp 0x1014a1d54 RenderManager::RenderCameras(int, void (*)()) (RenderManager.cpp:123)
    21 testapp 0x1016e3e84 PlayerRender(bool) (Player.cpp:962)
    22 testapp 0x1016e52f8 InitPlayerLoopCallbacks()::postLateUpdateFinishFrameRenderingRegistrator::Forward() (Player.cpp:1381)
    23 testapp 0x1016e613c PlayerLoop() (PlayerLoop.cpp:224)
    24 testapp 0x1013739c4 UnityPlayerLoopImpl(bool) (LibEntryPoint.mm:226)
    25 testapp 0x1001066bc UnityRepaint (UnityAppController+Rendering.mm:274)
    26 testapp 0x1001065a8 -[UnityAppController(Rendering) repaintDisplayLink] (UnityAppController+Rendering.mm:78)
    27 QuartzCore 0x18fcb25dc CA::Display::DisplayLinkItem::dispatch(unsigned long long) + 44
    28 QuartzCore 0x18fcb248c CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 436
    29 IOKit 0x18cd13b9c IODispatchCalloutFromCFMessage + 372
    30 CoreFoundation 0x18ca3d960 __CFMachPortPerform + 180
    31 CoreFoundation 0x18ca55ae4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    32 CoreFoundation 0x18ca55284 __CFRunLoopDoSource1 + 436
    33 CoreFoundation 0x18ca52d98 __CFRunLoopRun + 1752
    34 CoreFoundation 0x18c982da4 CFRunLoopRunSpecific + 424
    35 GraphicsServices 0x18e3ed074 GSEventRunModal + 100
    36 UIKit 0x192c36c9c UIApplicationMain + 208
    37 testapp 0x1000fef60 main (main.mm:33)
    38 libdyld.dylib 0x18b99159c start + 4
     
    Last edited: Jan 24, 2018
  3. juliens137

    juliens137

    Joined:
    Oct 2, 2017
    Posts:
    26
    Hey did you ever find the solution for this?