Search Unity

Blue screen error wiped out my scene??

Discussion in '5.1 Beta' started by Todd-Wasson, May 22, 2015.

  1. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
    I've got a major problem here. While running in play mode, I pressed a button in one of my scenes to load another scene. Upon doing so I had a blue screen error immediately that rebooted my system. Upon coming back, Unity is unable to load the scene again. It just says:

    "Unknown error occurred while loading 'Assets/Water2.unity'."

    The scene file exists and is about 2MB, so it wasn't deleted, it just can't be read anymore by Unity for whatever reason.

    Is there anything I can do or am I just screwed any time my system happens to crash while Unity is running? This is extremely disconcerting. I've got backups of the scene which comprises most of the work I've done on the project so far, but they're kind of old and reverting to that would mean redoing a lot of work. I had no idea this was even possible.

    Could I send the file to Unity in a bug report perhaps to get some help, or might somebody have some suggestions I could try? This is really not good to know that a Windows crash can effectively destroy an entire scene if it's loading in Unity during the crash. :mad:
     
    Last edited: May 22, 2015
  2. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
    I have a built version from today. Might it be possible to run a decompiler on it and get the scene file out of there?
     
  3. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
  4. CodeMonke234

    CodeMonke234

    Joined:
    Oct 13, 2010
    Posts:
    181
    I know this might not help now...but for your future as a game developer....

    Use version control
    e.g. git

    It is fundamentally important to all software development.
    There is absolutely no way around it.

    For anyone who is not using it... well... I am sorry.

    If this is the catalyst to start you using it, then it was still worth it.
     
  5. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
    Yes, thanks, I get that. I'm more concerned with the fact that if something resets the machine while a scene is loading in Unity, the file is corrupted. If it's just reading the file and not writing anything to it while it's loading the scene, shouldn't the file be left intact and unaltered? I guess I don't understand how this particular thing is even possible. Maybe my understanding of file operation at the lowest levels works needs to be filled in. I wouldn't have thought this was possible unless Unity was writing something to the scene file while it was simply loading the file. Surely it's not? What am I missing here?
     
  6. CodeMonke234

    CodeMonke234

    Joined:
    Oct 13, 2010
    Posts:
    181
    Not sure - but once Windows Blue Screens all bets are off.

    Blue Screen means system os corruption - I have seen it corrupt core windows system dlls , so corrupting a Unity scene file seems plausible although I agree unlikely.
     
  7. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
    Unity was in the process of loading the scene when the blue screen occurred. Coincidence?
     
  8. ZTORION

    ZTORION

    Joined:
    Sep 27, 2014
    Posts:
    13
    When you are in play mode, the scene file is not being changed by unity. Sounds like a broken hard drive to me (which would also explain the bluescreen). Try checking for bad sectors or CRC errors with a tool like HDtune, or anything else that can read s.m.a.r.t. data. You could also open the scene in a text editor like notepad++. Are you using text serialization or the default binary serialization?
     
    Last edited: May 24, 2015
  9. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
    Thanks. Maybe you're right about the drive. I've got a couple of dual drive RAID 0's on this machine (one RAID per partition), but Windows is sitting on an SSD and I have had some similar problems in the past on an earlier machine using this SSD, now that you got me to think about it. Some time back another program was corrupting an open file (being read only) if the machine reset, and the best some other folks and I could figure was that the OS file system was probably corrupted. I figured reformatting/reinstalling would fix that, but maybe not. Some time later I had it happen in Visual Studio once. I'd forgotten about that..

    Can that kind of thing happen with a bad SSD? This SSD is probably three or four years old now. I use the drive only for Windows, pretty much, so if it fails it's not a big deal.

    I get a lot of blue screens with this machine which is old RAM, old SSD, but a new MB and CPU. If you had to take a wild guess between RAM going funky (mem tests haven't shown anything) and SSD, which would you think is probably more likely?

    I appreciate the help, thanks. To answer your question, I'm using default binary serialization. This reset/BSOD happened the instant I hit my "change scene" button in game preview mode. It's the only time it's ever happened.

    Since this has happened, I've installed TortoiseSVN and am familiar with it from years on another non-Unity project. I should have done that from the beginning. Learned a lesson here. I knew better..
     
  10. Alex-Lian

    Alex-Lian

    Guest

    FYI, binary serialization is not recommended as having source control is always a recommended thing to do. Thus, we recommend going text, as it's easier to source control and recover with.
     
  11. ZTORION

    ZTORION

    Joined:
    Sep 27, 2014
    Posts:
    13
    You should not be getting any bluescreens. It can be anything. Lately I had a very rare bsod caused by a buggy driver of a wlan stick. You never know unless you analyze the crash dump file with WinDbg. But when the scene file is broken, it sounds to me like a broken sector or CRC error on the hard drive where the scene file is on (which means the raid controller can be causing the problem too).
    OR a bluescreen happened somewhere else while the file was written earlier. It is nearly impossible to guess here.
     
  12. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
    My old MB and Windows installs were getting them too occasionally, so I'm thinking SSD or RAM might be the lowest common denominator here. I'm thinking the possibly corrupt file system stuff despite the reformats/reinstalls I've done might point to the SSD indeed. Don't know though. Will just have to try getting a new one one of these days and seeing.

    Thanks for the info, folks.
     
  13. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
    Just tried opening that scene file in notepad and it shows up blank even though it's 2MB. This is the same thing that happened to source code files in the past with two other programs (one of them was Visual Studio) where some other folks pointed to the file system in general probably being corrupted. At one point it was a 100% reproducible thing, I could make it happen at will.

    So yeah, this has happened before and would seem now that it's not likely Unity specific in my case. Corrupt file system probably. That would seem to me to point to the SSD like you said, but I don't really know for sure.
     
  14. GfK

    GfK

    Joined:
    Aug 15, 2014
    Posts:
    107
    Just wondering what brand of SSD do you have?

    I ask, because there's a rather large uptake of cheap OCZ SSDs (for the reason that they're fast, and they're very cheap). But the reason they're cheap is because they have a colossal failure rate in excess of 50%. I've had three of them - two have failed within months. The other is still working after 18 months in a non-critical system but I don't trust it an inch. and would not buy any more OCZ hardware in a fit.

    (other rubbish brands may be available).

    [edit] After some reading just now, I found articles that put the failure rate nearer 40%. I also found claims from OCZ that their current failure rate is around 0.5%. I don't know or care whether that's true - once bitten, twice shy and all that.
     
  15. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
  16. GfK

    GfK

    Joined:
    Aug 15, 2014
    Posts:
    107
    I looked at the Crucial ones myself, after the OCZ fiasco, and instead went with Samsung EVOs. I read that the Crucial drives were seriously error-prone in the event of a loss of power. Where I live we have probably half a dozen power cuts a year so I just avoided the issue completely.

    This was probably about a year ago, so they may (or may not) have improved their hardware/firmware since then.

    Oh - by the way, if BSOD happens again, note down the Stopcode and google it. Should give you a fair indication of what caused the problem.
     
  17. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,065
    Good to know, thanks. I've got a UPS so if the power goes out I should be ok long enough to save and manually shut it down.

    BSOD: I get these quite a lot, it's a different error every time but I haven't paid attention to the stop codes.