You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case of an infinite recursion, the stack trace exceeds the maximum number of frames we upload, and therefore gets truncated at the top, leaving only information where the process was killed and not where error originates from.
As recursions can happen inside OS frameworks, i.e. inside SwiftUI when a view uses itself in the body, the stack trace might not even contain any frames from the app, but only internal frames.
It might be possible to understand a recursion is happening by looking at the stack trace and seeing repeated frames, in other cases it might not be, therefore the crash itself is not helpful in solving the issue.
Example crash shown in Sentry product:
Additional observation from a simple example:
recurse(i:1)func recurse(i:Int){recurse(i: i +1)}
This only shows two frames in the full stack trace (maybe because they are both lines of in-app code). When looking at a stack trace happening in SwiftUICore, it shows a much larger stack trace (with no in-app stack available)
Solution Brainstorm
As the number of frames in the stack trace is limited on purpose, we can not include the full stack trace (could be many tens of thousands of repeating frames).
Instead we should add the following data points to the event payload:
Is truncated? (Boolean)
Number of frames in stack trace
Recursion detected? (Boolean)
I believe 1 and 2 to be easy to implement, but 3 could be more complicated or simply too much work for the SDK and could instead be an addition for the backend.
Are you willing to submit a PR?
Yes! 🙌
The text was updated successfully, but these errors were encountered:
Problem Statement
In the case of an infinite recursion, the stack trace exceeds the maximum number of frames we upload, and therefore gets truncated at the top, leaving only information where the process was killed and not where error originates from.
As recursions can happen inside OS frameworks, i.e. inside SwiftUI when a view uses itself in the
body
, the stack trace might not even contain any frames from the app, but only internal frames.It might be possible to understand a recursion is happening by looking at the stack trace and seeing repeated frames, in other cases it might not be, therefore the crash itself is not helpful in solving the issue.
Example crash shown in Sentry product:
Additional observation from a simple example:
This only shows two frames in the full stack trace (maybe because they are both lines of in-app code). When looking at a stack trace happening in SwiftUICore, it shows a much larger stack trace (with no in-app stack available)
Solution Brainstorm
As the number of frames in the stack trace is limited on purpose, we can not include the full stack trace (could be many tens of thousands of repeating frames).
Instead we should add the following data points to the event payload:
I believe 1 and 2 to be easy to implement, but 3 could be more complicated or simply too much work for the SDK and could instead be an addition for the backend.
Are you willing to submit a PR?
Yes! 🙌
The text was updated successfully, but these errors were encountered: