[10.12] Crash saving when harddisk full

This subforum contains all the issues which we already resolved.
Post Reply
whaleberg
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Feb 13, 2015 1:02 am
Contact:

[10.12] Crash saving when harddisk full

Post by whaleberg »

I was experiencing a hard crash to desktop without any message that happened every several minutes. I eventually realized that my hard drive was full and that it was crashing every time it failed to autosave. Clearing space on the drive fixed it. It would be good to have an error message instead of a crash.

This is the only bug I've noticed so far, impressive performance from an in development game. (although I haven't tried the experimental build yet...) Thanks to the devs for a great game.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [10.12] Crash saving when harddisk full

Post by kovarex »

Thanks for the report.

This was a nice lesson for me regarding exception handling, exception in destructors handling etc ...

It is fixed for 0.11.16, you will get the error of:

"Writing in the zip failed: No space left on device.", I hope it will be understandable enough.

P.S. The game is also not terminated when this happens, the saving just fails.

hoho
Filter Inserter
Filter Inserter
Posts: 677
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: [10.12] Crash saving when harddisk full

Post by hoho »

kovarex wrote:exception in destructors handling
I still get nightmares of trying to track down a bug caused by an exception thrown from a destructor.

For any programmer reading this, NEVER throw exceptions from deconstructors or from any code that gets called from a deconstructor.
And I really mean literally never. It's not a soft-suggestion as for "don't use goto". There are zero corner cases where it could be usable and it WILL break everything badly whenever that exception does get thrown.

In my case it was serial port closing handling. Deconstructor simply called a disconnect() function and that function threw exceptions on errors.

dee-
Filter Inserter
Filter Inserter
Posts: 414
Joined: Mon Jan 19, 2015 9:21 am
Contact:

Re: [10.12] Crash saving when harddisk full

Post by dee- »

bla :ugeek: :mrgreen:
Last edited by dee- on Fri Feb 13, 2015 12:33 pm, edited 2 times in total.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [10.12] Crash saving when harddisk full

Post by kovarex »

hoho wrote:
kovarex wrote:exception in destructors handling
I still get nightmares of trying to track down a bug caused by an exception thrown from a destructor.

For any programmer reading this, NEVER throw exceptions from destructor or from any code that gets called from a destructor.
And I really mean literally never. It's not a soft-suggestion as for "don't use goto". There are zero corner cases where it could be usable and it WILL break everything badly whenever that exception does get thrown.

In my case it was serial port closing handling. Destructor simply called a disconnect() function and that function threw exceptions on errors.
You can throw exceptions in methods called by destructor, but you always need to catch those in the destructor itself, this is a the way we do it, and apparently std does it this way as well.
Where you have some close method, that you can call explicitly, when you want to handle the error message, but if you don't call it explicitly, it's exception are caught and just discarted.
http://stackoverflow.com/questions/1301 ... uctor?rq=1

whaleberg
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Feb 13, 2015 1:02 am
Contact:

Re: [10.12] Crash saving when harddisk full

Post by whaleberg »

Thanks for the quick response, and for the advice about destructors!

"Writing in the zip failed: No space left on device." is definitely understandable.

"Saving failed: No space left on device" might be a slightly more idiomatic. No matter what the message is though, it's definitely a major improvement to report the error instead of exiting.

Post Reply

Return to “Resolved Problems and Bugs”