Search Unity

[5.3.5p3] crash at DrawBuffers (GfxDeviceGLES.cpp:1496)

Discussion in 'iOS and tvOS' started by cg_han-squirrel, Jun 2, 2016.

  1. cg_han-squirrel

    cg_han-squirrel

    Joined:
    Nov 27, 2013
    Posts:
    46

    update 2016/06/18:


    • still crash on 5.3.5p3
    • only crash on device using API OPENGL ES2/3(version below iphone5s), device using metal API never crashes
    • you can view the realtime crash stats on my APP testing share at http://crashes.to/s/8c40f693fb6
    • is on the device without XCode launching
    • dynamic batching is enabled


    --------------------------------------------------------------------

    Hi there,

    we have a randomly crash on iOS device with the newest version of unity.

    Is anybody know how does the crash occurs?

    detail stack information as below:

     
    Last edited: Jun 18, 2016
  2. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Is it happening on device running on A9 chip? If that's the case I would recommend switching to Metal gfx API.
     
  3. cg_han-squirrel

    cg_han-squirrel

    Joined:
    Nov 27, 2013
    Posts:
    46
    the problem is on iPAD4(ios8.1 or 8.3)

    I'm sorry but how to switch to Metal gfx API?
     
  4. cg_han-squirrel

    cg_han-squirrel

    Joined:
    Nov 27, 2013
    Posts:
    46
    and another crash seems on Metail gfx on any iOS device..

     
  5. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    iOS 8.3 had issues with Xcode frame capture, so I would suggest testing if game crashes when being launched without Xcode. If it still crashes, please submit a bugreport.
     
  6. cg_han-squirrel

    cg_han-squirrel

    Joined:
    Nov 27, 2013
    Posts:
    46
    yes ,it's crashed without Xcode.. but it's too hard to us to detach the project for submit bug..
     
  7. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Xcode project would be good start for us to start investigation. Thanks!
     
  8. cg_han-squirrel

    cg_han-squirrel

    Joined:
    Nov 27, 2013
    Posts:
    46
    I will try to detach a project, but would somebody tell me how might the problem happend, and how to avoid this?

    I have got a lot of this error on any iOS device and the problem is delaying our version release..
     
  9. cg_han-squirrel

    cg_han-squirrel

    Joined:
    Nov 27, 2013
    Posts:
    46
    and the crash is still happened after we upgrade to 5.3.5p3
     
  10. cg_han-squirrel

    cg_han-squirrel

    Joined:
    Nov 27, 2013
    Posts:
    46
    I find the problem only occurs on the device running OPENGL API. (device below iphone5s)

    you can view problem detail information on my app test page:
    http://bugly.qq.com/share/LZTFz4


    this is the crashed device list:

    QQ图片20160618141229.png

    and here is the OS version:
    2.png
     
  11. Saxon-Shao

    Saxon-Shao

    Joined:
    Sep 16, 2015
    Posts:
    1
    hi,你这个问题解决了吗?我也遇到这个问题,我qq:364925474,我们交流一下?
     
  12. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    I'm also having the GfxDeviceGLES crash on older devices. I'm running Unity 5.3.6. Is there a fix?
     
  13. Madsen

    Madsen

    Joined:
    Nov 29, 2010
    Posts:
    15
    Any solution or workaround for that? We have the same problem here?
     
  14. charlesJRG

    charlesJRG

    Joined:
    Jul 18, 2016
    Posts:
    16
    We are seeeing a big spike in this issue also. Same device characteristics, older iOS devices
    It seems to be related to view transitions, or it happens while the unity view is backgrounded.

    I can post some more detailed logs if that would help
     
  15. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    I've got the same problem for some time now. Tried it on multiple versions from unity 5.4.x to 5.6.1p1.
    On my iphone 5 test device, the app crashes right after the loading screen. On my friend's iphone 7, it works with no problems.

    I guess a workaround would be to uncheck auto graphics API and remove OpenGLES, leaving only Metal, thus excluding lower end iphones.
     
  16. Madsen

    Madsen

    Joined:
    Nov 29, 2010
    Posts:
    15
    For my customers its mainly ipad 2+3 - where the bug appears. So to exclude this devices its not realy possible with an update of an old game.
    Any idea which version of unity this BUG started. Maybe 5.1. could work? So maybe a downgrade would help. Sometimes its not fun to develop Unity.
     
  17. Madsen

    Madsen

    Joined:
    Nov 29, 2010
    Posts:
    15
    Hi raydekk, did you also try different XCode versions?
    What was the latest XCode version you tried?
     
  18. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    I tried it with the latest Xcode (8.3.2 I think) and maybe a lower version, but still 8.x
     
  19. Madsen

    Madsen

    Joined:
    Nov 29, 2010
    Posts:
    15
    Do you use the latest OS - Sirra - maybe it's a problem with el capitan?
     
  20. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    latest mac osx as well
     
  21. Madsen

    Madsen

    Joined:
    Nov 29, 2010
    Posts:
    15
    I got rid of that bug - somehow.
    I have 3 different versions of my game with the same problem. Just the same problem as discripted above.

    First I tried a lot with my old Mac Notebook with El Capitan OS on it.
    I tried Unity Versions 5.3.5, 5.4.1, 5.2.x, 5.1.. Also I tried a lot of XCode-Versions and settings. I changed shaders, compiler settings, rendering settings -> no effect.

    Then I changed to a new system. A Mac Mini with Sirra on it. I built the same projects with Unity 5.3.4 and X-Code 8.3.2 and the bug is just gone.
     
  22. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    412
    Do you use trail renderer? We had a crash in 5.3 or 5.4. I think that was crashing in a similar place. But it was happening when we called reset on the trail render. The trail renderer bug seems to be fixed in 5.5.
     
  23. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    No I don't use trail renderer. Just tried out with Unity 5.6.1p3, updated to latest macOS X (10.12.5) and Xcode 8.3.3. Still doesn't work. I'm getting this log in Xcode:

    2017-06-11 17:37:44.998146+0300 galaxymap[218:5579] -> registered mono modules 0x13836f0
    -> applicationDidFinishLaunching()
    Player data archive not found at `/var/containers/Bundle/Application/2184C525-5022-41A4-BB17-DFB7E93F2BFF/galaxymap.app/Data/data.unity3d`, using local filesystem2017-06-11 17:37:46.143364+0300 galaxymap[218:5579] Metal GPU Frame Capture Enabled
    2017-06-11 17:37:46.146720+0300 galaxymap[218:5579] Metal API Validation Disabled
    2017-06-11 17:37:46.638547+0300 galaxymap[218:5579] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
    2017-06-11 17:37:46.639883+0300 galaxymap[218:5579] [MC] Reading from public effective user settings.
    -> applicationDidBecomeActive()
    Renderer: PowerVR SGX 543
    Vendor: Imagination Technologies
    Version: OpenGL ES 2.0 IMGSGX543-129
    GLES: 2
    GL_OES_depth_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_draw_instanced GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_texture_rg GL_EXT_texture_storage GL_APPLE_clip_distance GL_APPLE_color_buffer_packed_float GL_APPLE_copy_texture_levels GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_sync GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_APPLE_texture_packed_float GL_IMG_read_format GL_IMG_texture_comp
    ression_pvrtc
    OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level <OpenGL ES 2.0> ; Context handle 349859024
    Initialize engine version: 5.6.1p3 (ede8e3f4adbd)
    -------- Shader compilation failed
    #version 100
    #extension GL_EXT_frag_depth : enable
    precision highp float;
    uniform highp vec4 _ProjectionParams;
    uniform highp vec4 _ZBufferParams;
    uniform highp mat4 unity_CameraToWorld;
    uniform highp mat4 _NonJitteredVP;
    uniform highp mat4 _PreviousVP;
    uniform highp sampler2D _CameraDepthTexture;
    varying highp vec2 xlv_TEXCOORD0;
    varying highp vec3 xlv_TEXCOORD1;
    void main ()
    {
    highp vec4 tmpvar_1;
    tmpvar_1 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0);
    mediump vec2 tmpvar_2;
    highp vec4 tmpvar_3;
    tmpvar_3.w = 1.0;
    tmpvar_3.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/((
    (_ZBufferParams.x * tmpvar_1.x)
    + _ZBufferParams.y))));
    highp vec4 tmpvar_4;
    tmpvar_4 = (unity_CameraToWorld * tmpvar_3);
    highp vec4 tmpvar_5;
    tmpvar_5 = (_PreviousVP * tmpvar_4);
    highp vec4 tmpvar_6;
    tmpvar_6 = (_NonJitteredVP * tmpvar_4);
    highp vec2 tmpvar_7;
    tmpvar_7 = (((tmpvar_5.xy / tmpvar_5.w) + 1.0) / 2.0);
    highp vec2 tmpvar_8;
    tmpvar_8 = (((tmpvar_6.xy / tmpvar_6.w) + 1.0) / 2.0);
    tmpvar_2 = (tmpvar_8 - tmpvar_7);
    mediump vec4 tmpvar_9;
    tmpvar_9.zw = vec2(0.0, 1.0);
    tmpvar_9.xy = tmpvar_2;
    gl_FragDepthEXT = tmpvar_1.x;
    gl_FragData[0] = tmpvar_9;
    }
    -------- failed compiling:
    fragment evaluation shader
    WARNING: 0:4: extension 'GL_EXT_frag_depth' is not supported
    ERROR: 0:38: Use of undeclared identifier 'gl_FragDepthEXT'

    Note: Creation of internal variant of shader 'Hidden/Internal-MotionVectors' failed.
    WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Pass '' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Setting to default shader.
    WARNING: Shader Unsupported: 'Hidden/VR/BlitCopyFromTexArray' - Pass '' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/VR/BlitCopyFromTexArray' - Setting to default shader.


    This is where it breaks:
    0xcf9cd4 <+372>: str r0, [sp]
    0xcf9cd6 <+374>: mov r0, r6
    0xcf9cd8 <+376>: mov.w r6, #0xffffffff
    0xcf9cdc <+380>: bl 0xcec986 ; : DrawElements() at ApiGLES.cpp:546
    -> 0xcf9ce0 <+384>: b 0xcf9cf4 ; <+404> at GfxDeviceGLES.cpp:1881
    Thread 1: EXC_BAD_ACCESS (code =1, address=0xb001000)

    0xcf9ce2 <+386>: ldr r1, [r5]
     
    Last edited: Jun 11, 2017
  24. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    412
    Could it be as simple as your shader is failing compilation and it has no fallback. And unity is rendering with an invalid shader?
     
  25. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    I tried this https://forum.unity3d.com/threads/hidden-shader-motionvectors.431470/#post-2790226

    But I only got rid of the warning messages and the note. This still persists

    0xcf9cdc <+380>: bl 0xcec986 ; : DrawElements() at ApiGLES.cpp:546
    -> 0xcf9ce0 <+384>: b 0xcf9cf4 ; <+404> at GfxDeviceGLES.cpp:1881
    Thread 1: EXC_BAD_ACCESS (code =1, address=0xb001000)

    Unchecking Auto Graphics API and removing OpenGL ES, leaving only Metal seems to be the only workaround. But this excludes lower end iphones and ipads.
     
  26. wu_zhen

    wu_zhen

    Joined:
    Oct 18, 2016
    Posts:
    2
    I meet the same issue on ipad4 and other old devices。 do you have solved it?
     
    Last edited: Jul 8, 2017
  27. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    Still happening in 5.6.2p1, didn't test in 5.6.2p2, but I doubt it's fixed, based on the patch notes.
     
  28. spiller2002

    spiller2002

    Joined:
    Nov 2, 2016
    Posts:
    2
    Hi guys. Did someone find a workaround? We are experiencing the same issue at the moment. Happy for any help! Cheers Michael