Search Unity

Encounter problem like Assertion Failed when running UWP game on PC.

Discussion in 'Windows' started by Wecica, Mar 12, 2018.

  1. Wecica

    Wecica

    Joined:
    Jul 20, 2016
    Posts:
    27
    The game in exe format doesn't have a problem like this.
    The exception occurs when I load my game scene from the menu. Just like below,
    I don't even find this file in my project.

    Assertion failed on expression: 'all(t >= -0.01f) && all(t <= 1.01f)'
    (Filename: c:\buildslave\unity\build\runtime\particlesystem\PolynomialCurve.h Line: 218)

    Anyone who has any idea about this please give me a hand. Thanks in advance. Orz
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,675
    This is a bug in Unity. Can we have a bug report?

    This shouldn't happen in Release/Master builds. You should be able to work around it by not using "Debug" build configuration.
     
    Salvador-Romero likes this.
  3. Wecica

    Wecica

    Joined:
    Jul 20, 2016
    Posts:
    27
    Hi Zilys:
    Yes, I use Debug on my PC, this also happens when I debug it on Xbox. I'm sorry that I don't know where I could find the bug report, please tell me and I will show it to you. Thanks.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,675
  5. AAR_team

    AAR_team

    Joined:
    Jul 6, 2018
    Posts:
    10
    Hi,
    a similar assertion fail is happening for me in Unity 2018.4.0f1 (IL2CPP scripting backend) when running UWP app on HoloLens in Debug mode.

    Assertion failed on expression: 'light.GetBounceIntensity() != 0.f'
    (Filename: C:\buildslave\unity\build\Runtime/GI/Enlighten/Lights.cpp Line: 147)
    ABCXYZ.exe has triggered a breakpoint.

    For me breakpoint is also being hit and then I can't continue to debug as it says source is missing. I am not sure if this is linked with the assertion fail or not. This problem started happening when I upgraded from 2018.2.13f1 (IL2CPP backend as well).
    Is this also a bug? If not any possible solution?
    Thanks.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,675
    Yes, anything that contains a string "Assertion failed on expression" is a bug in Unity.

    Missing source will not prevent you from continuing through a failed assertion. What happens exactly when you press F5?

    You could build in Release config where assertions are disabled.
     
  7. AAR_team

    AAR_team

    Joined:
    Jul 6, 2018
    Posts:
    10
    Wow! you are impressive...always a prompt reply :)
    Actually, it get stuck and pressing F5/Continue keeps on throwing "Source Not Available" with following Stack Frame. stackTrace.png
     
    Salvador-Romero likes this.
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,675
    That's probably because the assertion happens every frame. I'd suggest testing in Release mode for now (is there anything you need Debug mode for anyway?).

    By the way, did you submit a bug report about this yet?
     
    Salvador-Romero likes this.
  9. AAR_team

    AAR_team

    Joined:
    Jul 6, 2018
    Posts:
    10
    Yes, I need to debug.I have an AR keyboard which stopped working after Unity upgrade to 2018.4.0. I am not sure if that has to do anything with this assertion. (In release mode, exception is thrown at a memory location as soon as I try to use AR keyboard, this wasn't happening in the previous version 2018.2.13 and I am finding it difficult to understand without debug being enabled)

    No, I haven't submitted the bug report but will do that.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,675
    If you need to build your project in debug, you could modify the generated project file (Unity Data.vcxitems) to always use Release UnityPlayer even when building your project in debug. Change this:

    Code (csharp):
    1.   <PropertyGroup Condition="'$(Configuration)'!='MasterWithLTCG'">
    2.     <UnityPlayerConfiguration>$(Configuration)</UnityPlayerConfiguration>
    3.   </PropertyGroup>
    4.   <PropertyGroup Condition="'$(Configuration)'=='MasterWithLTCG'">
    5.     <UnityPlayerConfiguration>Master</UnityPlayerConfiguration>
    6.   </PropertyGroup>
    To this:


    Code (csharp):
    1.   <PropertyGroup Condition="'$(Configuration)'!='MasterWithLTCG' AND '$(Configuration)'!='Debug'">
    2.     <UnityPlayerConfiguration>$(Configuration)</UnityPlayerConfiguration>
    3.   </PropertyGroup>
    4.   <PropertyGroup Condition="'$(Configuration)'=='Debug'">
    5.     <UnityPlayerConfiguration>Release</UnityPlayerConfiguration>
    6.   </PropertyGroup>
    7.   <PropertyGroup Condition="'$(Configuration)'=='MasterWithLTCG'">
    8.     <UnityPlayerConfiguration>Master</UnityPlayerConfiguration>
    9.   </PropertyGroup>
    That way your project will still be built in Debug, but it will use Unity's Release code, making the assert not fire.
     
    Salvador-Romero likes this.
  11. AAR_team

    AAR_team

    Joined:
    Jul 6, 2018
    Posts:
    10
    Thanks! I'll try this.
     
  12. AAR_team

    AAR_team

    Joined:
    Jul 6, 2018
    Posts:
    10
    Tried this but this do not print debug logs (by Debug.Log). Any way to still print debug logs? Thanks.
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,675
    Release build of the engine doesn't print to debugger output window for performance reasons :(. That stuff still gets printed to log file, though, which you should be able to retrieve. Is this on PC or a HoloLens device?
     
    Salvador-Romero likes this.
  14. AAR_team

    AAR_team

    Joined:
    Jul 6, 2018
    Posts:
    10
    I see...its on HoloLens. That mean I can find those logs in UnityPlayer.log inside app installation (localAppData > AppInstallationDirectory>TempState) in HoloLens. Cool, I'll check them.