Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved InitializeHideInCallstackMethodsCache() throwing

Discussion in '2022.2 Beta' started by SugoiDev, May 19, 2022.

  1. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    395
    Just notice this method throwing while testing a13.

    The problem is in this line (github permalink). It seems it is possible to create identical HideInCallstackGenericMethodKey structs, so that line will throw when the key is already there.
    The immediate fix is to use TryAdd(method) and bail if returns false.

    I will see if I can submit a proper bug report, but I'm a bit pressed for time right now, so I decided to at least get this threat going in the meantime.


    Thanks for reading!
     
  2. claudiaantoun

    claudiaantoun

    Unity Technologies

    Joined:
    May 14, 2021
    Posts:
    8
    Thanks for looking into this! I'll fix it as soon as possible.
     
    JonSWEDEN and SugoiDev like this.
  3. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    395
    I did a bit of digging today and might have found the cause.
    It seems it doesn't support overloads.
    Using TryAdd() instead of Add() is a possible fix.

    Case #IN-8307
     
  4. claudiaantoun

    claudiaantoun

    Unity Technologies

    Joined:
    May 14, 2021
    Posts:
    8
    Hey @SugoiDev,

    Thank you for looking into this, and apologies for the delay.
    The bug has been fixed, but hasn't been added to the 2022.2 version.
    I will let you know as soon as it has!
     
    SugoiDev likes this.
  5. claudiaantoun

    claudiaantoun

    Unity Technologies

    Joined:
    May 14, 2021
    Posts:
    8
    Hey @SugoiDev,
    The fix should have landed in the latest version of 2022.2.
     
    SugoiDev likes this.