Application crash on startup with Sentry enabled and firewall blocking connections
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
- Install sentry-unity 3.2.3.
- Install ZoneAlarm trial.
- In ZoneAlarm, enable both the firewall and application control.
- Select the "Application Permissions" option under application control, scroll to your application, change it's status to "block connections".
- Create a build of your game with Sentry enabled.
- Launch the game and it will crash before anything shows on screen.
- 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.
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.
Hey @goldfire, thanks for reporting this issue! Could you try disabling
Native Windows Supportin 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.
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.
Could you help me out narrow it down by disabling
Advanced -> Automatic Behaviour -> Auto Session TrackingandTransport -> Offline Caching? There is also the option to completely disable writing to disk viaoption.DisableFileWritebut that is only accessible via programmatic configuration.
The crash doesn't happen if I turn off "auto session tracking".
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.
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.
Thanks for the context, we'll get back to you on this as soon as we can
I've got a Windows PC now set up to properly debug this.
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.