Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Crash in UnityWorker thread (MultiplyPoint3/TranformUIVertices)

Discussion in 'iOS and tvOS' started by ReiAyanami, Sep 25, 2015.

  1. ReiAyanami

    ReiAyanami

    Joined:
    Aug 6, 2010
    Posts:
    53
    Hey everyone,

    I ran into a problem I never faced before, a crash within the UnityWorker thread. I can't imagine the cause, the moment it happened, I started changing the position of some RectTransforms through my own animation script (if that matters).

    Here is a screenshot from Xcode:


    This is the first time it happened in hours of testing. Is that error caused by me, or is it an internal Unity thing? This happened under a Mono build.

    EDIT: After restarting and testing again, the same thing happened, different elements, but again at the start of a moving a RectTransform (with few image/texts as childs).

    Best regards,
    Marian
     
    Last edited: Sep 25, 2015
  2. isuseragoat

    isuseragoat

    Joined:
    Apr 30, 2014
    Posts:
    10
    Hello,

    I am having the same issue - and this started happening with Unity 5.2. I reverted back to 5.1.3, and everything works fine. So it seems like something in the internal unity worker process in 5.2 during gameplay that causes the crash.
    Here is my screenshot. Looks pretty similar to the post above.
     

    Attached Files:

  3. chimin

    chimin

    Joined:
    Sep 10, 2015
    Posts:
    1
    i think i have the same issue also. no update on this?
    i'm using Unity 5.2.2f1.

    same code works fine on
    Sony Xperia Z1 Compact (OS 5.0.2)
    iPhone 6+ (iOS 9)

    but not on my
    iPad Mini (iOS 9)
     
    Last edited: Oct 30, 2015
  4. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Hello, could you please submit a bug report with your project attached and post the bug number here? Thanks.
     
  5. ReiAyanami

    ReiAyanami

    Joined:
    Aug 6, 2010
    Posts:
    53
    Was someone able to produce this bug reliably (maybe even with a small project)?

    I had around 3 crashes within 300 users on day 1+2 and I can't find any other reason (as this was the only bug that ever made my app fully crash)
     
  6. menehune23

    menehune23

    Joined:
    Jul 19, 2014
    Posts:
    2
    I've got almost the same issue. The probability of the error is similar too (about 1 in 100 or so). My Xcode window looks almost exactly like yours (image attached). I'm running Unity 5.2.2f1, but cannot remember if it occurred on previous versions.

    Question: Did you fill out a bug report? If so, do you have a link?

    Update: Verified issue still seen in 5.2.0f3. Trying 5.1.4f1 next...

    Update 2: Seems to not be an issue in 5.1.4f1, as I have yet to make it crash. I've also run a development build and ran "bt all" in Xcode to get a stack trace (attached). The EXC_BAD_ACCESS seems to be on thread #14.

    I will point out that I've narrowed down a possible region of my code where this seems to be occurring. In my case, it occurs after I am releasing my mouse button, and I have a theory that the transform.InverseTransformPoint() call that I'm subsequently doing is what is resulting in the native exception (based on the MultiplyPoint3 verbiage). I will test out this theory as soon as I can by creating a project that does nothing but calls to this method, so I can see how often it crashes, if at all.

    Update 3: I've ruled out the previous theory, as I can tell from my original code/project that it gets past the inverse transformation before freezing Unity (due to the native exception). My next theory is that it has to do with the fact that I am kicking off a coroutine from inside another, both of which are operating on the same transform (though different properties, and at different times).
     

    Attached Files:

    Last edited: Nov 10, 2015
  7. oleggelezcov

    oleggelezcov

    Joined:
    Jan 18, 2013
    Posts:
    13
    We have same issue. This occur in random times, frequent when try instantiate prefab for UI (RectTransofrm) or when load new scene
     

    Attached Files:

  8. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Please file a bug report with your project attached. This is the only way we can ever catch and fix such bugs, because even minor variations cause the bug to be no longer reproducible at all.
     
  9. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
    I've submitted Case 738853 a while ago, very similar issue to this one, same UnityWorker thread, but on the Populate() method.

    My test case happens 100% of the time, 1-3 mins into the game.

    Started in 5.2.0, 100% repro in all 5.2.x versions. Last I checked happens with Mono and IL2CPP backends.
     
  10. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Thanks for the bug report, sorry I didn't notice it in the bug database earlier. This is one of hard bugs that are reproducible only sometimes and only in certain situations, so the timeline for the fix is uncertain.
     
  11. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
    I understand, I've been having a back and forth with you QA guys, and last I heard you were having trouble reproducing, even with my repro project.

    I assure you though, I get it to crash 100% of the time, if you need anything else from me (maybe the Xcode project would help?) don't hesitate to ask!
     
  12. shibasaki

    shibasaki

    Joined:
    Feb 12, 2015
    Posts:
    12
    Did you find any workaround to this? We are seeing exactly same issue in our project after upgrading to 5.2 from 4.6.
     
  13. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
    No workaround I'm affraid. =( We compile this game using 5.1, because I'm 99% sure this is a bug in the multi-threaded UI rendering implementation, which came in 5.2.
     
  14. k-sugimoto

    k-sugimoto

    Joined:
    Jul 28, 2015
    Posts:
    4
    I have same problem. But there's a low probability of this problem occurring.
    Do you have any thoughts about trigger of this problem?
     
  15. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
    On my project it happens everytime when running on iOS. It started happening when they introduced multi-threaded rendering for the UI, I'm sure it has to do with that. This game of mine has many (40+) world canvases on-screen at any given time, so that's probably what triggers it. I don't really know anything more specific though! =/
     
  16. k-sugimoto

    k-sugimoto

    Joined:
    Jul 28, 2015
    Posts:
    4
    There are 5 canvases on scene at problem happened in my project.
    These render mode is "Screen Space - Camera".
    Well, this problem not happened yet at single canvas on scene...

    Your reply is helpful for me.
    Thank you!
     
  17. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
    Yeah, it really sounds like someone forgot a lock somewhere, and one canvas' thread is corrupting the memory of another.
     
  18. ReiAyanami

    ReiAyanami

    Joined:
    Aug 6, 2010
    Posts:
    53
    I only use one single canvas in my scene though, not multiple.
     
  19. k-sugimoto

    k-sugimoto

    Joined:
    Jul 28, 2015
    Posts:
    4
    I found sentence as below in release note of Unity5.3.0f2 (beta).
    "UI: Fix occasional crash caused by vertex/index buffers being destroyed before a geometry job terminates."

    I thought this crash is related this fix.
    If my thought is correct, this problem may resolve by to update Unity version.
    But I have shallow knowledge about rendering, I can't say clearly.

    If there are any mistakes in my thought, please let me know.
     
  20. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
  21. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
    Do you have a lot of UI elements though?
    Multi-threading works for any number of canvases, I suppose the bug is just more common when you have a bunch of UI elements being rendered.
    This is all speculation anyway....
     
  22. ReiAyanami

    ReiAyanami

    Joined:
    Aug 6, 2010
    Posts:
    53
    Yes, I have a high number of UI objects in the scene, most of them being inactive at a given time though.
     
  23. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
    Hi ! Didn't notice this thread before, I open mine : http://forum.unity3d.com/threads/random-crash-on-unityworker-5-2-2p3.371696/

    Could be the same thing (I will close mine if so) ? Its a problem with the UI too I think, and it happen only on one particular scene, on one particlar move. (And not always, you need to try a bit before get one)

    Have you find a workaround ? Have you tried with 5.2.3p2 ?

    Since I upgrade my game on Gplay with 5.2 i got many crash because of this issue. Can we have an update on this ?
     
    Last edited: Dec 6, 2015
  24. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
    Update from 5.3 land:

    Like I said I was having a 100% repro rate for this issue in my game, just a mere 2-3 minutes in the game I'd get the crash.
    I installed 5.3 yesterday, played the game for a good 30-40min and no crash. That pretty much confirms to me my issue is gone.

    All of you should try 5.3 and let everyone know what is up!
     
  25. k-sugimoto

    k-sugimoto

    Joined:
    Jul 28, 2015
    Posts:
    4
    Hello.

    I updated unity to 5.3. a week ago and I played my project. Crash is not occurred so far.
    I think that this problem has solved.

    Thank you.
     
  26. menehune23

    menehune23

    Joined:
    Jul 19, 2014
    Posts:
    2
    I've also updated to 5.3 and so far, so good!
     
  27. shibasaki

    shibasaki

    Joined:
    Feb 12, 2015
    Posts:
    12
    Not perfect but workaround for us was avoid toggling UI when CPU load is high.
     
  28. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
    @shibasaki : Have you tried/can you try 5.3? If you can still repro it in 5.3 you should file a new bug report!
     
  29. shibasaki

    shibasaki

    Joined:
    Feb 12, 2015
    Posts:
    12
    I don't see this issue anymore in 5.3. We are still stuck in 5.2 due to new bugs found in 5.3 though :(
     
  30. Ynelo

    Ynelo

    Joined:
    Sep 30, 2014
    Posts:
    4
    Hi,
    I'm still having the bug in Unity 5.3.2p2 mostly on iPhone 6.
    Do you guys are still experiencing issues too?
     
  31. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
    Hi,
    I'm in 5.3.4 and I'm not experiencing it since a while.
     
  32. LotusBlack

    LotusBlack

    Joined:
    Apr 9, 2015
    Posts:
    35
    I recommend 5.3.4, 5.3.3 was definitely sketchy, but 5.3.4 is so far so good!
     
  33. subatomic

    subatomic

    Joined:
    Nov 13, 2014
    Posts:
    24
    Getting this same crash in Unity 5.3.4p6 on iOS devices (iPhone6+, iPadTouch6, iPadPro, iPhone6+s).
    We also got this crash in the older 5.3.2p2 and also 5.3.2p4, as well.
    Xcode Version 7.3 (7D175)

    Appears very randomly, sometimes 1/2 way through a one-room level (30 seconds in), sometimes as long as after playing 5 different levels (3 minutes in). If I enable iOS Debug/DevelopmentBuild/ScriptDebugging in Unity then no crash after 12 levels (15 minutes of play)... Switching back to Release crashed again after 10 seconds once entered a level. Another time Debug did crash after 25 min... so yeah. random.


    Unity 5.3.4p6, xcode 7.3
    CallStack:

    Worker Thread
    MultiplyPoint3
    TransformUIVertices
    TransformUIVertices
    UIGeometryJob
    ExecuteJobFunc
    Exec
    Steal
    ExecuteJobFromQueue
    ProcessJobs
    WorkLoop
    RunThreadWrapper
    _pthread_body
    thread_start
    Breaks at the line below with ->

    Code (CSharp):
    1.   0x100be82e8 <+5296>: b  0x100be8300  ; <+5320> [inlined] TransformUIVertices<true, false, false> + 520 at UIJobs.cpp:270
    2.   0x100be82ec <+5300>: orr  x8, xzr, #0x100000000
    3.   0x100be82f0 <+5304>: add  x21, x21, x8
    4.   0x100be82f4 <+5308>: add  w8, w19, #1  ; =1
    5.   0x100be82f8 <+5312>: ldr  x9, [sp, #336]
    6.   0x100be82fc <+5316>: ldr  s17, [x9]
    7.   0x100be8300 <+5320>: ubfx  x19, x8, #0, #32
    8.   0x100be8304 <+5324>: asr  x23, x21, #32
    9.   0x100be8308 <+5328>: ldr  x8, [sp, #272]
    10.   0x100be830c <+5332>: ldr  x9, [sp, #256]
    11.   0x100be8310 <+5336>: madd  x8, x23, x9, x8
    12. ->  0x100be8314 <+5340>: ldp  s18, s19, [x8]
    We're using il2cpp

    Copy&Paste from Xcode:

    Code (CSharp):
    1. Thread 1 Queue : com.apple.main-thread (serial)
    2. Thread 4
    3. Thread 5 Queue : com.apple.libdispatch-manager (serial)
    4. gputools.smt_poll.0x14451ea20(6)
    5. GC Finalizer(9)
    6. BatchDeleteObjects(10)
    7. AsyncReadManager(11)
    8. Worker Thread(12)
    9. #0   0x0000000100c98314 in MultiplyPoint3 [inlined] at /Users/builduser/buildslave/unity/build/./Runtime/Math/Matrix4x4.h:304
    10. #1   0x0000000100c98314 in TransformUIVertices<true, false, false> [inlined] at /Users/builduser/buildslave/unity/build/Runtime/UI/UIJobs.cpp:217
    11. #2   0x0000000100c980f8 in TransformUIVertices [inlined] at /Users/builduser/buildslave/unity/build/Runtime/UI/UIJobs.cpp:270
    12. #3   0x0000000100c96f24 in ::UIGeometryJob() at /Users/builduser/buildslave/unity/build/Runtime/UI/UIJobs.cpp:308
    13. #4   0x0000000100982394 in ExecuteJobFunc [inlined] at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:325
    14. #5   0x0000000100982384 in ::Exec() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:345
    15. #6   0x0000000100982318 in ::Steal() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:444
    16. #7   0x0000000100982620 in ::ExecuteJobFromQueue() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:641
    17. #8   0x0000000100982770 in :: ProcessJobs() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:720
    18. #9   0x0000000100981dc8 in ::WorkLoop() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:754
    19. #10   0x0000000100ae6364 in ::RunThreadWrapper() at /Users/builduser/buildslave/unity/build/Runtime/Threads/Thread.cpp:40
    20. #11   0x00000001809f3b28 in _pthread_body ()
    21. #12   0x00000001809f3a8c in _pthread_start ()
    22. #13   0x00000001809f1028 in thread_start ()
    23. AVAudioSession Notify Thread(13)
    24. Thread 14AURemoteIO::IOThread (15)
    25. Thread 16com.apple.CoreMotion.MotionThread (17)
    26. UnityPreload (18)
    27. BackgroundWorker (19)
    28. BackgroundWorker (20)
    29. com.apple.NSURLConnectionLoader (22)
    30. com.apple.CFSocket.private (24)
    31. Thread 25
    32. Thread 26
    33. Thread 27
     
    Last edited: May 20, 2016
  34. subatomic

    subatomic

    Joined:
    Nov 13, 2014
    Posts:
    24
    And we got a different, yet UI related crash on iOS - in Release() called by UIGeometryJob():
    Unity 5.3.4p6, xcode Version 7.3 (7D175)

    Code (CSharp):
    1. MyAppName`::Release():
    2.     0x1013f9604 <+0>:  stp    x20, x19, [sp, #-32]!
    3.     0x1013f9608 <+4>:  stp    x29, x30, [sp, #16]
    4.     0x1013f960c <+8>:  add    x29, sp, #16              ; =16
    5.     0x1013f9610 <+12>: mov    x19, x1
    6.     0x1013f9614 <+16>: mov    x20, x0
    7.     0x1013f9618 <+20>: add    x1, x20, #8               ; =8
    8.     0x1013f961c <+24>: movn   w0, #0
    9.     0x1013f9620 <+28>: bl     0x101c9bcd8               ; symbol stub for: OSAtomicAdd32Barrier
    10.     0x1013f9624 <+32>: cbz    w0, 0x1013f9634           ; <+48> at ThreadSharedObject.h:17
    11.     0x1013f9628 <+36>: ldp    x29, x30, [sp, #16]
    12.     0x1013f962c <+40>: ldp    x20, x19, [sp], #32
    13.     0x1013f9630 <+44>: ret
    14.     0x1013f9634 <+48>: ldr    x8, [x20]
    15.     0x1013f9638 <+52>: ldr    x8, [x8]
    16.     0x1013f963c <+56>: mov    x0, x20
    17.     0x1013f9640 <+60>: blr    x8
    18. --> 0x1013f9644 <+64>: mov    x0, x20
    19.     0x1013f9648 <+68>: mov    x1, x19
    20.     0x1013f964c <+72>: ldp    x29, x30, [sp, #16]
    21.     0x1013f9650 <+76>: ldp    x20, x19, [sp], #32
    22.     0x1013f9654 <+80>: b      0x1013de56c               ; ::free_alloc_internal() at MemoryManager.cpp:287
    And the active threads / stacktrace:

    Code (CSharp):
    1. Thread 1 Queue : com.apple.main-thread (serial)
    2. Thread 4
    3. Thread 5 Queue : com.apple.libdispatch-manager (serial)
    4. gputools.smt_poll.0x1556767b0 (6)
    5. Thread 8
    6. Thread 9
    7. GC Finalizer (10)
    8. UnitySocketReader (11)
    9. UnitySocketWriter (12)
    10. BatchDeleteObjects (13)
    11. AsyncReadManager (14)
    12. Worker Thread (15)
    13. #0    0x0000000000000000 in 0x00000000 ()
    14. #1    0x00000001013f9644 in ::Release() at /Users/builduser/buildslave/unity/build/./Runtime/Threads/ThreadSharedObject.h:17
    15. #2    0x00000001016d0594 in Release [inlined] at /Users/builduser/buildslave/unity/build/./Runtime/Graphics/Mesh/SharedMeshData.h:40
    16. #3    0x00000001016d058c in ::UIGeometryJob() at /Users/builduser/buildslave/unity/build/Runtime/UI/UIJobs.cpp:308
    17. #4    0x00000001013bfbb0 in ExecuteJobFunc [inlined] at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:325
    18. #5    0x00000001013bfba0 in ::Exec() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:345
    19. #6    0x00000001013bfb34 in ::Steal() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:444
    20. #7    0x00000001013bfe3c in ::ExecuteJobFromQueue() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:641
    21. #8    0x00000001013bff8c in ::ProcessJobs() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:720
    22. #9    0x00000001013bf5e4 in ::WorkLoop() at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Internal/JobQueue.cpp:754
    23. #10    0x00000001015207d0 in ::RunThreadWrapper() at /Users/builduser/buildslave/unity/build/Runtime/Threads/Thread.cpp:40
    24. #11    0x000000019a807b28 in _pthread_body ()
    25. #12    0x000000019a807a8c in _pthread_start ()
    26. #13    0x000000019a805028 in thread_start ()
    27. AVAudioSession Notify Thread (16)
    28. Thread 17AURemoteIO::IOThread (18)
    29. Thread 19
    30. com.apple.CoreMotion.MotionThread (20)
    31. UnityPreload (21)
    32. BackgroundWorker (22)
    33. BackgroundWorker (23)
     
    Last edited: May 20, 2016
  35. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Could you please submit a bug report and attach the project that reproduces the crash? Could you post the id of the new bug here? Thanks.
     
  36. subatomic

    subatomic

    Joined:
    Nov 13, 2014
    Posts:
    24
    Bug ID is 797645, I let it sit for a full 24 hours, and it never completed, so I removed my project from the bugreport upload.
     
    Last edited: May 18, 2016
  37. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Thanks. The repro project is essential to fixing the bug however. I've sent you an email with alternative upload instructions.
     
    Last edited: May 19, 2016
  38. andreasp79

    andreasp79

    Joined:
    May 20, 2016
    Posts:
    1
    I am also experiencing this crash very frequently, in all recent versions including 5.3.4. I have filed issue 798695 with a project that reproduces it.

    I understand that issues like this can be hard to track down (it only happens in a release build), but for many of us stability is far more important than performance improvements that may not even benefit small projects at all. Can we please get a way to disable multithreading rendering of the UI as a workaround?
     
    subatomic likes this.
  39. subatomic

    subatomic

    Joined:
    Nov 13, 2014
    Posts:
    24
    Thank you, I uploaded a build. Hope you can reproduce. Let me know if any questions.
     
  40. subatomic

    subatomic

    Joined:
    Nov 13, 2014
    Posts:
    24
    Hi, any progress on this one?
    For latest Unity 5.3.5p2, We continue to get this random crash with similar stacktrace as before.

    The stacktrace is similar (also inside UIGeometryJob), but doesn't have the (MultiplyPoint3, TransformUIVertices, TransformUIVertices, or the Release()).

    Code (CSharp):
    1. * thread #9: tid = 0xcde4, 0x0000000100d93804 Airways`UI::UIGeometryJob(UI::UIGeometryJobData*) + 5372, name = 'Worker Thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    2.   * frame #0: 0x0000000100d93804 Airways`UI::UIGeometryJob(UI::UIGeometryJobData*) + 5372
    3.     frame #1: 0x00000001009e2aac Airways`JobQueue::Exec(JobInfo*, long long, int) + 96
    4.     frame #2: 0x00000001009e2a30 Airways`JobQueue::Steal(JobGroup*, JobInfo*, long long, int) + 236
    5.     frame #3: 0x00000001009e2d38 Airways`JobQueue::ExecuteJobFromQueue() + 112
    6.     frame #4: 0x00000001009e2e68 Airways`JobQueue::ProcessJobs(void*, bool*) + 60
    7.     frame #5: 0x00000001009e2538 Airways`JobQueue::WorkLoop(void*) + 12
    8.     frame #6: 0x0000000100b4b75c Airways`Thread::RunThreadWrapper(void*) + 64
    9.     frame #7: 0x000000019ae9fb28 libsystem_pthread.dylib`_pthread_body + 156
    10.     frame #8: 0x000000019ae9fa8c libsystem_pthread.dylib`_pthread_start + 156
    11.     frame #9: 0x000000019ae9d028 libsystem_pthread.dylib`thread_start + 4
    12. (lldb)
    13.  
    14. -------------------
    15.  
    16. Worker Thread (9)
    17. #0    0x0000000100d93804 in UI::UIGeometryJob(UI::UIGeometryJobData*) ()
    18. #1    0x00000001009e2aac in JobQueue::Exec(JobInfo*, long long, int) ()
    19. #2    0x00000001009e2a30 in JobQueue::Steal(JobGroup*, JobInfo*, long long, int) ()
    20. #3    0x00000001009e2d38 in JobQueue::ExecuteJobFromQueue() ()
    21. #4    0x00000001009e2e68 in JobQueue::ProcessJobs(void*, bool*) ()
    22. #5    0x00000001009e2538 in JobQueue::WorkLoop(void*) ()
    23. #6    0x0000000100b4b75c in Thread::RunThreadWrapper(void*) ()
    24. #7    0x000000019ae9fb28 in _pthread_body ()
    25. #8    0x000000019ae9fa8c in _pthread_start ()
    26. #9    0x000000019ae9d028 in thread_start ()
    See this forum post, which has others with the similar UIGeometryJob crash issue as well:
    http://forum.unity3d.com/threads/crashes-on-ios-ui-uigeometryjob.366470/#post-2663155

    I'll submit a bug report if you give me a cloud upload link. (Big project)
     
    Last edited: Jun 3, 2016
  41. subatomic

    subatomic

    Joined:
    Nov 13, 2014
    Posts:
    24
    This is killing our ability to demo the app to people who may want to give us money in the future (going to become a serious issue soon for us).
     
  42. ScroodgeM

    ScroodgeM

    Joined:
    Jul 14, 2012
    Posts:
    3
    Looks like we found a solution which can help you too.

    We have some UI position calculations in LateUpdate() cycle. Once calculated, new positions and states (like fillAmount, color properties in sprites etc) are applied to UI transforms and components in LateUpdate() body immediately.

    In this implementation, we catch a crash randomly in UI::UIGeometryJob

    As far as I understand, unity UI thread already running when LateUpdate() executed and changing any UI transforms or components properties can change data which UI thread working with in his own thread

    So our solution was as simple as possible - we move all UI property/positions applying to Update() cycle

    Profit! Out app is not crashing anymore! I hope Unity will fix this bug in future releases, but this hint can save some hair on head 8)

    I think not only LateUpdate() can cause these crashes, but also some late-executing methods too (e.g. OnPostRender), so try to avoid any UI components changing anywhere except Update()
     
  43. subatomic

    subatomic

    Joined:
    Nov 13, 2014
    Posts:
    24
    Thanks for the tip!
    Interesting, how do we know this is true?
    If true, it sounds like UIGeometryJob is not threadsafe with other UI calls in LateUpdate() or OnPostRender()...
    Can someone Unity side confirm?

    Does UIGeometryJob handle Unity UI only, or does it handle other geometry (like game meshes) as well. Not sure the naming convention inside the engine, since it's a black box. In engines sometimes "UI" could refer to the controlling display window (rather than some user interface queue for example)... Googling UIGeometryJob just shows places where people had crash bugs. :)

    Looking at our codebase, in all *.cs files, we have Curvey assetstore plugin which uses LateUpdate(), and AmplifyMotion FX assetstore plugin, and another utility we wrote which calls Transform.TransformPoint()/ InverseTransformPoint() and Mesh.RecalculateBounds() ...
     
    Last edited: Jun 6, 2016
  44. adamt

    adamt

    Joined:
    Apr 1, 2014
    Posts:
    114
    I'm getting a similar issue in iOS on 5.3.5p2 and am at a loss. I submitted a bug report (806655) but who knows if it'll ever get looked at. I'm incredibly despondent recently about Unity's ability to deliver stable releases. Unity is by far the most expensive software we have at our studio, but every time I update in hopes of fixing one issue, another (if not multiple) issue occurs.

    I realize it's incredibly complex software, but developers need better visibility into the QA process, because right now it feels completely arbitrary, and I just have to hope that the new patch release fixes my issue, without causing more.
     
    OrenMunkyFun likes this.
  45. subatomic

    subatomic

    Joined:
    Nov 13, 2014
    Posts:
    24
    I got a reply from QA saying they can consistently replicate the bug now, and that largely it was due to them having a build from one of us. I'd like to stress how important it is to submit builds which show the problem, it really helps them. They're reportedly still working on pinning down the cause of the bug.... but it's good news to hear that they can replicate the bug, that is huge.
     
  46. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    FYI the bug fix has been released to the most recent versions of 5.3.x and 5.4.x a couple of weeks ago. Many thanks to subatomic for the project, without it we wouldn't have been able to fix the bug.
     
  47. LLLLXXXXLLLL

    LLLLXXXXLLLL

    Joined:
    Jun 26, 2016
    Posts:
    2
    @povilas Still getting this crash, 5.5.4f1 android il2cpp build
     
  48. kl_hujiajie

    kl_hujiajie

    Joined:
    Jun 19, 2019
    Posts:
    1
    @povilas Still getting this crash, 5.5.6f1 android il2cpp build
     
  49. yonek_idreams

    yonek_idreams

    Joined:
    Sep 10, 2014
    Posts:
    15
    Still getting this crash, 2019.2.5f1 ios il2cpp build!
    Could you guys give up and make the UI not running as a separate job? You are not able to fix it since 2015 !!!
     
unityunity