Describe the bug
On the Xbox App / PC Game Pass version of Stardew Valley, SMAPI crashes immediately upon launching mods with a System.AccessViolationException centered around XGamingRuntime.Interop.XGRInterop.XUserAddAsync.
This seems to be a conflict between SMAPI's memory hooks and the Xbox Gaming Services secure container attempting to authenticate the user profile online.
Note: The vanilla game launches completely fine through the Xbox App. Temporarily disabling the PC's network connection (Wi-Fi/Ethernet) prior to hitting launch acts as a successful workaround, allowing SMAPI to bypass the crash during the XUserAddAsync call.
Because this is a fatal crash that kills the process immediately, the full stack trace does not make it to the standard SMAPI-latest.txt log. Here is the raw terminal output captured at the moment of the crash:
[SMAPI] Launching mods...
[SMAPI] Mods loaded and ready!
[SMAPI] Type 'help' for help, or 'help <cmd>' for a command's usage
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
--------------------------------
at XGamingRuntime.Interop.XGRInterop.XUserAddAsync(XGamingRuntime.XUserAddOptions, XGamingRuntime.Interop.XAsyncBlockPtr)
--------------------------------
at XGamingRuntime.SDK.XUserAddAsync(XGamingRuntime.XUserAddOptions, XGamingRuntime.XUserAddCompleted)
at StardewValley.Game1._update(Microsoft.Xna.Framework.GameTime)
at StardewValley.Game1.Update(Microsoft.Xna.Framework.GameTime)
at StardewModdingAPI.Framework.SCore.OnPlayerInstanceUpdating(StardewModdingAPI.Framework.SGame, Microsoft.Xna.Framework.GameTime, System.Action)
at StardewModdingAPI.Framework.SGame.Update(Microsoft.Xna.Framework.GameTime)
at StardewValley.GameRunner.Update(Microsoft.Xna.Framework.GameTime)
at StardewModdingAPI.Framework.SCore.OnGameUpdating(Microsoft.Xna.Framework.GameTime, System.Action)
at Microsoft.Xna.Framework.Game.DoUpdate(Microsoft.Xna.Framework.GameTime)
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop()
at Microsoft.Xna.Framework.Game.Run(Microsoft.Xna.Framework.GameRunBehavior)
at StardewModdingAPI.Framework.SCore.RunInteractively()
at StardewModdingAPI.Program.Start(System.String[])
at StardewModdingAPI.Program.Main(System.String[])
To Reproduce
Exact steps which reproduce the bug:
- Open the Xbox App on PC (with Stardew Valley 1.6.15 / SMAPI 4.5.2 installed via the typical Game Pass directory swap/rename execution method).
- Ensure the PC is connected to the internet.
- Click 'Play' in the Xbox App.
- SMAPI console opens, displays "Mods loaded and ready!", and immediately crashes with the AccessViolationException before reaching the main title screen.
Log file
https://smapi.io/log/4f468ddfd9504ab08e7ffc8298adb82b
Describe the bug
On the Xbox App / PC Game Pass version of Stardew Valley, SMAPI crashes immediately upon launching mods with a
System.AccessViolationExceptioncentered aroundXGamingRuntime.Interop.XGRInterop.XUserAddAsync.This seems to be a conflict between SMAPI's memory hooks and the Xbox Gaming Services secure container attempting to authenticate the user profile online.
Note: The vanilla game launches completely fine through the Xbox App. Temporarily disabling the PC's network connection (Wi-Fi/Ethernet) prior to hitting launch acts as a successful workaround, allowing SMAPI to bypass the crash during the
XUserAddAsynccall.Because this is a fatal crash that kills the process immediately, the full stack trace does not make it to the standard
SMAPI-latest.txtlog. Here is the raw terminal output captured at the moment of the crash:To Reproduce
Exact steps which reproduce the bug:
Log file
https://smapi.io/log/4f468ddfd9504ab08e7ffc8298adb82b