Search code examples
javascriptcommand-linerhinoenvjs

Rhino command line execution gets killed - what could be the reason / how to debug


we have a Javascript test setup with Rhino + Envjs and CI server running Ubuntu. We're running our tests from the command line with the following:

java -cp ext/js.jar:ext/jline.jar org.mozilla.javascript.tools.shell.Main -opt -1 -f run.js

Now we surprisingly got following problem : the test running stops, printing only the following:

[  Envjs/1.6 (Rhino; U; Linux amd64 3.2.0-33-generic; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13  ]
Killed

At another computer (Mac) the same tests pass without problems. I tried debug switch -debug and Java memory size -Xmx1024m but those didn't help.

NOTE: Restarting the server solved the problem this time.

UPDATE : After some days this has happened today a couple of times, however subsequent builds have succeeded.

UPDATE 2 : This seems to happen every now and then, sometimes also after test have been succesfully run.

This might be a single case, but do you have idea what could be the reason or how to debug Rhino if something like this happens again?

br, Touko


Solution

  • "Killed" means the process was terminated by a signal from the outside. Common cases are:

    • Someone used kill with the wrong process ID
    • There is a system resource monitor installed which terminates processes that take too many resources. On Linux, use ulimit and ask your sysadmin.
    • Your OS runs out of memory in a place where it can't let Java know about the error (i.e. this happens when the OS itself needs memory to complete an operation for the Java VM like I/O).