Search Unity

File and line numbers in stack trace

Discussion in 'Unity Cloud Diagnostics' started by colinday, Nov 15, 2015.

  1. colinday

    colinday

    Joined:
    Jan 9, 2012
    Posts:
    17
    It seems that line numbers are not reported with the managed stack trace in my release builds and sent to Unity Game Performance Reporting, but they do show up in the editor. Presumably this is because of a difference between development and release builds, or that my release builds doesn't have some extra symbol data to give line numbers.

    Is there a way I can configure anything or additional files I can include in my release builds to have line numbers reported with the exception callstacks received from an Application.logMessageReceived handler?

    Here is an example of a callstack reported by Unity Game Performance, the file/line would normally appear appear after the parameter list but is absent.

    AssemblyCSharp.SkillDecisions.fillActorListFromSource (.Actor actor, System.Collections.Generic.List`1 results, .Actor source)
    AssemblyCSharp.SkillDecisions.findTargetsWithinRadius (.Actor source, .Map map, Int32 radius, System.Collections.Generic.List`1 targets)
    AssemblyCSharp.SkillDecisions.Collect (.Actor owner, Int32 awarenessRadius, System.Collections.Generic.List`1 prioritySkills)
    AI.GenerateAction ()
    FollowerAI.GenerateAction ()
    Actor.doGenerateAction ()
    Follower.doGenerateAction ()
    Actor.GenerateAction (Int32 currentTurn)
    AssemblyCSharp.ActionManager.updateTurn ()
    AssemblyCSharp.ActionManager.Update ()
    Map.UpdateMap ()
    MapManager.Update ()
     
    Novack likes this.
  2. ChrisLundquist

    ChrisLundquist

    Unity Technologies

    Joined:
    Mar 2, 2015
    Posts:
    55
    You're exactly right, having line numbers here would be quite helpful.

    I also think you're right, that the reason is because the game is running in release mode and doesn't have debug symbols. Your example stack trace is all we get from the exception object.

    Sadly, there is no additional configuration to turn these on service wise. If there is a way to do it, you would have to do it in the editor / build configuration.

    Let me know if you have any thoughts or ideas!

    Chris Lundquist
     
  3. Roxley

    Roxley

    Joined:
    Aug 13, 2017
    Posts:
    1
    How can you than have lines numbers in release mode ?

    Android Google Play dosn't allow to upload apps in development mode.
     
  4. jiwana

    jiwana

    Joined:
    Oct 16, 2014
    Posts:
    1
    I am also hoping to see line numbers in stack traces for release builds. Is there a solution to this?
     
  5. MercurialKid

    MercurialKid

    Joined:
    Aug 30, 2018
    Posts:
    22
    "I am also hoping to see line numbers in stack traces for release builds"

    +1 this should be a standard feature

    Debug.Log - should be able to add Class name and Line number to run time logs: currently I'm having to type out a required amount of information by hand...!
     
  6. ookk47oo

    ookk47oo

    Joined:
    Mar 17, 2017
    Posts:
    30
    So it's 2019 now and this is still not supported?
     
  7. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,470
    Hey everyone. We have an upcoming Hack Week where the devs will be looking into seeing how line numbers can be grabbed from IL2CPP release builds. Pending how that prototype session goes will determine how soon, or if at all, we'll be able to get this feature in. Thank you, everyone, for your interest and we'll make sure to update you once we have any updates.
     
  8. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    97
    Is there any update regarding line numbers being included in release builds logs?
    Thanks
     
  9. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,470
    Hi @Menion-Leah, we're actively working on this feature right now. Currently, we have it working for Mac and Windows and are trying to see if we can get it working for mobile platforms as well. I don't have any updates on when this feature will be released but we are working on it.
     
    IOU_RAY and Menion-Leah like this.
  10. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    97
    That's good news! Thank you
     
  11. IOU_RAY

    IOU_RAY

    Joined:
    Jul 25, 2017
    Posts:
    33
    Glad to hear about windows. Will this also be available on WebGL?

    Is this something we can expect in 2019 builds, or?

    Not to quote you officially on it, but just what version(s) you're thinking/hoping for.
     
  12. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,470
    Hi @IOU_RAY, at the moment we do not have plans to add release build line number support to WebGL. We'd first like to get native crash support in for WebGL before moving on to adding release line numbers.

    And unfortunately, we won't be able to back port this to 2019 versions since this is a brand new feature and not just a bug fix. We are tentatively aiming for 2020.2 for this, however don't quote me on that. :)
     
  13. i9mobile

    i9mobile

    Joined:
    Aug 8, 2013
    Posts:
    30
    Nice to know that you guys are working on better crash analytics...
    waiting for line numbers stack tracing on mobile... now my crash stack trace is something like this:

    Managed Stack Trace:

    EVP.VehicleDamage.ProcessImpact () (at <00000000000000000000000000000000>:0)
    EVP.VehicleController+OnImpact.Invoke () (at <00000000000000000000000000000000>:0)
    EVP.VehicleController.HandleImpacts () (at <00000000000000000000000000000000>:0)
    EVP.VehicleController.FixedUpdate () (at <00000000000000000000000000000000>:0)

    very hard to find where is the problem...

     
  14. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,470
    Hi @i9mobile, is this stack trace for a release or debug build? If a debug build, do you have Script Debugging enabled in the Build Settings?
     
  15. i9mobile

    i9mobile

    Joined:
    Aug 8, 2013
    Posts:
    30
    Sorry for the delay. This was for a release APK build on Google Play. The stack trace was generated by Unity Crash Analytics.
     
  16. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,470
    No worries on the delay. Unfortunately, for release builds we aren't able to get that much detail on stack traces from the scripting backend, which would explain why you are only seeing method names and no line numbers. Our hope is that we'll have more accurate line numbers for IL2CPP release builds available in the near future.
     
  17. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    80
    So is there is still no way to get line numbers in non-developer builds? I was going to add some automated error reporting in my app but if the only way to get line numbers is a developer build that's not really a solution (Unity 2017.3.1f1, Mono backend).
     
  18. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,470
    Hi @FairGamesProductions, you're correct that there currently isn't a way to get line numbers in release builds. We had plans to add them for IL2CPP release builds but the team has had to put a hold on that work for the foreseeable future. We will be sure to update everyone here when things change.
     
  19. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    80
    Thanks for the reply @ryanc-unity but I'm using the Mono backend not IL2CPP.
     
  20. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,470
    Apologies for the late reply, @FairGamesProductions. Mono does not have support for line numbers in stack traces for either debug or release builds.
     
unityunity