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
{{ message }}
Repository navigation
Scope sync attachments for Android, iOS and Native #5052
Before implementing for Native, consider/verify how scopes are stored in the Native SDK. Can they be AsyncLocal? If not, we don't want to add attachments from one AsyncLocal scope that get added to events from another AsyncLocal scope... in an ASP.NET Core app (native AOT), that could result in attachments relating to one request being added to events from other requests.
This isn't an issue for Andoid/iOS but needs to be considered for AOT compiled server apps.
@jamescrosswell Just to understand the impact of this - I assume this is to help sync scoped attachments (and logcat.log I would presume), to those pesky native signalhandler crashes, that are often very hard to diagnose, because they are missing attachments?
@jurganson yes pretty much. It's about getting attachments that have been added to the managed/.NET scope on events thrown by the native/android/ios SDKs (so things like the signal interrupts, macho exceptions etc.).
@jamescrosswell Awesome, thanks for the info. This would greatly help my case, as I have several different signal interrupts, with little to no stack trace. Apart from the other attachments, just a simple logcat.log in those cases would be extremely helpful. I put my hope and vote into this getting prioritized in the near future 🤞
Good feedback - thanks @jurganson. I'll bump the priority on this one.
Right at the moment I'm stretched a bit thin so can't pick it up immediately. Once things are looking on track for the .NET 11 release and once my new colleague (who starts next week) is onboarded, we'll be able to look at picking things like this off the backlog again.
Adding the iOS details from #4034, now closed as a duplicate:
On iOS, attachments added with scope.AddAttachment(...) are missing from native crash events (SentrySdk.CauseCrash(CrashType.Native)).
The native SetBeforeSend on iOS doesn't receive attachments either. Native crash reports are sent on the next launch, so the reporter suggested a hook at that point (like App Center's hasCrashedInLastSession) where the app could add attachments before the report goes out.
CocoaScopeObserver.AddAttachment is still a no-op, with a TODO saying Cocoa has no matching API. The current bindings expose addAttachment: on SentryObjCScope, so that may no longer be true.
The people asking for this attach their own logs of process state, which matter most for native crashes that have little or no stack trace.
The Android side, including the logcat.log attachment, is tracked in #3545, now a sub-issue of this one.
Activity
linear-code commentedon Mar 23, 2026
NET-621
Flash0ver commentedon Mar 24, 2026
See
sentry-dotnet/src/Sentry/Platforms/Android/AndroidScopeObserver.cs
Lines 108 to 130 in 2db04c4
sentry-dotnet/src/Sentry/Platforms/Cocoa/CocoaScopeObserver.cs
Lines 116 to 138 in 2db04c4
sentry-dotnet/src/Sentry/Platforms/Native/NativeScopeObserver.cs
Lines 46 to 54 in 2db04c4
Flash0ver commentedon Jul 8, 2026
Also needs updating / removing the note added to the docs via getsentry/sentry-docs#17590.
jurganson commentedon Sep 4, 2026
@jamescrosswell Just to understand the impact of this - I assume this is to help sync scoped attachments (and logcat.log I would presume), to those pesky native signalhandler crashes, that are often very hard to diagnose, because they are missing attachments?
jamescrosswell commentedon Sep 6, 2026
@jurganson yes pretty much. It's about getting attachments that have been added to the managed/.NET scope on events thrown by the native/android/ios SDKs (so things like the signal interrupts, macho exceptions etc.).
jurganson commentedon Sep 7, 2026
@jamescrosswell Awesome, thanks for the info. This would greatly help my case, as I have several different signal interrupts, with little to no stack trace. Apart from the other attachments, just a simple logcat.log in those cases would be extremely helpful. I put my hope and vote into this getting prioritized in the near future 🤞
jamescrosswell commentedon Sep 7, 2026
Good feedback - thanks @jurganson. I'll bump the priority on this one.
Right at the moment I'm stretched a bit thin so can't pick it up immediately. Once things are looking on track for the .NET 11 release and once my new colleague (who starts next week) is onboarded, we'll be able to look at picking things like this off the backlog again.
jamescrosswell commentedon Nov 26, 2026
Adding the iOS details from #4034, now closed as a duplicate:
scope.AddAttachment(...)are missing from native crash events (SentrySdk.CauseCrash(CrashType.Native)).SetBeforeSendon iOS doesn't receive attachments either. Native crash reports are sent on the next launch, so the reporter suggested a hook at that point (like App Center'shasCrashedInLastSession) where the app could add attachments before the report goes out.CocoaScopeObserver.AddAttachmentis still a no-op, with a TODO saying Cocoa has no matching API. The current bindings exposeaddAttachment:onSentryObjCScope, so that may no longer be true.The Android side, including the
logcat.logattachment, is tracked in #3545, now a sub-issue of this one.