[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands
Benedikt Straub has proposed merging lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands. Commit message: Add some sleep time to costly loops in fri02 to prevent freezing Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1831583 in widelands: "Crash in Frisians 2" https://bugs.launchpad.net/widelands/+bug/1831583 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1831583-fri02/+merge/368348 This is a Lua problem. gdb shows that masses of new Lua objects are created, and Lua doesn´t care to release the memory again. Hopefully, some additional sleep() will give the game and the garbage collector time to catch up. I don´t want to fix this by increasing the base sleep time or the objective will be marked done only after an enormous delay. Another way to fix the bug while perhaps improving performance would be to move the checks to C++, but I feel bad about having such specialised functions there. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands. === modified file 'data/campaigns/fri02.wmf/scripting/mission_thread.lua' --- data/campaigns/fri02.wmf/scripting/mission_thread.lua 2019-03-29 18:29:54 + +++ data/campaigns/fri02.wmf/scripting/mission_thread.lua 2019-06-04 18:05:55 + @@ -33,6 +33,7 @@ function check_empire() while true do + sleep(1000) for idx,field in ipairs(all_fields) do sleep(5) local p1c = false @@ -272,9 +273,9 @@ while not p3.defeated do sleep(4513) end set_objective_done(o) - -- If the barbarians already defeated Murilius – well done + -- If the barbarians already defeated Murilius – well done. -- Otherwise, Murilius provokes Reebaud into ordering the player to conquer his entire colony - -- (merely defeating the Empire isn’t enough) + -- (merely defeating the Empire isn’t enough). -- We don't bother to check water, walkable-only and other useless terrains. -- That would be really too much to ask from our poor player, now wouldn't it? if not p2.defeated then @@ -285,6 +286,7 @@ o = add_campaign_objective(obj_defeat_murilius) local def = false while not def do + sleep(1000) def = true for idx,field in ipairs(useful_fields) do if field.owner == p2 then ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands
Continuous integration builds have changed state: Travis build 5152. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/541383420. Appveyor build 4934. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1831583_fri02-4934. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1831583-fri02/+merge/368348 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands
Refusing to merge, since Travis is not green. Use @bunnybot merge force for merging anyways. Travis build 5152. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/541383420. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1831583-fri02/+merge/368348 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1831583-fri02. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands
The proposal to merge lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1831583-fri02/+merge/368348 -- Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1831583-fri02. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands
Review: Approve We have these sleep times a lot in our Lua scripts for checking loops, so let's have it :) @bunnybot merge -- https://code.launchpad.net/~widelands-dev/widelands/bug-1831583-fri02/+merge/368348 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1831583-fri02. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands
regarding these objectives a 1 second delay does not matter at all. for me even 2 or 3 seconds would be hardly recognizable by the player. so we could even go up with the sleep if necessary. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1831583-fri02/+merge/368348 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1831583-fri02. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1831583-fri02 into lp:widelands
Review: Approve Wow 3 times the inputqueues faiklure in one build seems to be a new record. @bunnybot merge force -- https://code.launchpad.net/~widelands-dev/widelands/bug-1831583-fri02/+merge/368348 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1831583-fri02. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp