Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Unity 2017.3 iOS crash in RectTransofrm

Discussion in 'iOS and tvOS' started by Lex_Dudya, Dec 28, 2017.

  1. Lex_Dudya

    Lex_Dudya

    Joined:
    Feb 28, 2013
    Posts:
    24
    We got random crashes on iOS 2017.3
    in RectTransform.cpp

    Code (CSharp):
    1.  
    2. myproject::ShouldUpdateTransformBefore():
    3.     0x100f6f854 <+0>:  ldr    x8, [x0]
    4.     0x100f6f858 <+4>:  ldr    x9, [x1]
    5.     0x100f6f85c <+8>:  cmp    x8, x9
    6.     0x100f6f860 <+12>: b.eq   0x100f6f86c               ; <+24> at RectTransform.cpp:319
    7.     0x100f6f864 <+16>: cset   w0, lo
    8.     0x100f6f868 <+20>: ret  
    9.     0x100f6f86c <+24>: ldr    w9, [x1, #0x8]
    10.     0x100f6f870 <+28>: cmn    w9, #0x1                  ; =0x1
    11.     0x100f6f874 <+32>: b.eq   0x100f6f894               ; <+64> at RectTransform.cpp:320
    12.     0x100f6f878 <+36>: ldr    w10, [x0, #0x8]
    13.     0x100f6f87c <+40>: cmp    w9, w10
    14.     0x100f6f880 <+44>: b.eq   0x100f6f89c               ; <+72> at RectTransform.cpp:327
    15. ->  0x100f6f884 <+48>: ldr    x11, [x8, #0x10]   ;Thread 1: EXC_BAD_ACCESS (code=1, address=0x10
    CPP code is

    Code (CSharp):
    1. // Vector3 minPosition = parent.rect.min - t.rect.min;
    2.         RectTransform_t3704657025 * L_0 = ___parent1;
    3.         // Vector3 minPosition = parent.rect.min - t.rect.min;
    4.         NullCheck(L_0);
    5.         Rect_t2360479859  L_1 = RectTransform_get_rect_m574169965(L_0, /*hidden argument*/NULL);
    6.         V_1 = L_1;
    7.         // Vector3 minPosition = parent.rect.min - t.rect.min;
    8.         Vector2_t2156229523  L_2 = Rect_get_min_m847841034((&V_1), /*hidden argument*/NULL);
    9.         RectTransform_t3704657025 * L_3 = ___t0;
    10.         // Vector3 minPosition = parent.rect.min - t.rect.min;
    11.         NullCheck(L_3);
    12.         Rect_t2360479859  L_4 = RectTransform_get_rect_m574169965(L_3, /*hidden argument*/NULL); /////Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)
    and C# code for this line looks:
    Code (CSharp):
    1.  private void ClampToParent(RectTransform t, RectTransform parent)
    2.         {
    3.             Vector3 minPosition = parent.rect.min - t.rect.min; /// Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)
    4.             Vector3 maxPosition = parent.rect.max - t.rect.max;
    5.  
    6.             t.localPosition = new Vector2(
    7.                 Mathf.Clamp(t.localPosition.x, minPosition.x, maxPosition.x),
    8.                 Mathf.Clamp(t.localPosition.y, minPosition.y, maxPosition.y));
    9.         }
    Does anybody has similar problems?
     
  2. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    70
  3. GeorgeCH

    GeorgeCH

    Joined:
    Oct 5, 2016
    Posts:
    178
    Encountered the same issue - downgrading to 2017.2 fixed it. The issue does not occur in the UnityEditor as far as I can tell and surfaces only
     
  4. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    2,777
    If you can reproduce the crash, can you please submit a bug-report following the advice given in this document? This allows Unity Technologies to repair their software and we, the customers, benefit from a more stable engine.
     
  5. GeorgeCH

    GeorgeCH

    Joined:
    Oct 5, 2016
    Posts:
    178
    I would love to - unfortunately, the issue only occurs on builds deployed to iPhone / iPad. Since I assemble those on a Mac Mini (which is slow as hell), it takes me around 20 minutes to get a build from my PC to my test device (and even then I'm not terribly good with Xcode-specific debugging tools).

    I'll see what I can figure out, but I'm afraid the best I can do here are screenshots (which are the same as what the other user has shared).
     
  6. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    2,777
    Thank you for replying.

    Unfortunately, screenshots will not enable Unity to fix the issue. They most likely need a project to reproduce the issue and test their fix against. From past experience, every crash-bug I reported without a project attached, didn't lead to a bug fix. Attaching a project on the other hand, did lead to a fix multiple times.

    If you (constantly) run into this crash with your project, sharing the project with Unity, along with a step-by-step list what to do to make it crash (be it as simple as "Deploy to iPhone 6 and start"), is probably the most helpful thing you can do to allow Unity to repair their engine.
     
    Claytonious likes this.
  7. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    792
    Confirming the EXC_BAD_ACCESS crash on 2017.3f3, iPad Pro iOS11. Occurs about 5-15 minutes into my game. Here's my stack trace from XCode.

    Code (CSharp):
    1. * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x13ac28210)
    2.   * frame #0: 0x0000000101929a44 MelCadence`::ShouldUpdateTransformBefore() at RectTransform.cpp:319 [opt]
    3.     frame #1: 0x0000000101938910 MelCadence`::__insertion_sort_3<bool (*&)(const TransformAccessReadOnly &, const TransformAccessReadOnly &), TransformAccessReadOnly *>() at algorithm:3745 [opt]
    4.     frame #2: 0x0000000101937ec0 MelCadence`::__sort<bool (*&)(const TransformAccessReadOnly &, const TransformAccessReadOnly &), TransformAccessReadOnly *>() at algorithm:4022 [opt]
    5.     frame #3: 0x000000010192974c MelCadence`::UpdateIfTransformDispatchIsDirty() [inlined] sort<TransformAccessReadOnly *, bool (*)(const TransformAccessReadOnly &, const TransformAccessReadOnly &)> at algorithm:4041 [opt]
    6.     frame #4: 0x0000000101929744 MelCadence`::UpdateIfTransformDispatchIsDirty() at RectTransform.cpp:340 [opt]
    7.     frame #5: 0x0000000101929d00 MelCadence`::GetRect() at RectTransform.cpp:372 [opt]
    8.     frame #6: 0x0000000101d98910 MelCadence`::RectTransform_CUSTOM_INTERNAL_get_rect() at RectTransformBindings.gen.cpp:38 [opt]
    9.     frame #7: 0x0000000100e3c1d0 MelCadence`::RectTransform_get_rect_m574169965(__this=<unavailable>, method=<unavailable>) at Bulk_UnityEngine.CoreModule_1.cpp:11348 [opt]
    10.     frame #8: 0x0000000100eaf2dc MelCadence`::Graphic_DoMeshGeneration_m3548487693(__this=0x000000011eacaf00, method=<unavailable>) at Bulk_UnityEngine.UI_0.cpp:42851 [opt]
    11.     frame #9: 0x0000000100eaecd4 MelCadence`::Graphic_Rebuild_m4084166386(Graphic_t1660335611 *, int32_t, const RuntimeMethod *) [inlined] VirtActionInvoker0::Invoke(slot=40) at Bulk_UnityEngine.UI_0.cpp:28 [opt]
    12.     frame #10: 0x0000000100eaecc0 MelCadence`::Graphic_Rebuild_m4084166386(__this=0x000000011eacaf00, ___update0=3, method=<unavailable>) at Bulk_UnityEngine.UI_0.cpp:42724 [opt]
    13.     frame #11: 0x0000000100ea3770 MelCadence`::CanvasUpdateRegistry_PerformUpdate_m1793997159(__this=0x0000000113658a50, method=<unavailable>) at Bulk_UnityEngine.UI_0.cpp:33587 [opt]
    14.     frame #12: 0x0000000100e92d74 MelCadence`::WillRenderCanvases_Invoke_m1240663687(__this=<unavailable>, method=<unavailable>) at Bulk_UnityEngine.UIModule_0.cpp:0 [opt]
    15.     frame #13: 0x00000001013b1d64 MelCadence`RuntimeInvoker_Void_t1185182177(methodPointer=<unavailable>, methodMetadata=<unavailable>, obj=<unavailable>, args=<unavailable>)(), MethodInfo const*, void*, void**) at Il2CppInvokerTable.cpp:80136 [opt]
    16.     frame #14: 0x00000001021dc368 MelCadence`il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) + 68
    17.     frame #15: 0x0000000101a66f54 MelCadence`::scripting_method_invoke() at ScriptingApi_Il2Cpp.cpp:213 [opt]
    18.     frame #16: 0x0000000101a6f178 MelCadence`::Invoke() at ScriptingInvocation.cpp:329 [opt]
    19.     frame #17: 0x0000000101c55d68 MelCadence`::WillRenderCanvases() [inlined] Invoke at ScriptingInvocation.h:70 [opt]
    20.     frame #18: 0x0000000101c55d54 MelCadence`::WillRenderCanvases() at CanvasManager.cpp:419 [opt]
    21.     frame #19: 0x0000000101c56060 MelCadence`::Forward() at CanvasManager.cpp:835 [opt]
    22.     frame #20: 0x00000001018882f0 MelCadence`::Forward() [inlined] PlayerUpdateCanvases at Player.cpp:962 [opt]
    23.     frame #21: 0x00000001018882d0 MelCadence`::Forward() at Player.cpp:1333 [opt]
    24.     frame #22: 0x0000000101889258 MelCadence`::PlayerLoop() at PlayerLoop.cpp:196 [opt]
    25.     frame #23: 0x0000000101511f78 MelCadence`::UnityPlayerLoopImpl() at LibEntryPoint.mm:224 [opt]
    26.     frame #24: 0x0000000100170678 MelCadence`::UnityRepaint() at UnityAppController+Rendering.mm:267 [opt]
    27.     frame #25: 0x0000000100170564 MelCadence`::-[UnityAppController(self=0x00000001c0112ea0, _cmd=<unavailable>) repaintDisplayLink]() at UnityAppController+Rendering.mm:76 [opt]
    28.     frame #26: 0x0000000107c48254 GPUToolsCore`__clang_call_terminate + 35876
    29.     frame #27: 0x00000001892ff710 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 672
    30.     frame #28: 0x00000001893b3c5c QuartzCore`display_timer_callback(__CFMachPort*, void*, long, void*) + 240
    31.     frame #29: 0x0000000185360290 CoreFoundation`__CFMachPortPerform + 188
    32.     frame #30: 0x000000018537b000 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    33.     frame #31: 0x000000018537a704 CoreFoundation`__CFRunLoopDoSource1 + 440
    34.     frame #32: 0x00000001853781d8 CoreFoundation`__CFRunLoopRun + 2196
    35.     frame #33: 0x0000000185297e58 CoreFoundation`CFRunLoopRunSpecific + 436
    36.     frame #34: 0x0000000187144f84 GraphicsServices`GSEventRunModal + 100
    37.     frame #35: 0x000000018e91767c UIKit`UIApplicationMain + 236
    38.     frame #36: 0x00000001001692e0 MelCadence`main(argc=1, argv=0x000000016fc9b8e0) at main.mm:33 [opt]
    39.     frame #37: 0x0000000184db456c libdyld.dylib`start + 4
    40.  
     
  8. logothesia

    logothesia

    Joined:
    May 9, 2015
    Posts:
    1
    I have a hard failure at a save game point of the exact issue above. My project isn't too big yet. Do you still need examples of this error?
     
  9. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    2,777
    In order for Unity Technologies to debug and test a potential fix, they need a project where said error can be reproduced and tested against.

    Therefore the answer would be "Yes, UT needs a bug-report with a project to reproduce the issue to be able to reproduce the error, fix it and test their fix against". Even if someone else already submitted a report for the same issue, it's often from advantage if another person submit one too, so UT has more than one project to test/reproduce the issue. The simpler the project where that error can be reproduced, the better.

    Here is a page how UT wants us to submit bug-reports:
    https://unity3d.com/unity/qa/bug-reporting
     
  10. PotatoesChipsStudio

    PotatoesChipsStudio

    Joined:
    Jan 8, 2018
    Posts:
    6
    Any update with the issue?

    I'm not sure if it will help but here are some screenshot that I have take with the issue:

    Debug:




    In release appears like this:


    It's appears to happened randomly but especially after show Admob Ads (I have integrated Admob and Unity Ads with mediation). Sorry to don't be able to help more.
     
  11. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    2,777
  12. ted_unity241

    ted_unity241

    Joined:
    Nov 30, 2017
    Posts:
    4
    Also ran into this crash with the exact outcome as OP. Happened on iPhone 7 and also iPhone X. Had to rollback Unity version.
     
  13. ted_unity241

    ted_unity241

    Joined:
    Nov 30, 2017
    Posts:
    4
    I agree with this to a degree. But in the final, if Unity can't have eyes on these problems themselves as well, then it will also be to their detriment. The original post was more than enough for a developer familiar with that code base to have a solid idea about what is going wrong.
     
  14. migueltuliompg

    migueltuliompg

    Joined:
    Feb 12, 2018
    Posts:
    7
    I don't know if this is of any help, but I also got this "EXC_BAD_ACCESS (code=1, address=0x10)"

    And it turned out that it was caused by having two scripts that both import the Social api.
     
  15. davigno

    davigno

    Joined:
    Jul 7, 2015
    Posts:
    1
    Hello guys! I m also getting this bug!
    I think they have fix it with the latest patch on yesterday! :)
     

    Attached Files:

    EricAlm and andersemil like this.
  16. peterhowell

    peterhowell

    Joined:
    Mar 7, 2015
    Posts:
    3
    Resolved this by upgrading to 2017.4.8f1 LTS.