SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

SMAPI 3.13 fails to launch for some users

Pathoschild opened this issue ยท 8 comments

commented

Several users have reported being unable to launch SMAPI, while the vanilla game still works for them.

Known info

Common details

  • When they launch StardewModdingAPI.exe from the command line, it consistently exits either at the "waiting for game to launch" step or before outputting anything at all. While both cases are being reported, each player will consistently get the same result.
  • All of the affected users who checked found this error in Event Viewer (e.g. see A and B):

    Faulting application name: StardewModdingAPI.exe[...]
    Faulting module name: ntdll.dll[...]
    Exception code: 0xc0000409
    Fault offset: 0x00000000000a2070

  • Several users reported it in both SMAPI 3.13.1 and 3.13.2, so it's probably not related to the .NET bundling.

Affected users

user System CPU GPU platform test log
amy102 Win 10 ? NVIDIA GeForce 920MX Steam log
BLitz Win 11 AMD Ryzen 5 2600 ? Steam
Darklyte Win 10 Intel i7 8550U Intel UHD Graphics 620 Steam log
Dankaroo Win 10 ? ? Steam
Goldberry.Darling Win 10 ? NVIDIA GeForce GTX 1060 Steam log
M62 Win 10 Intel i5 7th gen NVIDIA GeForce GTX 1050 Ti Steam
Phantom Jewel Win 10 Intel i7 7700HQ NVIDIA GeForce GTX 1060 Steam log
xjm93 Win 10 Intel i5 7th gen 7300HQ NVIDIA GeForce GTX 1050 Steam log
(after clean reinstall fixed it)
commented

Just for gathering data, here's a list of five people who seem to have encountered this problem and information about their computing setup.

BLitz#3656 - STEAM, ryzen 5 2600. Game starts. SMAPI produces no output when launched from the command line (link: https://discord.com/channels/137344473976799233/678284714829807636/917485424438562836). Windows 11. Portuguese OS, game in English. Only antivirus is Windows Defender. SMAPI - version 3.13.2. Also tried with game/OS in English. (https://discord.com/channels/137344473976799233/678284714829807636/917494953700098128)

xjm93#8965 - STEAM, 7th generation i5 7300HQ. Nvidia graphics. Game starts, SMAPI does not. (Nuclear-reinstalled game+SMAPI) Game file check here: https://discord.com/channels/137344473976799233/678284714829807636/917489915380523120 no problems. Error screenshot here: https://discord.com/channels/137344473976799233/678284714829807636/917497770754052146 . SMAPI fails while "Waiting for game to launch". Windows 10 in Dutch, game in English. Only antivirus was Windows Defender. Error still happens after switching system to English and doing a nuclear reinstall (https://discord.com/channels/137344473976799233/678284714829807636/917501016302293063) No AfterBurner, no RivaTuner. Has 5.0 Runtime Desktop installed. (https://discord.com/channels/137344473976799233/678284714829807636/917510964843270154). (Had previously tried with NET 5.0 SDK installed, and without NET 5.0)

M62#9694 - STEAM, Intel 7th generation i5. Windows 10 in English. Nvidia graphics. Game starts, SMAPI does not. English. Game file check here: (https://discord.com/channels/137344473976799233/678284714829807636/917518205348622338) no problems. SMAPI fails with no output whatsoever (https://discord.com/channels/137344473976799233/678284714829807636/917520225174433862). No AfterBurner, no RivaTuner. Has 5.0 Runtime Desktop installed (https://discord.com/channels/137344473976799233/678284714829807636/917508576875008060). Only antivirus Windows Defender.

Phantom Jewel#8209 - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz. Nvidia graphics (GeFore GTX 1060). Game file check here: (https://discord.com/channels/137344473976799233/678284714829807636/917561195974787142) no problems. SMAPI fails while "Waiting for game to launch." 5.0 runtime desktop is installed. Doesn't know about AfterBurner or RivaTuner, has disabled antivirus.

commented

Update:

  1. The crash consistently happens on this line in MonoGame's Sdl.Window.Create for affected players. These are the same values used for unaffected players (805240832 is WINDOWPOS_CENTERED_MASK).
    Window.SDL_CreateWindow("StardewModdingAPI", 805240832, 805240832, 800, 480, 1546);
  2. Players who see no output have the same issue. The "waiting for game to launch" appears in the SMAPI log, it's just not shown in their terminal for some reason.
  3. It's not caused by something in the SMAPI startup directly, since it happens even if SMAPI's Program.Main only (a) has the assembly resolve code and (b) calls StardewValley.Program.Main.
commented

This doesn't seem to be something in SMAPI. I created a minimal launcher which only contains this code:

namespace MinimalLauncher
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            StardewValley.Program.Main(args);
        }
    }
}

Affected players get the same crash when it's launched from the game folder, and the Event Viewer shows the same error (just with MinimalLauncher.exe instead).

commented

Exception code: 0xc0000409 is notorious on Windows.

With how little amount of users are affected, this could be some very niche environment issue. To start, end users who are affected by this bug should bump SDL2.dll to version 2.0.18 as SDV is using 2.0.14 (two release cycles old). There is a number of bug fixes between the two and it may resolve the issue. So that's a start. The ABIs won't break when upgrading to 2.0.18.

If the issue persist, and if one of the end users is at least a power user, I can remote debugging via Visual Studio Live Debugger. That would be the quickest way to see where the needle is in the haystack.

commented

Updating SDL to 2.0.18 didn't make any difference for the affected players unfortunately. I'll coordinate with you on Discord for the tests you want to try!

commented

Per @Dawilly's testing, this seems to be an OpenGL issue on Windows laptops which have both integrated and dedicated graphics.

commented

Possible workaround:

  1. From the start menu, search for Graphics Settings and open it.
  2. In the app list, search for StardewModdingAPI. If it doesn't appear, click "Browse" above it and choose StardewModdingAPI.exe in your game folder.
  3. In the app list, click "Options" under StardewModdingAPI.
  4. Change the Graphics preference to "High performance".
    image
  5. Save and launch SMAPI.

That fixed the issue for several of the affected players so far, waiting for confirmation from the others.

commented

The above worked for all affected players who tried it. I documented the workaround in the troubleshooting guide, so this ticket is now resolved.