-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Crash on upgrade from 8.20.0 -> 8.25.0 via Span.finish #3977
Comments
Hey @nebsta, I tried to reproduce the issue, but couldn't. I see that you have your own wrapper around SenrySpan. Can you share more details on how to initialize your instance of SentrySpan so we can reproduce the issue? A small sample project that reproduces the issue would even be the best. Furthermore, it would be great if you could share the crash report with us. It seems like the culprit is #3892, which moved capturing the transaction to a background thread. |
@philipphofmann sorry for the late reply. Didn't get a notification about you responding. Here is a snippet of what the wrapper looks like. We mainly have this so that we can swap out reporting libraries in the future if we want to. As you can see it's pretty simple, nothing too fancy.
I'll see if I can get a full crash report from the sentry dashboard and post it here soon. |
Thanks for the update, @nebsta. The full crash report would be helpful. I think I see a couple of occurrences of this in our internal SDK crash detection. |
@philipphofmann classically I can't seem to replicate the issue anymore, so I'm unable to get the crash log for you. But by the sounds of it, it seems like it's a known issue if you have seen occurrences of it. |
Yes, I think we should have enough information to fix it. Thanks for the update. |
@philipphofmann any update on a fix? |
Finishing or refinishing a span should not matter; we have safeguards for these scenarios. If you could provide us with a reproduction of your flow and how you use transactions/spans, it would help us a lot in identifying whether we have a bug in the said safeguards. |
@brustolin I've outlined an explanation of how we're using them below, including some code examples as well. Hopefully that gives you a better picture. The main class where we use the spans and where this exception is happening is called the You can see a full gist of what the If you look within the
As I mentioned, there is a bug in this implementation, as if there is an exception in any of the bootstrap items, then we don't properly finish the span for the entire bootstrap process, which is something we're going to fix on our end. This is why I was wondering if perhaps this could be the reason for our crash, as I mentioned that we do sometimes see some instances in the 99th percentile that are reported to be going for as long as a couple of days, so I wonder if there is an issue in the mechanism for ensure that spans are always cleaned up. Hopefully that's enough to give you a better picture. |
I should also mention that the spans we're using the |
I looked at the diff in SentryTracer from 8.20.0 to 8.25.0 and couldn't find anything suspicious that could cause this crash. @nebsta, can you try to enable the Sentry Cocoa SDK debug logs with Also, can you try to update to the latest version 8.36.0, and check if the problem persists? I know you currently can't update to a higher version than 8.25.0, but if you could check that in debug and it works, we know the problem was fixed. There is a small chance that #4380 fixes the problem, but I doubt it because canceling the deadline timer for the manual transaction should be a NoOp as the deadline timer is nil. |
@philipphofmann We have been attempting to upgrade to 8.36.0 instead since it came out, but we're still getting the same issue. I'll try enabling the logs and see how that goes |
@philipphofmann I've attached the logs that appear when enabling debug leading up to the crash. One thing I also noticed actually looking at the code, which you'll also see in the logs, is that we actually start sentry on boot, then we stop it after the bootstrapper and then call start agains straight after. I can't remember exactly why we do this, but I wonder if this could also be causing issues. |
The last log message is
The logs don't show more log messages for installing all the integrations. Do you start your transaction leading to a crash directly after initializing the SDK a second time? I tried to reproduce your problem by starting the SDK, stopping it, starting it again and then directly capturing a transaction, but it works flawlessly.
Can you maybe try not stopping and starting the SDK and check if the crash still occurs? If it disappears, it would make it easier to identify the problem. |
The finish on the transaction that triggers the crash is before we stop and start the system.
I'll give this a go today and get back to you |
It looks like this has been resolved when updating from 8.20.0 to 8.39.0! |
@P-Foley-Trustpilot, we made so many improvements between these versions for that part of the SDK that it's hard to pin it down. It's great that it is fixed for you. Maybe others could retry with 8.39.0 and tell us if it's fixed. |
Platform
iOS
Environment
Develop
Installed
Swift Package Manager
Version
8.25.0
Did it work on previous versions?
8.20.0
Steps to Reproduce
Expected Result
We expect the crash not to occur
Actual Result
Few other notes:
Are you willing to submit a PR?
No response
The text was updated successfully, but these errors were encountered: