sentry-unreal icon indicating copy to clipboard operation
sentry-unreal copied to clipboard

Suppressed check/assert callstacks and error codes with EnableAutoCrashCapturing

Open Acren opened this issue 1 year ago • 6 comments

Hey there,

Investigating some false negatives in our CI automation with Windows packaged builds I discovered that if EnableAutoCrashCapturing is true, hitting an assertion will not log the callstack like it normally does, and in some cases will also exit with code 0.

Are these intentional?

Thanks

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which version of the SDK? 0.19.1

How did you install the package? (Git-URL, Assetstore) Git-URL

Which version of Unreal? 5.4

Is this happening in Unreal (editor) or on a player like Android, iOS, Windows? Windows editor + package

Steps to Reproduce

  1. Create a new project with the Sentry plugin and a configured DSN and verify it initializes
  2. In code, add and then trigger a check(0) anywhere (for example, in the GameMode BeginPlay)

Expected Result

The callstack of the check() is logged and the engine exits with a non-zero code indicating failure.

Actual Result

No callstack is logged, and the engine exits with code 0 - this happens in editor and packaged builds

Any logs or screenshots

Acren avatar Sep 07 '24 08:09 Acren

Hey @Acren, thank you for bringing this up.

Just to clarify - is there no corresponding callstack in the log file or it's missing for the captured assertion on the Sentry event's page?

tustanivsky avatar Sep 09 '24 07:09 tustanivsky

Hey @Acren, thank you for bringing this up.

Just to clarify - is there no corresponding callstack in the log file or it's missing for the captured assertion on the Sentry event's page?

Hey @tustanivsky, it does come through on the Sentry event page, however it's missing from the log file where it goes when the option is not enabled. I'd expect it to go to Sentry in addition to the log file.

Acren avatar Sep 09 '24 11:09 Acren

Hey @tustanivsky, it does come through on the Sentry event page, however it's missing from the log file where it goes when the option is not enabled. I'd expect it to go to Sentry in addition to the log file.

@Acren Currently, this is one of the native integration limitations. To enable crash capturing via the plugin, we had to suppress the default engine's error-handling logic, which is unfortunately tightly coupled with some logging (e.g., printing call stack). This leads to a different resulting output compared to the one that Crash Reporter provides.

tustanivsky avatar Sep 10 '24 07:09 tustanivsky

I understand, it looks like you've had to replace the GError output device with your own.

I think it would be desirable to try and emulate the previous behavior if possible. Currently it feels like enabling the auto crash reporting is a bit of a tradeoff because of this limitation, we have to keep it disabled in development situations where we might need logs.

Maintaining the default behavior would allow us to enable Sentry in these scenarios that require us to have logs, where we otherwise miss out on the benefits of Sentry.

Simply updating the exit code that SentrySubsystem uses on an assert seems to work for me, but I'm not sure about the callstack logging however - would be great if this is possible somehow.

Acren avatar Sep 11 '24 14:09 Acren

I think it would be desirable to try and emulate the previous behavior if possible. Currently it feels like enabling the auto crash reporting is a bit of a tradeoff because of this limitation, we have to keep it disabled in development situations where we might need logs.

That's a fair request. We'll look into this and see whether getting the proper logging back is possible, at least for assertions.

tustanivsky avatar Sep 12 '24 06:09 tustanivsky

Thanks a lot!

Acren avatar Sep 13 '24 02:09 Acren