News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

Bug: loading corrupt savegame causes simutrans to hang

Started by Dwachs, July 14, 2013, 07:15:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dwachs

Savegame here:

http://simutrans-forum.de/forum/index.php?page=Thread&postID=95846#post95846

What happens: bz2_read_bla returns an erorr code -4 (data corrupt). The fillbuffer-thread errors out. The reading thread waits infinitely for the fillbuffer thread to continue.

I do not have a quick patch :/ I think the fillbuffer thread should somehow signal the occurance of an error (setting buf_len to -1 ?). The reading thread should then react with a dbg->fatal error.
Parsley, sage, rosemary, and maggikraut.

Ters

It should ideally work the same whether it is multi threaded, single threaded or unbuffered, bzipped or gzipped. As it is, read() may return either 0 or -1 on error.

There is also how to handle errors during writing. This will be a bit strange, since the error will be reported at different places depending on threading. With threading it will be detected at writing som later data, or during the final flush.

Dwachs

Parsley, sage, rosemary, and maggikraut.