News:

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

Error and segfault when saving with zstd

Started by freddyhayward, January 13, 2021, 08:59:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

freddyhayward

Steps to reproduce:
1. use latest nightly build on ubuntu 20.10 (likely irrelevant)
2. save any game
3. get the following error:
ERROR: zstd_file_rdwr_stream_t::zstd_file_rdwr_stream_t: Cannot set wrokers: Unsupported parameter
For help with this error or to file a bug report please see the Simutrans forum:
http://forum.simutrans.com
ERROR: loadsave_t::wr_open: Cannot open 'save/segfault.sv_' for writing!
For help with this error or to file a bug report please see the Simutrans forum:
http://forum.simutrans.com
ERROR: karte_t::save(): cannot open file for writing! check permissions!
For help with this error or to file a bug report please see the Simutrans forum:
http://forum.simutrans.com
Segmentation fault (core dumped)

jamespetts

This is very likely to be related to Ceeac's latest patch relating to IO streams, which I believe was an attempt to fix the freezing issue. I do not believe that I have the expertise to fix this without a truly extreme amount of work that I am unlikely to have the time to undertake for the foreseeable future.

Unless a fix can be found for this very soon, I will have to revert the IO streams patch.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

freddyhayward

Quote from: jamespetts on January 13, 2021, 09:28:23 AMThis is very likely to be related to Ceeac's latest patch relating to IO streams, which I believe was an attempt to fix the freezing issue. I do not believe that I have the expertise to fix this without a truly extreme amount of work that I am unlikely to have the time to undertake for the foreseeable future.

Unless a fix can be found for this very soon, I will have to revert the IO streams patch.
It's certain, not very likely. The patch will have to be reverted until ceeac is is able to resolve the issue and the patch is tested.

freddyhayward

Quote from: jamespetts on January 13, 2021, 09:44:50 AMUnfortunately, the fix to this appears to have caused this issue in which all Linux clients crash on attempting to save any game using zstd. I am afraid that I will need to revert this patch unless a solution can be found, and I do not have the expertise in this area of the code (nor the time to acquire such expertise) to do this myself.
I should note that this affects the bridgewater-brunel headless server, in addition to linux clients.

jamespetts

Quote from: freddyhayward on January 13, 2021, 09:50:00 AM
I should note that this affects the bridgewater-brunel headless server, in addition to linux clients.

Yes, I have noted this checking from the command line interface that the server appears to restart immediately on a force-sync command being issued.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

I have reverted the zstd streams patch for the present, as there does not seem to be a solution to that which I can deduce or implement within any reasonable amount of time. I am running a manual rebuild on the server now, so it should be running again in circa 30 minutes.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

Ubuntu using version 1.3.8 of zstd. Revision r9567 has a file that should take care of the ZSTD library revision and does not use the new features if too old. You can just copy the file from \io\rdwr\zstd_file_rdwr_stream.cc

jamespetts

Thank you for that - that is very helpful. I will have to look into this when I get a moment.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ceeac

I have submitted pull request #342 which includes prissi's changes. Please test before merging; the other pull request did work for me too.

jamespetts

Quote from: ceeac on January 16, 2021, 05:07:16 PM
I have submitted pull request #342 which includes prissi's changes. Please test before merging; the other pull request did work for me too.

Thank you very much for this: this is much appreciated. I have now incorporated this. We will have to see whether this works on Ubuntu 20.04 with to-morrow's nightly build.

I notice that this solves another problem, too: previously, for some reason, Simutrans had not been closing the server13353-network.sve file, with the result that this could not be deleted or overwritten. I believe that this was the cause of this error. I only realised that this may have been the cause earlier this evening when trying to delete this file manually and being informed by Windows Explorer that the file was locked by Simutrans-Extended.

If this fix works on the server, too, this should also fix the side-effect of my workaround for this, which is that the players' passwords were automatically reset every evening.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Matthew

As of today (#d25652d), I noticed a message appearing in the server log that I don't remember seeing before:

Warning: zstd_file_rdwr_stream_t::zstd_file_rdwr_stream_t:      Cannot set workers: Unsupported parameter

It might be correlated with players failing to join, but the log is messy with players joining and failing to join, so I'm very uncertain about that.

This may be the wrong thread but seemed to be the most likely candidate.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

prissi

This should no longer occur with the patch, if included correctlz, since this would be only called when the librarz is new enough to understand this parameter.