Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nulls in debug info dictionary #535

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

xenolightning
Copy link
Contributor

@xenolightning xenolightning commented Jun 20, 2024

There is a possibility that a frame does not have any debugging information attached to it.

This happens when DebugSymbols is set to "None", and the output is in Release mode. The result is DebugInfo but it does not have a signature or other properties.

This addresses that particular scenario, by null checking the debug info as well as the signature before attempting to create the lookup dictionary.

image

image

System.Exception: Really bad explosion
   at MyCoolClassLibrary.AwesomeClass.ThrowsAnException()
   at Program.<Main>$(String[] args)
Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'key')
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
   at Mindscape.Raygun4Net.RaygunErrorMessageBuilder.GetDebugInfoForStackFrames(IEnumerable`1 frames) in C:\BuildAgent\work\75116afedfe31196\Mindscape.Raygun4Net.NetCore.Common\Builders\RaygunErrorMessageBuilder.cs:line 233
   at Mindscape.Raygun4Net.RaygunErrorMessageBuilder.Build(Exception exception) in C:\BuildAgent\work\75116afedfe31196\Mindscape.Raygun4Net.NetCore.Common\Builders\RaygunErrorMessageBuilder.cs:line 204
   at Mindscape.Raygun4Net.RaygunMessageBuilder.SetExceptionDetails(Exception exception) in C:\BuildAgent\work\75116afedfe31196\Mindscape.Raygun4Net.NetCore.Common\Builders\RaygunMessageBuilder.cs:line 54
   at Mindscape.Raygun4Net.RaygunClientBase.BuildMessage(Exception exception, IList`1 tags, IDictionary userCustomData, RaygunIdentifierMessage userInfo, Action`1 customiseMessage) in C:\BuildAgent\work\75116afedfe31196\Mindscape.Raygun4Net.NetCore.Common\RaygunClientBase.cs:line 427
   at Mindscape.Raygun4Net.RaygunClientBase.StripAndSend(Exception exception, IList`1 tags, IDictionary userCustomData, RaygunIdentifierMessage userInfo) in C:\BuildAgent\work\75116afedfe31196\Mindscape.Raygun4Net.NetCore.Common\RaygunClientBase.cs:line 454
   at Mindscape.Raygun4Net.RaygunClientBase.SendAsync(Exception exception, IList`1 tags, IDictionary userCustomData, RaygunIdentifierMessage userInfo) in C:\BuildAgent\work\75116afedfe31196\Mindscape.Raygun4Net.NetCore.Common\RaygunClientBase.cs:line 366
   at Mindscape.Raygun4Net.RaygunClientBase.Send(Exception exception, IList`1 tags, IDictionary userCustomData) in C:\BuildAgent\work\75116afedfe31196\Mindscape.Raygun4Net.NetCore.Common\RaygunClientBase.cs:line 322
   at Mindscape.Raygun4Net.RaygunClientBase.Send(Exception exception) in C:\BuildAgent\work\75116afedfe31196\Mindscape.Raygun4Net.NetCore.Common\RaygunClientBase.cs:line 295
   at Program.<Main>$(String[] args)
   at Program.<Main>(String[] args)

There is a possibility that a frame does not have any debugging information attached to it.

This happens when DebugSymbols is set to "None", and the output is in Release mode. The result is DebugInfo but it does not have a signature or other properties.

This addresses that particular scenario, by null checking the debug info as well as the signature before attempting to create the lookup dictionary.
Copy link
Contributor

@phillip-haydon phillip-haydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💩

@xenolightning xenolightning merged commit ff5ef7e into master Jun 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants