Summary: Scripting: Limit execution time
                 Project: Freeciv
            Submitted by: englabenny
            Submitted on: torsdag 2010-04-08 den 00:53
                Category: general
                Priority: 5 - Normal
                  Status: Ready For Test
                 Privacy: Public
             Assigned to: englabenny
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 2.2.x, 2.3.0



To catch infinite loops or any kind of very slow script, we can limit script
execution time. There should be something that interrupts script execution so
that it can't hang the server forever (writers of buggy scripts will be

A lua debug hook is installed to be invoked every 10000 executed lua
instructions. The limit of 5.0 seconds of CPU time is a very high limit. It
applies to all script function calls individually, including script load
time, script callback execution, etc.

Proposed for 2.2 and trunk

An easy way to make an infinite loop in lua, for testing purposes, is 'while
true do end'.


File Attachments:

Date: torsdag 2010-04-08 den 00:53  Name:
2010040801-Scripting-Limit-execution-time.patch  Size: 3 kB   By: englabenny



Reply to this item at:


  Meddelandet skickades via/av Gna!

Freeciv-dev mailing list

Reply via email to