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

Application crash on startup with Sentry enabled and firewall blocking connections

Open goldfire opened this issue 3 months ago • 10 comments

Environment

Using sentry-unity 3.2.3 with Unity 2023.3.57. Installed via Git-URL. It only happens in a build on Windows.

Steps to Reproduce

  1. Install sentry-unity 3.2.3.
  2. Install ZoneAlarm trial.
  3. In ZoneAlarm, enable both the firewall and application control.
  4. Select the "Application Permissions" option under application control, scroll to your application, change it's status to "block connections".
  5. Create a build of your game with Sentry enabled.
  6. Launch the game and it will crash before anything shows on screen.
  7. Disable firewall/application control and see that the application now launches correctly.

Expected Result

The application should run normally and just fail to deliver errors to Sentry without crashing.

Actual Result

The application crashes immediately upon trying to launch the application. Note that using the firewall in Windows Defender does not cause a crash.

Any logs or screenshots

There's virtually nothing in the logs, including no errors, as it crashes the application before anything initializes.

goldfire avatar Sep 27 '25 03:09 goldfire

Hey @goldfire, thanks for reporting this issue! Could you try disabling Native Windows Support in the Advances tab of the configuration window and see if this persists? To narrow down where this is coming from.

bitsandfoxes avatar Sep 29 '25 12:09 bitsandfoxes

Hey @goldfire, thanks for reporting this issue! Could you try disabling Native Windows Support in the Advances tab of the configuration window and see if this persists? To narrow down where this is coming from.

Yes I tried that and had the same issue.

goldfire avatar Sep 29 '25 12:09 goldfire

Yes I tried that and had the same issue.

So this is not a sentry-native issue. That's some good-bad news.

Could you help me out narrow it down by disabling Advanced -> Automatic Behaviour -> Auto Session Tracking and Transport -> Offline Caching? There is also the option to completely disable writing to disk via option.DisableFileWrite but that is only accessible via programmatic configuration.

bitsandfoxes avatar Sep 29 '25 14:09 bitsandfoxes

Could you help me out narrow it down by disabling Advanced -> Automatic Behaviour -> Auto Session Tracking and Transport -> Offline Caching? There is also the option to completely disable writing to disk via option.DisableFileWrite but that is only accessible via programmatic configuration.

The crash doesn't happen if I turn off "auto session tracking".

goldfire avatar Sep 29 '25 15:09 goldfire

Thank you so much for helping me out here! So it looks like ZoneAlarm really does not like it when the SDK tries to write to disk. These sessions get stored as session files at Application.persistentDataPath.

I wonder what happens if the game itself tries to write i.e. the save file to disk.

bitsandfoxes avatar Sep 30 '25 10:09 bitsandfoxes

According to ZoneAlarm it only blocks network connections. We use Application.persistentDataPath in our save system and I tested a build with auto session tracking disabled so that I could start the build, but no crashes happened with the save system and everything is working normally.

goldfire avatar Sep 30 '25 15:09 goldfire

Thanks for the context, we'll get back to you on this as soon as we can

bruno-garcia avatar Oct 01 '25 19:10 bruno-garcia

I've got a Windows PC now set up to properly debug this.

bitsandfoxes avatar Oct 08 '25 12:10 bitsandfoxes

Tiny update: I was hoping that making any HTTP requests with either the .NET HTTP Client or the UnityWebRequest would also crash the game, but that does not seem to be the case. So far, this seems to be specific to the Unity SDK. Disabling the native layer also has no effect.

bitsandfoxes avatar Oct 23 '25 09:10 bitsandfoxes