Search Unity

Bug Crash On Android from null pointer dereference

Discussion in 'Graphics for ECS' started by Occuros, Jan 4, 2023.

  1. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    Using the current released entities 1.0.0-pre.15 entities + entities graphics package our application crashes with a null pointer dereference which seems to come from deep down in the engine code.

    Attached is the android logcat exception with backtrace.

    Any help on how to investigate this further would be appreciated.
     

    Attached Files:

  2. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    After further investigation, it seems connected to the particle system, is this a known issue? Might it not have anything to do with Entities' graphics directly?
     
  3. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    Even with the latest editor release (2022.2.2f1) we still experience the same.

    Attached is the tombstone file as well as the crash from logcat.

    We have other projects which don't use ecs and entity graphics, and they don't suffer the same issue, so it seems to be related to the entity graphics in some way.
     

    Attached Files:

  4. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    It is hard to say from the call stacks what is the root cause of the problem.

    You said you believe it's connected to the particle system, can you share more details about this? Do you have particle systems placed inside Subscenes?

    Would it be possible for you to submit a repro project for this issue?
     
  5. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    The main reason why we believe that it's related to the particle system is as it only started happening when we added some effects.

    We not have done multiple testing rounds with and without any particles (We tried both with the old Shuriken particle system and the new vfx graph).

    When we have particles, usually we observe the crash within 3-5 minutes of playing. If we disable all particles we never managed to have a crash, even when playing for 10+ minutes (and testing multiple times).

    So it is likely related to the particle effects.

    A simple repro case we don't have just yet, as we were hoping someone with a deeper understanding of the rendering pipeline could identify what the root cause of the issue might be from the logs.
     
  6. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    We submitted a bug report with the project under: IN-29364

    We tried with both GLES3 and Vulkan renderer, and both seem to behave the same way.
     
  7. Pixionrevolution

    Pixionrevolution

    Joined:
    Feb 2, 2017
    Posts:
    5
    Hello there,
    I had the same behavior and I confirm that there's bug going on with URP on Quest 2 build. Fixed it by switching back to Built-in RP but it might be worth considering investigating the deeper root of the bug.
     
  8. aVaKus

    aVaKus

    Joined:
    Oct 12, 2012
    Posts:
    9
    @Occuros I'm seeing this same issue. Were you able to fix it? Could you like to the unity bug report. I'd like to vote for it.
     
  9. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    The bug report was closed, as it was not possible to reproduce it on their end. It is a really hard to track down issue, as for us it doesn't happen in any predictable pattern.

    We now upgraded to the latest release and editor and up to now we haven't seen the issue anymore (but we also upgraded a lot of the gameplay codebase).


    We did also encounter a similar issue and that was caused by the unity physics system which ran too early in an IBodyPairJob, where we modified the physics outcome.

    So it is unclear where it might be coming from, it could very well be that it comes from the unity physics package, ecs or the graphics.

    If anyone has a good reproduction case, please let unity know as they can only fix what we manage to consistently reproduce.