URL:
  <http://gna.org/patch/?1599>

                 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

    _______________________________________________________

Details:

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
thankful).

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

<http://gna.org/patch/download.php?file_id=8856>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?1599>

_______________________________________________
  Meddelandet skickades via/av Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to