1. This forum is archived for reference. For support & bug reports visit the help section of forums.stardewvalley.net

Bug/Issue Switch - Corrupted save file? Sleep crash bug

Discussion in 'Support' started by Typhoon, Oct 7, 2017.

  1. deadbeef

    deadbeef Space Hobo

    I can confirm, at least for the crashes that I've been experiencing (tool upgrading and mining) have completely disappeared after emptying my fridge. I highly recommend trying this if you are experiencing sleep/save crashes.
      Typhoon likes this.
    • Typhoon

      Typhoon Spaceman Spiff

      Thanks very much for the detail, that should help people a lot.
      • Typhoon

        Typhoon Spaceman Spiff

        One person so far reporting that the character's house hasn't been extended so there's no fridge yet having the sleep crash:


        edit: and another:


        and one more who had the issue BEFORE getting a fridge:


        So it looks like we could have two separate causes of the sleep crash bug, but the fridge one is the one affecting most people so far.
          Last edited: Oct 15, 2017
        • FireproM2K

          FireproM2K Space Hobo

          I still suspect it has something to with the game not being able to parse data. Like when you have an empty spot in the fridge followed by an item it crashes because the game expects an item there and when it isn't it hits a fatal error.

          Is there any other storage items besides chests or the fridge? Like I'd really think it has something to do with the inventory system. Like the game is expecting data to be in one place and when the data isn't there or doesn't match what should be there it goes crazy.

          Just speculation but prob a good place to start .
            Typhoon likes this.
          • Typhoon

            Typhoon Spaceman Spiff

            One player reporting that:

            "I just got rid of all the omelets I had made and haven't had a problem since. I didn't empty anything else out of the fridge. I went from crashing every time I went to the cave to no crashes.

            Edit: I was crashing when I went to sleep that night, not on entering the cave."


            So I guess removing the omelets in this case meant that there were no gaps between the remaning items. I'll see if I can find out.
            • Typhoon

              Typhoon Spaceman Spiff

              Your explanation sounds perfectly feasible.

              As for other storage items - besides chests and the fridge I can't think of any, although it could be argued that you "store" items in the museum when donating them.

              Extrapolating even more from that there's furniture, where you "store" chairs, tables, pictures by moving them around and placing them (curiously enough some people have also reported issues with moving and placing furniture (sometimes furniture will not be placed for some reason) - I for one reported that picking up the table in your house and trying to place it in an empty space between the TV and fireplace (stand to the left of the fireplace and face left to try this) can give an error that somebody is in that space when it is in fact empty). I've not heard of placing furniture causing any crashes though, although I guess the devs should check out the code to see if there could be any related issues. Maybe, for example, people without a fridge could experience a crash after moving furniture? That's just a wild guess!
                Last edited: Oct 15, 2017
              • Typhoon

                Typhoon Spaceman Spiff

                Fridge emptying is definitely working for the vast majority of people with only two exceptions and that's because those two don't have the kitchen extension (noted in my earlier post) and hence no fridge.

                Here's the three main Reddit threads with assorted info and replies:



                • Prairie King

                  Prairie King Space Hobo

                  Had the same issue tonight on my Switch, where it crashed on Summer 21 (1st Year) after a day of farming and fishing and cooking eggs. It crashed a second time when I just farmed and cooked eggs. The third time, I just farmed and did not cook eggs and it worked fine.

                  It's gotta be something with either the fridge or cooking, I figure.
                  • CmndrJustine

                    CmndrJustine Space Hobo

                    I'm going to try emptying the fridge right now but currently I am stuck on Spring Day 9, Year 2. I have tried many things like harvesting, spelunking, gifting and cleaning the farm and it crashes every time. I'm a first time player and I joined this forum to get help. I'll let you know how the fridge trick goes!

                    Edit: I am FINALLY on day 10. Omg groundhog day is over. I think the fridge trick is the current fix. Thank you so much. I was about to give up.
                      Last edited: Oct 16, 2017
                      Typhoon likes this.
                    • massoluk

                      massoluk Space Hobo

                      10 days without crashing yet, I simply sorted every inventory, fridge, container so there are no gaps before going to bed.
                        Typhoon likes this.
                      • Starlight174

                        Starlight174 Space Hobo

                        Have you tried passing out in your house instead of going to bed?
                          Typhoon likes this.
                        • Typhoon

                          Typhoon Spaceman Spiff

                          Here's a very good analysis of what's potentially causing the sleep crash bug:

                          "I was able to identify and reproduce the bug. It happens when you use a material for cooking from your fridge which is the last piece on this stack AND which is not on the last place in the fridge. The fridge doesn't sort the items following it back up the row. You can see it afterwards in your fridge that there is a empty space where the item was your used for cooking. It should actually put all following items a slot back but doesn't, but if you put a new item in the fridge the items get new alined.

                          Then I was able to sleep again"

                          • Typhoon

                            Typhoon Spaceman Spiff

                            And another good analysis, this one is from a programmer:

                            "As a programmer myself I think there is a pretty clear connection between the cooking trigger and the tool trigger scenario. Two expressions of the same bug. Both are cases in which an automatic process removes something from an inventory through non-standard means, and apparently leaves some kind of dangling pointer or index-mismatch problem.

                            If the thought is that adding something to the fridge causes the fridge inventory to 'resort' then the tool upgrade scenario might also be fixed by adding something to your inventory, maybe specifically filling the empty tool slot left by the removed tool.

                            programmer advice -- is there a new pointer being declared here which is assumed to be NULL but not being explicitly set that way? Different platforms/builds can initialize data differently, in some cases you will always get NULLs, so you don't bother to intialize and it never causes a problem, then on another platform you get whatever garbage value was last written to the address, which is often NULLs, but then not always, and if it has a value it's not always out of bounds, creating either 'unexpected behaviour' or an inconsistent seg fault."

                            • Typhoon

                              Typhoon Spaceman Spiff

                              Somebody else with the sleep crash bug who doesn't have a fridge:

                              "Same here, no house upgrade yet and I've narrowed it down to turning in any tool for upgrade. That night the game will crash, before getting to the gold tally screen. Replayed the day a few times and it happens with every tool. Haven't tried emptying my inventory yet, but can try it just to be sure."

                              • Typhoon

                                Typhoon Spaceman Spiff

                                An interesting issue re the sleep crash bug - the player has a fridge but hasn't used it (or cooked anything) yet still experiences the sleep crash bug. This is possibly related to the other cause of the bug (although so far that has been limited to people who don't have a fridge):

                                "Is it possible that just having the fridge contributes to the bug? I have the extension, and have yet to cook anything or use the fridge. Im getting the bug mid winter, but it only happens when I go to sleep after doing stuff around the farm/mines. Have tried dumping everything in a chest, have tried just keeping tools in the inventory, have tried with a full inventory, but the problem still seems to persist. If I wake up and go right back to sleep, it proceeds to the next day, but then I've wasted a whole day."

                                • FireproM2K

                                  FireproM2K Space Hobo

                                  I think that programmer was spot on. It's def an issue with removing something from inventory unnaturally and that empty spot causing that indexing error.

                                  Could explain why it's happening to tool upgrade people too. Cause you remove the tool AND the metal bars.

                                  I wonder if it isn't the tool removal so much as the metal bar removal also wonder if it only triggers if your inventory is full and you don't add or remove and item.

                                  Like say you have 12 slot or 24 slot and all ots are filled you bring exactly 5 bars and when you hand in to Clint it removed all the bars this giving you an empty spot. And if you don't add something or remove something to resort it leaves that hole.

                                  Are there any events or game actions that remove stuff from your inventory the same way the fridge and Clint does? I.E. giving someone a gift or maybe turning in a mission item?
                                    Typhoon likes this.
                                  • Typhoon

                                    Typhoon Spaceman Spiff

                                    Here's an interesting reversal of the cause of the sleep crash bug:

                                    "I have the fridge and have been using it since day 1, but the only time I got this bug was when I stored all my tools in my wooden chest as a precaution (back when we thought upgraded tools in our backpacks were the cause). Never did it again, and never had the bug again."

                                    • Typhoon

                                      Typhoon Spaceman Spiff

                                      Not sure if this is relevant, but in a reply to somebody looking for their lost Scythe (it was in the fridge!):

                                      "The fridge is kinda laggy so sometimes when you click on it, you'll probably tap A again without realizing it's loading. That extra A tap always seems to deposit people's scythe into the fridge and then they never notice."

                                      • Karilyn

                                        Karilyn Void-Bound Voyager

                                        I probably just had a different version of the crash than the afformentioned two versions with automatic removal of items from the inventory via blacksmith and fridge leaving empty inventory spaces with an indexing error.

                                        Or possibly an alternative version of the problem, as I cooked but clicked the "resort inventory" button to remove the gap, which was believed to fix the crash, and maybe doesn't?

                                        Here is the exact step by step what I did today.

                                        Winter 1 Year 2

                                        1. Got out of bed, checked fortune, saw I had a very lucky day so I decided to do an impromptu skull cave run.
                                        2. Deposited all my tools except for my galaxy sword and iridium pickaxe, took out all my stone and blackberries.
                                        3. Cooked several Pumpkin Soups.
                                        4. Opened fridge and mashed the resort button to remove the gap.
                                        5. Went to the Dwarf and purchased 363 Mega Bombs
                                        6. Went into town, triggered Community Center Completed cutscene.
                                        7. Told Pierre to punch Morris in the face.
                                        8. Ran home, deposited the trophy.
                                        9. Went and stood outside Pam's trailer.
                                        10. Triggered Pam's fastwalk animation.
                                        11. Went and stood on the bus screen, triggered Pam's fastwalk a second time.
                                        12. Bussed to the caves, went down to about floor 180 via combination of megabombs and staircases.
                                        13. Took ladder back up at 1:50AM, walked out front door of skull cavern, and fell asleep in the desert.
                                        14. Instant crash.
                                          Typhoon likes this.
                                        • JenniferJayde

                                          JenniferJayde Space Hobo

                                          Did anyone figure this out??

                                          My FB post -
                                          Has anyone here experienced the Stardew Valley crash on Switch? I'm on Year 1, Winter, Day 5. I am upgrading my axe to steel. When I go to sleep, the game crashes and starts at the beginning of Day 5 when I reload. I can't progress. I thought I saw others with this issue in another thread. Is there a solve?? I can't play and I'm so sad... lol

                                          Edit: If I immediately go back to sleep, I make it to Day 6, but then it crashes that night instead if I play it through.

                                          Not just me:


                                          Share This Page