Skip to content

SMAPI 4.5.2 with Stardew Valley 1.6.15 build 24354 on Windows 11 (10.0.26100.0) Crash #1021

@jhaisley

Description

@jhaisley

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:

  1. 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).
  2. Ensure the PC is connected to the internet.
  3. Click 'Play' in the Xbox App.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions