Another Daylength patch

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Gigigonzalez
Engineer
Engineer
Posts: 91
Joined: 12 Jun 2014 14:24

Re: Another Daylength patch

Post by Gigigonzalez »

I got the first server crash with this patch after sucessfully ran it for 3 days.
We ran the server with 15 companies and often 7-8 people connected at once.




Code: Select all

Error: Assertion failed at line 1524 of /home/xxxxx/xxxxx/trunk/src/saveload/saveload.cpp: IsVariableSizeRight(sld)
Crash encountered, generating crash log...
*** OpenTTD Crash Report ***

Crash at: Tue Aug  5 01:38:32 2014
In game date: 1889-12-02 (44)

Crash reason:
 Signal:  Aborted (6)
 Message: Assertion failed at line 1524 of /home/xxxxx/xxxxx/trunk/src/saveload/saveload.cpp: IsVariableSizeRight(sld)

OpenTTD version:
 Version:    r26694M (2)
 NewGRF ver: 15006846
 Bits:       64
 Endian:     little
 Dedicated:  yes
 Build date: Aug  2 2014 21:47:45

Stacktrace:
 [00] ./openttd(_ZNK12CrashLogUnix13LogStacktraceEPcPKc+0x39) [0x63ee69]
 [01] ./openttd(_ZNK8CrashLog12FillCrashLogEPcPKc+0xf5) [0x88b765]
 [02] ./openttd(_ZNK8CrashLog12MakeCrashLogEv+0x46) [0x88b386]
 [03] ./openttd() [0x8ece14]
 [04] /lib64/libc.so.6() [0x3606835cb0]
 [05] /lib64/libc.so.6(gsignal+0x39) [0x3606835c39]
 [06] /lib64/libc.so.6(abort+0x148) [0x3606837348]
 [07] ./openttd(_Z5errorPKcz+0xe2) [0x8f2c32]
 [08] ./openttd(_Z14SlObjectMemberPvPK8SaveLoad+0x19f8) [0x9c4618]
 [09] ./openttd(_Z8SlObjectPvPK8SaveLoad+0x36) [0x9c1d16]
 [10] ./openttd() [0x7db8cf]
 [11] ./openttd() [0x79656e]
 [12] ./openttd() [0x796336]
 [13] ./openttd(_ZN30ServerNetworkGameSocketHandler7SendMapEv+0x5e2) [0x796052]
 [14] ./openttd(_Z15NetworkGameLoopv+0xb6a) [0x79480a]
 [15] ./openttd(_Z8GameLoopv+0x134) [0x7929f4]
 [16] ./openttd(_ZN21VideoDriver_Dedicated8MainLoopEv+0x249) [0x790bc9]
 [17] ./openttd(_Z12openttd_mainiPPc+0x12c1) [0x668231]
 [18] ./openttd(main+0x7f) [0x666f1f]
 [19] /lib64/libc.so.6(__libc_start_main+0xf5) [0x3606821d65]
 [20] ./openttd() [0x4fde89]

Operating system:
 Name:     Linux
 Release:  3.15.4-200.fc20.x86_64
 Version:  #1 SMP Mon Jul 7 14:24:41 UTC 2014
 Machine:  x86_64
 Compiler: ICC 1400 (GCC 4.8.1 mode) "Intel(R) C++ g++ 4.8 mode"

Configuration:
 Blitter:      null
 Graphics set: OpenGFX (5203)
 Language:     /home/xxxxx/xxxxx/lang/english_US.lng
 Music driver: null
 Music set:    NoMusic (0)
 Network:      server
 Sound driver: null
 Sound set:    NoSound (2)
 Video driver: dedicated

Fonts:
 Small:  sprite
 Medium: sprite
 Large:  sprite
 Mono:   sprite

AI Configuration (local: 255):
  0: Human
  1: Human
  2: Human
  3: Human
  4: Human
  5: Human
  6: Human
  7: Human
  8: Human
  9: Human
 10: Human
 11: Human
 12: Human
 13: Human
 14: Human
 GS: CityBuilder (v100)

Libraries:
 LZMA:       5.1.2alpha
 LZO:        2.08
 Zlib:       1.2.8

---- gamelog start ----
Tick 0: new game started
Revision text changed to r26694M, savegame version 210, modified, _openttd_newgrf_version = 0x15006846
New game mode: 2 landscape: 2
Added NewGRF: GRF ID F1250005, checksum 71231BAE6D5F4A5878933ADB74CABEE5, filename: firs_industry_replacement_set-1.3.0/firs.grf (md5sum matches)
Added NewGRF: GRF ID 2D480107, checksum D12D0DF9F96AFFB4122E32D0C5D12D63, filename: main_hq_ttdur-1.0/mainhqw.grf (md5sum matches)
Added NewGRF: GRF ID 4C4D0201, checksum F4D9597764DCB3ED985A79978F233A8C, filename: dutch_signals-1/dutchsignals.grf (md5sum matches)
Added NewGRF: GRF ID 52571203, checksum 7CE88A25DDB058C1BE577B88D049B274, filename: egrvts2-188/egrvts2.grf (md5sum matches)
Added NewGRF: GRF ID 4D42000A, checksum BC3A0E791C74C1A04A3B90C3B2FA83A6, filename: BATSv0.4w.GRF (md5sum matches)
Added NewGRF: GRF ID 4642FB21, checksum 117F6F1F07C18A9C15ADC6127AFBAE97, filename: modern_tram_set-3.1/motraset_r3.1.grf (md5sum matches)
Added NewGRF: GRF ID FBFB0102, checksum FF36ECFC309CE45F6A340ADE2D3A2FF2, filename: dutch_tram_set-2.0.0/dutchtramset.grf (md5sum matches)
Added NewGRF: GRF ID 4E415256, checksum ABC1F6EB17576182AEC8863E751DF6D5, filename: north_american_road_vehicle_set-0.1.2/narvs.grf (md5sum matches)
Added NewGRF: GRF ID 41501202, checksum B13DD8FB0D7C34CACAC2FE68BD137BB9, filename: heqs_heavy_equipment_set-1.5.2/heqs.grf (md5sum matches)
Added NewGRF: GRF ID 485A0101, checksum 7636EC20949478C0576AE6CDACE9EC84, filename: hover_vehicles-1/hoverv.grf (md5sum matches)
Added NewGRF: GRF ID 4D656F17, checksum 8A4F8A04256C90BECF818D134C91C816, filename: long_vehicles-v404oct2008/4lvw.grf (md5sum matches)
Added NewGRF: GRF ID 1560B248, checksum 76BE5A3BA8C66817C14CFA05177D20D9, filename: redfish-0.4/redfish.grf (md5sum matches)
Added NewGRF: GRF ID 4A4D0101, checksum AFE4E75999A3FF92D4B01DBEE9A803E9, filename: sailing_ships-0.62/ss.grf (md5sum matches)
Added NewGRF: GRF ID 44440A01, checksum FCEEC76CF44EC23E7FE9C88048CF11CC, filename: av8_aviators_aircraft_set-2.21/pb_av8w.grf (md5sum matches)
Added NewGRF: GRF ID 44444040, checksum 310EE1B199D5A858BB1A7FB5F52F9969, filename: tropic_refurbishment_set.0.3c/troprsw.grf (md5sum matches)
Added NewGRF: GRF ID 27711003, checksum 30EF819C36EA5E003976E26A8A25CF71, filename: 2cc_trainset-2.0.0beta5/2cctrainset.grf (md5sum matches)
Added NewGRF: GRF ID 44441000, checksum DA36131A815D2D5FC158C7A27D67B5AF, filename: ukrs2__the_uk_railway_set-1.05/proj1000.grf (md5sum matches)
Added NewGRF: GRF ID 44441001, checksum 83915879F68DD174C953868C0629A4C9, filename: ukrs2_uk_railway_addon_set-gobi/pj1kadd.grf (md5sum matches)
Added NewGRF: GRF ID 4A560101, checksum 6A9F478B12CED677D71DE276ABB137D2, filename: finnish_trainset-0.5.8/finnishtrainset.grf (md5sum matches)
Added NewGRF: GRF ID 535A0D00, checksum 303B682EFC6FE9070761A2B14B71419C, filename: japanese_train_set-3.1/jptrains.grf (md5sum matches)
Added NewGRF: GRF ID 05102002, checksum A8B77B8D1F20D43B6FA521B4C3A8FC50, filename: monolev_replacement_set_v0.3.6-0.3.7/mrsv037.grf (md5sum matches)
Added NewGRF: GRF ID 44440302, checksum 439275017478C2E5E7AA25F5E191903D, filename: north_american_renewal_set.2_03/nars2w.grf (md5sum matches)
Added NewGRF: GRF ID 48410101, checksum 8C016D951E1391A3EC0415676DD9AE76, filename: nuts_unrealistic_train_set-0.7.3/nuts.grf (md5sum matches)
Added NewGRF: GRF ID FBFB0601, checksum 2B58B740B389A5A59F1A2A5B47FDC2E8, filename: dutch_trainset_2-2.0.0beta1/dutchtrains.grf (md5sum matches)
Added NewGRF: GRF ID 44442411, checksum E6A38D0DC67DE54DD2928447BB72F924, filename: tai_uk_houses-gamma1/tai_uk.grf (md5sum matches)
Added NewGRF: GRF ID 41533031, checksum F3A0A556505B7A94733D85B892C2070C, filename: swedish_houses-1.1.1/swehouses.grf (md5sum matches)
Added NewGRF: GRF ID 52453400, checksum 87E88EFA687F91CE44548E54DA55059F, filename: japanese_buildings-3.0/jpbuild.grf (md5sum matches)
Added NewGRF: GRF ID 56430001, checksum 2AD089EE6B73F25D79F286AD43765914, filename: ttrs3w.grf (md5sum matches)
Added NewGRF: GRF ID 54631002, checksum 8A4C46A4E6BE179023A39A6E6202061E, filename: rail-cs-ottd.grf (md5sum matches)
Added NewGRF: GRF ID FBFB0701, checksum FE01B39BB05F8BC0BBF6B14972A79168, filename: dutch_tracks-0.1.0alpha1/dutchtracks.grf (md5sum matches)
Added NewGRF: GRF ID 4A430002, checksum 237EC8B4432F26C2721B69D0814045E6, filename: industrial_stations_renewal-1.0.0/indstatr.grf (md5sum matches)
Added NewGRF: GRF ID 58534453, checksum 2E100BCA91DB8371CD9D57DBEC3AB0C8, filename: dutch_stations_set-1.0.0alpha/dutchstatw.grf (md5sum matches)
Added NewGRF: GRF ID 43485053, checksum 68B7DC640138E4F4B712F3CFB88167D6, filename: chips_station_set-1.4.0/chips.grf (md5sum matches)
Added NewGRF: GRF ID 504A0110, checksum E8244C5278CB2408A818854DC11F8940, filename: dutch_station_addition_set-0.8/dstatadd_v0_8.grf (md5sum matches)
Added NewGRF: GRF ID 54430202, checksum 081B62FD686AF2161866A0CF6EA043AC, filename: cs_platforms_set-1/csplatformsw.grf (md5sum matches)
Added NewGRF: GRF ID 444E0800, checksum 334F8C4697455569073434DB107F864A, filename: vast_objects-0.3.0/vastobjects.grf (md5sum matches)
Added NewGRF: GRF ID 444E0400, checksum 735D3D74D5DCADBF1FD6EF7A9C5A3519, filename: vast_station_tiles-0.2.0/vast.grf (md5sum matches)
Added NewGRF: GRF ID 504A0013, checksum E2FB4F9E66207F8016B7303323FDD00C, filename: isrdwestyle_objects-1.0/isrdwe_objects_v1_0.grf (md5sum matches)
Added NewGRF: GRF ID 535A0224, checksum 69B70AE56EEB9310B62A8A93AD6A4500, filename: speed_for_suspension_bridges-v1/susp_brg.grf (md5sum matches)
Added NewGRF: GRF ID 4D470305, checksum 2E96B9AB2BEA686BFF94961AD433A701, filename: basecosts-5.0/basecosts.grf (md5sum matches)
Tick 1280: game loaded
New game mode: 1 landscape: 2
---- gamelog end ----

*** End of OpenTTD Crash Report ***

Crash log generated.

Writing crash log to disk...
Crash log written to crash.log. Please add this file to any bug reports.

Writing crash savegame...
Error: Assertion failed at line 1524 of /home/xxxxx/xxxxx/trunk/src/saveload/saveload.cpp: IsVariableSizeRight(sld)


I must say since they implemented this more 'thorough' checking if variables are still right is really starting to bother me. How is someone to ever fix an occasional crash that only occurs every few days? Is there a dirty way to STOP the server from crashing? Wihtout having to modify all the clients again? Remove a piece of code. I doubt this occasional 'mis' variable will cause the clients to desync.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Another Daylength patch

Post by Eddi »

Gigigonzalez wrote:I must say since they implemented this more 'thorough' checking if variables are still right is really starting to bother me. How is someone to ever fix an occasional crash that only occurs every few days?
in this case, it should be fairly easy. you load the crash dump into a debugger, and figure out which variable is the problem. if you know your way around, it would take a few minutes.
Is there a dirty way to STOP the server from crashing? Wihtout having to modify all the clients again?
yes, there is. you need to tell configure to compile with assertions disabled, then it will simply ignore this type of error.
I doubt this occasional 'mis' variable will cause the clients to desync.
it may be possible that this causes desyncs, but in "normal" use cases it not very likely. but those desyncs would have been in there anyway, before this check was introduced. so you're not getting any worse than previously.
Gigigonzalez
Engineer
Engineer
Posts: 91
Joined: 12 Jun 2014 14:24

Re: Another Daylength patch

Post by Gigigonzalez »

Eddi wrote:
Gigigonzalez wrote:I must say since they implemented this more 'thorough' checking if variables are still right is really starting to bother me. How is someone to ever fix an occasional crash that only occurs every few days?
in this case, it should be fairly easy. you load the crash dump into a debugger, and figure out which variable is the problem. if you know your way around, it would take a few minutes.
Is there a dirty way to STOP the server from crashing? Wihtout having to modify all the clients again?
yes, there is. you need to tell configure to compile with assertions disabled, then it will simply ignore this type of error.
I doubt this occasional 'mis' variable will cause the clients to desync.
it may be possible that this causes desyncs, but in "normal" use cases it not very likely. but those desyncs would have been in there anyway, before this check was introduced. so you're not getting any worse than previously.
Thanks for the response. I was under the impression --disable-asserts was for compile time errors.

Yes the patch had this 'bug' for a long time, it happened with the old one, and the newest one posted here probably. But it never caused desyncs, just the new crash after the revision that implemented this checking system.

Would the clients have to be recompiled with --disable-assert too?
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Another Daylength patch

Post by Eddi »

sort of, yes. but you can also tell them to disable autosave, then it will probably not happen to them (unless they manually save).
User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Another Daylength patch

Post by pavel1269 »

Is there any way to reproduce this bug? Which patch did you use? Do you use only this patch? I play with this patch as well and I never had a problem while saving.
Gigigonzalez
Engineer
Engineer
Posts: 91
Joined: 12 Jun 2014 14:24

Re: Another Daylength patch

Post by Gigigonzalez »

Nvm /10char
Gigigonzalez
Engineer
Engineer
Posts: 91
Joined: 12 Jun 2014 14:24

Re: Another Daylength patch

Post by Gigigonzalez »

Alright going to try this again. I was under the assumption the patch i got from someone was purely this patch but it also contained other stuff.

So to be 100% sure, you are sure that this patch does not go desync or give those nasty Assertion failed (savegame.cpp) errors even in multiplayer with a game that lasts 1/2 weeks?

(Excluding unstable PC's etc ;))
Lechuza
Engineer
Engineer
Posts: 16
Joined: 30 Oct 2014 01:33

Re: Another Daylength patch

Post by Lechuza »

Anyone knows how to apply this patch to version 1.4.4 RC1? It is crashing when I enter the Advanced Setting window.
To be more specific, in code it crashes at: settings_gui.cpp, Line: 951 Expression: this->setting != NULL.
I've been going through it with the debugger but I cannot figure out when is getting the incorrect value. Any help will be appreciated :)
User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Another Daylength patch

Post by pavel1269 »

The patching must have failed, you should more focus on that.
Lechuza
Engineer
Engineer
Posts: 16
Joined: 30 Oct 2014 01:33

Re: Another Daylength patch

Post by Lechuza »

Yes you are correct, I am getting rejected patch hunks with SVN. How do I solve them?
The files are: saveload.cpp, setting_gui.cpp
-------------------------------------------------------------------------------------------------------------------------------------------
--- src/settings_gui.cpp
+++ src/settings_gui.cpp
@@ -1561,6 +1561,7 @@
SettingsPage *accounting = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCOUNTING));
{
accounting->Add(new SettingEntry("economy.inflation"));
+ accounting->Add(new SettingEntry("economy.day_length_factor"));
accounting->Add(new SettingEntry("difficulty.initial_interest"));
accounting->Add(new SettingEntry("difficulty.max_loan"));
accounting->Add(new SettingEntry("difficulty.subsidy_multiplier"));

-------------------------------------------------------------------------------------------------------------------------------------------
--- src/saveload/saveload.cpp
+++ src/saveload/saveload.cpp
@@ -260,7 +260,7 @@
* 190 26547
* 191 26646
*/
-extern const uint16 SAVEGAME_VERSION = 191; ///< Current savegame version of OpenTTD.
+extern const uint16 SAVEGAME_VERSION = 200; ///< Current savegame version of OpenTTD.

SavegameType _savegame_type; ///< type of savegame we are loading
-------------------------------------------------------------------------------------------------------------------------------------------

Thanks again!
Eddy Arfik
Transport Coordinator
Transport Coordinator
Posts: 260
Joined: 09 Apr 2014 11:10

Re: Another Daylength patch

Post by Eddy Arfik »

Lechuza wrote:Yes you are correct, I am getting rejected patch hunks with SVN. How do I solve them?
Try applying this to latest trunk (r27051)
Attachments
01_true_day_length_r27051.patch
(8.07 KiB) Downloaded 473 times
Lechuza
Engineer
Engineer
Posts: 16
Joined: 30 Oct 2014 01:33

Re: Another Daylength patch

Post by Lechuza »

Thank you! That worked straight off the bat! :bow:
I don't know how you did it, so I am going to try and understand it since I am trying to familiarize myself with the codebase so I can get the hang of it a little bit more.
Gigigonzalez
Engineer
Engineer
Posts: 91
Joined: 12 Jun 2014 14:24

Re: Another Daylength patch

Post by Gigigonzalez »

Had the same isue here, no idea but somehow i managed to fix it myself :p

Can someone explain how the saveload.cpp versioning thingy works btw, i understand that it can define what loads with what and apply specific code based on what savegame is detected etc? but Whats the logic from going to 194 to 200?

Is a savegame file marked with this version and any openttd that tries to load it will run specific code (if applicable) when loading the savegame? What happens when someone tries loading a savegame with a client that surpasses 200?

Sorry for the noob questions.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Another Daylength patch

Post by Eddi »

When a client tries to load a savegame which has a lower savegame version than the current one, the function AfterLoadGame is called to fix things that were added since then. Also, settings which were added will automatically get their default value set.

A client cannot load a savegame with a higher savegame version.
MladenNinkovic
Engineer
Engineer
Posts: 11
Joined: 16 Oct 2014 11:51

Re: Another Daylength patch

Post by MladenNinkovic »

Could someone please upload a compiled version of this patch for 1.4.4
Lechuza
Engineer
Engineer
Posts: 16
Joined: 30 Oct 2014 01:33

Re: Another Daylength patch

Post by Lechuza »

MladenNinkovic wrote:Could someone please upload a compiled version of this patch for 1.4.4
Not at home right now, but I have it for the nightly r27051 version if that is alright with you. I will upload it when I get back.
MladenNinkovic
Engineer
Engineer
Posts: 11
Joined: 16 Oct 2014 11:51

Re: Another Daylength patch

Post by MladenNinkovic »

Thand you so much. :bow: :bow: :bow:
Lechuza
Engineer
Engineer
Posts: 16
Joined: 30 Oct 2014 01:33

Re: Another Daylength patch

Post by Lechuza »

Sorry it took so long, yesterday was a busy day and I forgot to upload it once I got back home.
But here you go, it is version r27055: https://dl.dropboxusercontent.com/u/241 ... -win64.rar
Grall3
Engineer
Engineer
Posts: 43
Joined: 17 Oct 2005 04:59

Re: Another Daylength patch

Post by Grall3 »

Hello people. The dropbox link seems to not work. When I click on it, a dropbox website comes up with a 404 error.

Just thought I'd let you know.
LarryGolade
Engineer
Engineer
Posts: 17
Joined: 23 Aug 2014 17:22

Re: Another Daylength patch

Post by LarryGolade »

hi all,

i have download the 1.5.0 beta and i would like add a daylenght patch. How make i can ?

thanks!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 5 guests