Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002554 [Quercus] crash always 03-25-08 23:27 04-16-08 10:29
Reporter sjdelfab View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.1.6 Product Version 3.1.5
  Product Build
Summary 0002554: Script time out when using Quercus
Description Get the following exception when executing a PHP script via javax.script interfaces.

com.caucho.quercus.QuercusRuntimeException: script timed out
at com.caucho.quercus.env.Env.checkTimeout(Env.java:764)
at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:175)
at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126)
at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:99)
at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:239)
at com.caucho.quercus.script.QuercusCompiledScript.eval(QuercusCompiledScript.java:88)
at test.psd.workflow.RunPhpScript2.main(RunPhpScript2.java:46)

To test, run

public class RunPhpScript2 {

  private static String scriptStr = "<?php " +
  "function parau() { " +
  " echo \"O vai 'oe ?\n\";" +
  " };" +
  " echo \"Ia ora na\n\";" +
  " parau();" +
  " echo \"A parahi\";" +
  " ?>";
    
    /**
     * @param args
     */
    public static void main(String[] args) throws Exception {
        Writer stdOut = null;
        try {
            Writer strWriter = new StringWriter();
            stdOut = new PrintWriter(strWriter);
            ScriptEngine phpEngine = new QuercusScriptEngineFactory().getScriptEngine();
            ScriptContext scriptContext = phpEngine.getContext();
            scriptContext.setWriter(stdOut);
            Bindings bindings = phpEngine.createBindings();
            HashMap<String,Object> map = new HashMap<String,Object>();
            //$invoiceId = 1;
            map.put("invoiceId", new Integer(1));
            bindings.putAll(map);
            scriptContext.setBindings(bindings,ScriptContext.ENGINE_SCOPE);
            CompiledScript script = ((Compilable)phpEngine).compile(scriptStr);
            script.eval(scriptContext);
            stdOut.flush();
            System.out.println(strWriter.toString());
        } finally {
            if (stdOut != null) {
                try {
                    stdOut.close();
                } catch (IOException e) {
                    //ignore
                }
            }
        }
    }

}
Steps To Reproduce
Additional Information Similar to issue: http://bugs.caucho.com/bug_view_page.php?bug_id=2067 [^]

java -version =
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode)

When running as Ant script:

ant -v -f build-tmp.xml phpTest
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build-tmp.xml
Detected Java version: 1.5 in: c:\program files\java\jdk1.6.0_02\jre
Detected OS: Windows XP

phpTest:
     [java] Executing 'C:\program files\java\jdk1.6.0_02\jre\bin\java.exe' with arguments:
     [java] '-Xmx1024m'
     [java] '-classpath'
     [java] 'C:\SVN\pbrc\Head\src\classes;C:\SVN\pbrc\Head\dependencies\javalibs\server\quercus.jar;C:\SVN\pbrc\Head\dependencies\javalibs\server
\resin-util.jar;C:\SVN\pbrc\Head\dependencies\javalibs\common\script-api.jar'
     [java] 'test.psd.workflow.RunPhpScript2'
     [java]
     [java] The ' characters around the executable and arguments are
     [java] not part of the command.
     [java] 26/03/2008 17:52:42 com.caucho.quercus.Quercus parseServicesModule
     [java] INFO: Failed loading com.caucho.quercus.lib.ApacheModule
     [java] java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
     [java] 26/03/2008 17:52:42 com.caucho.quercus.Quercus parseServicesModule
     [java] INFO: Failed loading com.caucho.quercus.lib.MailModule
     [java] java.lang.NoClassDefFoundError: javax/mail/Address
     [java] 26/03/2008 17:52:43 com.caucho.quercus.Quercus parseServicesModule
     [java] INFO: Failed loading com.caucho.quercus.lib.QuercusModule
     [java] java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
     [java] 26/03/2008 17:52:43 com.caucho.quercus.Quercus parseServicesModule
     [java] INFO: Failed loading com.caucho.quercus.lib.i18n.UnicodeModule
     [java] java.lang.NoClassDefFoundError: javax/mail/MessagingException
     [java] 26/03/2008 17:52:43 com.caucho.quercus.Quercus parseServicesModule
     [java] INFO: Failed loading com.caucho.quercus.lib.ApacheModule
     [java] java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
     [java] 26/03/2008 17:52:43 com.caucho.quercus.Quercus parseServicesModule
     [java] INFO: Failed loading com.caucho.quercus.lib.MailModule
     [java] java.lang.NoClassDefFoundError: javax/mail/Address
     [java] 26/03/2008 17:52:43 com.caucho.quercus.Quercus parseServicesModule
     [java] INFO: Failed loading com.caucho.quercus.lib.QuercusModule
     [java] java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
     [java] 26/03/2008 17:52:43 com.caucho.quercus.Quercus parseServicesModule
     [java] INFO: Failed loading com.caucho.quercus.lib.i18n.UnicodeModule
     [java] java.lang.NoClassDefFoundError: javax/mail/MessagingException
     [java] Exception in thread "main" com.caucho.quercus.QuercusRuntimeException: script timed out
Attached Files

- Relationships

- Notes
(0002979)
nam
04-16-08 10:29

php/214f

Only affects Compilable.compile scripts.
 

- Issue History
Date Modified Username Field Change
03-25-08 23:27 sjdelfab New Issue
04-10-08 12:05 nam Status new => acknowledged
04-16-08 05:55 nam Status acknowledged => assigned
04-16-08 05:55 nam Assigned To  => nam
04-16-08 10:29 nam Status assigned => closed
04-16-08 10:29 nam Note Added: 0002979
04-16-08 10:29 nam Resolution open => fixed
04-16-08 10:29 nam Fixed in Version  => 3.1.6


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker