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:
    25
    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:
    80
    So it's 2019 now and this is still not supported?
     
  7. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    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:
    189
    Is there any update regarding line numbers being included in release builds logs?
    Thanks
     
  9. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    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:
    189
    That's good news! Thank you
     
  11. IOU_RAY

    IOU_RAY

    Joined:
    Jul 25, 2017
    Posts:
    127
    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. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    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:
    54
    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. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    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:
    54
    Sorry for the delay. This was for a release APK build on Google Play. The stack trace was generated by Unity Crash Analytics.
     
  16. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    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:
    81
    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. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    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:
    81
    Thanks for the reply @ryanc-unity but I'm using the Mono backend not IL2CPP.
     
  20. Ryan-Unity

    Ryan-Unity

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

    fiveampsoftware

    Joined:
    Feb 9, 2015
    Posts:
    33
    Would love to see this reprioritized or any update from the team on this.
     
    Menion-Leah and IOU_RAY like this.
  22. a-tauzzi

    a-tauzzi

    Joined:
    Dec 20, 2015
    Posts:
    33
    This would be a really nice feature, it is very difficult do understand where my non-fatals crashes are without line numbers.
     
  23. vermahit

    vermahit

    Joined:
    Jul 24, 2020
    Posts:
    4
    Hi @ryanc-unity,

    Is there any update regarding feature of line numbers being included in release builds logs? I can't see line numbers in player.log when I run mac build Unity app. It just show 0 in the line numbers.
    I am using 2020.3.4f1 version.

    Thanks
     
    ddooms and Menion-Leah like this.
  24. ddooms

    ddooms

    Joined:
    Jun 10, 2015
    Posts:
    7
    I still want and need this, please feel free to update us on this :)
     
  25. ddooms

    ddooms

    Joined:
    Jun 10, 2015
    Posts:
    7
    ok update myself, seems to be getting line numbers I was seeing my placeholder without them lol. upload_2021-8-16_21-15-19.png
     

    Attached Files:

  26. vermahit

    vermahit

    Joined:
    Jul 24, 2020
    Posts:
    4
    Hi,
    What changes you added to get line numbers on release build? Is it showing on your Player.log ?
     
  27. dan_ginovker

    dan_ginovker

    Joined:
    Jun 13, 2021
    Posts:
    76
    Is there any update? I know it's a strange feature, but it could be exceptionally helpful for debugging production apps
     
    pistoleta and Menion-Leah like this.
  28. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Is not a strange feature, non IL2CPP builds have it. And it's extremely useful for debugging.
    Please we need it!
     
    dan_ginovker and Menion-Leah like this.
  29. yahahawow

    yahahawow

    Joined:
    Nov 17, 2021
    Posts:
    1
    hi,is there any update?
     
    Menion-Leah likes this.
  30. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Yes, we are hoping to ship an optional setting to allow line numbers in stack traces for IL2CPP in Unity 2023.1. The feature is not complete yet, but I think that we will make it.
     
  31. j1mmie

    j1mmie

    Joined:
    Oct 31, 2013
    Posts:
    32
    1 year later - any update on this feature?
     
    Menion-Leah and IOU_RAY like this.
  32. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938