Windows System Crash - Sketch Deletion

I'm running windows 7 64bit with the latest Arduino IDE (0021). I opened a sketch I had saved previously. I changed a single line of code. I uploaded my sketch. I clicked to close the program. It asked if I wanted to save my changes. I clicked Yes. Within a minute or two of me doing that, my computer went to the blue screen of death. I rebooted my computer, and when I tried to open my sketch again, it was blank. I looked at the file with a hex editor and although the file length stayed the same, every character had been replaced with 00. I tried using file deletion tool (Recover4all), but the only copy of my sketch it could find was completely overwritten. I was able to recover the .hex file, but I'll have to start from scratch if I want to change my code. There is nothing in my event viewer for the time of the crash.

So there may be something wrong with the saving system. If there is a crash log generated by the arduino software, let me know where it is located, and I will provide it.

More importantly, it would be nice if the arduino software automatically backed up copies of sketches, or had the option to enable that in preferences. It is really heartbreaking to lose everything after so many hours of debugging.

I'm running windows 7 64bit with the latest Arduino IDE (0021). I opened a sketch I had saved previously. I changed a single line of code. I uploaded my sketch. I clicked to close the program. It asked if I wanted to save my changes. I clicked Yes. Within a minute or two of me doing that, my computer went to the blue screen of death. I rebooted my computer, and when I tried to open my sketch again, it was blank.

I am sorry to hear that. It's always heart-breaking to lose work.

There is nothing in my event viewer for the time of the crash.

Nothing in the System event log? Given the symptoms, were I in your shoes, I'd start shopping for a new harddrive.

So there may be something wrong with the saving system.

A blue screen of death is always a kernel fault. They are never generated by user-mode code. Arduino and the Java Virtual Machine are user-mode applications. There's simply no way for Arduino or the JVM to cause a blue screen of death.

More importantly, it would be nice if the arduino software automatically backed up copies of sketches, or had the option to enable that in preferences. It is really heartbreaking to lose everything after so many hours of debugging.

That would be nice and it very likely would have helped.

Nothing in the System event log? Given the symptoms, were I in your shoes, I'd start shopping for a new harddrive.

There are no events for an hour or two before the crash, and then there are the usual start up events immediately following it.

A blue screen of death is always a kernel fault. They are never generated by user-mode code. Arduino and the Java Virtual Machine are user-mode applications. There's simply no way for Arduino or the JVM to cause a blue screen of death.

I didn't mean to imply that it was the arduino software that caused the blue-screen, but I think its implementation of saving a sketch caused my file to be lost in the unscheduled shutdown. I'm not sure how it is done in the arduino IDE, but a safe method would go:

Create saved_changes.pde
Copy old_file.pde to old_file.pde.bak
Move saved_changes.pde to old_file.pde
Delete old_file.pde.bak

This would not help if you had a new sketch that you hadn't saved yet, but for updating an existing sketch, it makes sure that at any given moment either the previous copy or the changed version are written to the disk and preserved before deleting. I shudder to say it, but this is how MS Word does it (I feel so cold inside).

Thanks for responding!

FrankFlin:

I am sorry to hear about your loss. Last night I found that my motherboard had decided to short out and release the magic blue smoke (there was a burn mark and everything!). At the time, I was mainly worried that I had lost a few downloaded files (no biggie in the grand scheme of things), and that I would have to spend a ton of time recovering. If all goes well, though, I should be back up completely by tonight.

Fortunately, I didn't lose any data, but I do know that sinking feeling well (and have lost data in the past).

My advice: Implement a backup system. It won't be foolproof, it might fail itself, but done right it will give a measure of peace to your mind. What I do currently is back up my system to an external hard drive hourly; the software I use performs full backups about once a month, and differential backups every hour.

You might also consider a different OS - while I can't say that Linux is perfect (I currently run Ubuntu, but I have run a ton of other distros over the past 15+ years), I do know that I haven't gotten the level of grief that I had experienced under Windows. Of course, were not talking about anything current, either; my experiences with later versions of Windows have been more positive (and I am sure you don't bluescreen every day with Windows 7 - if you do, there is something likely very wrong with your system, and it likely isn't Windows). I have plenty of other reasons for sticking with Linux, though.

Good luck in the future...

:slight_smile: