I am using PyV8 to run untrusted javascript. How can I detect and kill javascript that has inifinite or long loops? I would like to say v8 to run javascript and fail with a timeout if it has not finished in 0.1 seconds.
if it is python, you can use cow interrupt:
from interruptingcow import timeout try: with timeout(5, exception=RuntimeError): # perform a potentially very slow operation pass except RuntimeError: print "didn't finish within 5 seconds"
https://bitbucket.org/evzijst/interruptingcow
Source: https://habr.com/ru/post/911085/More articles:How to disable Google Chrome "View PDF Chrome files" with Asp.net - google-chromerefresh nested list in sencha touch 2 - sencha-touch-2Selenium Webdriver - check write protected text field? - javaWhy publish and cancel launch in View and Handler in different versions of bahviour? - androidHow to "block" the V8? - javascriptmysql group through comma separated values - mysqlsql split field with comma delimiter - sqlThe difference between using C # and importing Java - javacheck library (.cma) of signature from console - ocamlGetting inserted identifiers from saveAll () in CakePHP - phpAll Articles