Search Unity

Multiple crashes in UnityAppController+Rendering.mm line 249, built with Unity 5.4.3p2 - p4

Discussion in 'iOS and tvOS' started by hsallander, Dec 22, 2016.

  1. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    46
    We're seeing a high number of crashes in our latest releases of one of our games. It seems to only be affecting iPhones so far, no iPads yet (which is the platform mostly used for our game), and so far we're only seeing crashes on iOS 10 no other versions, see the attached screen dump over devices and iOS versions. I've also attached the full log from crashlytics.

    The crash seems to happen at UnityRepaint (UnityAppController+Rendering.mm:249), and it causes a Fatal Exception: NSInternalInconsistencyException

    Anyone else seeing these issues? Any workarounds? Is this a known issue at Unity @christophergoy?
     

    Attached Files:

    Last edited: Dec 22, 2016
    imrankhanswati likes this.
  2. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hi @hsallander,
    This crash looks eerily familiar to me, though I haven't seen it in a while. Could you file a bug so QA can get a chance to look at it. I think I recently saw a similar one in another thread.
    Cheers,
    Chris
     
    imrankhanswati likes this.
  3. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    46
    Hi @christophergoy,

    I've filed a bug to the QA team now, and I've searched the forums but can't find any older posts that seem related, but at least one post that seems to be the exact same issue but posted after mine so more people are having this issue for sure.

    Looking at the stack trace again I see that there's a line: "UnityAppController applicationWillResignActive" just before the UnityRepaint that cause the crash, and seeing that the bug only happens on phones and not tablets maybe it's related to this bug regarding portrait/landscape mode when app is going into the background? If so that would be a bit of a relief under the circumstances, knowing it only happens when the app is being closed/sent to the background.

    Edit: after an email conversation with the QA team at Unity it seems likely that the bug is indeed the one mentioned above and also reported here, regarding locking the phone and then resuming the app in a different rotation than when it was being locked. @christophergoy it would still be interesting to hear if you have any information as to when that bug might be fixed with a patch, thanks!
     
    Last edited: Dec 26, 2016
    imrankhanswati likes this.
  4. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hey @hsallander,
    I'm on vacation at the moment and do not have access to my computer, yet I think I know of a workaround. There is a method in UnityAppController that tries to create a snapshot of frame is currently being rendered on the device. If you comment out the code that is in any way related to taking a snapshot, it might stop the crashes. It should be easy to reproduce the crash with the examples you've stated. Please try to reproduce it, then comment out the snapshot code and let me know how it turns out.
    Cheers,
    Chris
     
  5. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    I've been seeing an NSInternalInconsistencyException too, which might be the same thing? In my case it's very repeatable when resuming from suspend if the device has been locked - I posted about it here:

    https://forum.unity3d.com/threads/5-5-nsinternalinconsistencyexception-crash-on-resume.448023/
    https://forum.unity3d.com/threads/ios-10-0-and-xcode-8-compatibility.430103/page-4#post-2899069

    Have only been able to test on 2 devices though, an iPhone 6S with iOS10.2 (repeatable crash), and an iPod Touch 5G with iOS 9.2 (no crash). Happens with both GLES2 and Metal. Have tried 2 XCode versions and 3 (very recent) Unity releases

    Edit: Commenting out the [self repaint]; in applicationWillResignActive() in UnityAppController.mm seems to stop the crashing on resume.
     
    Last edited: Dec 28, 2016
  6. Vaidas_B

    Vaidas_B

    Unity Technologies

    Joined:
    Jun 17, 2016
    Posts:
    18
  7. amjaliks

    amjaliks

    Joined:
    Jul 11, 2015
    Posts:
    159
    Changing ENABLE_RUNLOOP_ACCEPT_INPUT to 0 seems to help to avoid this crash.
    But it may cause some issue with responsiveness to user inputs? Right?
     
    imrankhanswati likes this.
  8. imrankhanswati

    imrankhanswati

    Joined:
    Jul 14, 2016
    Posts:
    5
    hello @amjallks!
    i want to know is responsiveness of inputs got effected by the change or not?
    because this crash really freak me out.
    thanks.
     
  9. amjaliks

    amjaliks

    Joined:
    Jul 11, 2015
    Posts:
    159
    We didn't receive any reports from our players about input issues.
    But I can confirm, this issue is fixed in 5.5.2p2.