Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004295 [Quercus] crash always 11-16-10 08:58 03-22-12 13:42
Reporter timboco View Status public  
Assigned To
Priority normal Resolution open  
Status assigned   Product Version 4.0.13
Summary 0004295: Stack Overflow / Infinite recursion with Zend Framework (in ArrayModule.array_key_exists)
Description Quercus Servlet throws a java.lang.StackOverflowError, which appears to be due to an infinite call loop stared in com.caucho.quercus.lib.ArrayModule.array_key_exists(ArrayModule.java:423).


Additional Information I am running Quercus on Glassfish V3.01, trying to set it up with the Zend Framework v1.11.0. (This should be possible, since domhorn fixed Bug 0004243, although there still is an open issue with Zend open, i.e. Bug 0003384).

There is a StackOverflow when calling, for example:
Zend_View_Helper_HeadMeta::headMeta()
Zend_View_Helper_HeadTitle::headTitle()
Zend_View_Helper_Doctype::doctype()

This is the actual code I am calling in a layout.phtml file, and it catches a StackOverflowError:
<?php
try {
    $this->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
    $this->headTitle()->setSeparator(' - ');
    $this->headTitle('Zend Framework Tutorial');
    echo $this->doctype();
} catch (Exception $ex) {
    echo $ex->__toString();
}

?>


Here is a snippet from Glassfish's server.log (full log attached), if wanted I can also provide the .war file:
[#|2010-11-15T10:06:37.343-0700|WARNING|glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=31;_ThreadName=Thread-1;|ApplicationDispatcher[/index] PWC1231:
Servlet.service() for servlet Quercus Servlet threw exception
com.caucho.quercus.QuercusModuleException: java.lang.StackOverflowError
    at com.caucho.quercus.QuercusModuleException.create(QuercusModuleException.java:64)
    at com.caucho.quercus.module.StaticFunction.invoke(StaticFunction.java:150)
    at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java:737)
    at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:643)
    at com.caucho.quercus.expr.CallExpr.evalImpl(CallExpr.java:239)
    at com.caucho.quercus.expr.CallExpr.eval(CallExpr.java:151)
    at com.caucho.quercus.expr.Expr.evalValue(Expr.java:469)
    at com.caucho.quercus.statement.ReturnStatement.execute(ReturnStatement.java:69)
    at com.caucho.quercus.program.Function.callImpl(Function.java:433)
    at com.caucho.quercus.program.Function.callMethod(Function.java:469)
    at com.caucho.quercus.function.AbstractFunction.callMethod(AbstractFunction.java:614)
    at com.caucho.quercus.env.ObjectExtValue.callMethod(ObjectExtValue.java:819)
    at com.caucho.quercus.env.Value.callMethod(Value.java:1608)
    at com.caucho.quercus.lib.spl.ArrayAccessDelegate.isset(ArrayAccessDelegate.java:77)
    at com.caucho.quercus.env.ObjectValue.isset(ObjectValue.java:289)
    at com.caucho.quercus.env.Value.keyExists(Value.java:2668)
    at com.caucho.quercus.lib.ArrayModule.array_key_exists(ArrayModule.java:423)
    at sun.reflect.GeneratedMethodAccessor1131.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.caucho.quercus.module.StaticFunction.invoke(StaticFunction.java:135)
    at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java:737)
    at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:643)
    at com.caucho.quercus.expr.CallExpr.evalImpl(CallExpr.java:239)
    at com.caucho.quercus.expr.CallExpr.eval(CallExpr.java:151)
    at com.caucho.quercus.expr.Expr.evalValue(Expr.java:469)
    at com.caucho.quercus.statement.ReturnStatement.execute(ReturnStatement.java:69)
    at com.caucho.quercus.program.Function.callImpl(Function.java:433)
    at com.caucho.quercus.program.Function.callMethod(Function.java:469)
    at com.caucho.quercus.function.AbstractFunction.callMethod(AbstractFunction.java:614)
    at com.caucho.quercus.env.ObjectExtValue.callMethod(ObjectExtValue.java:819)
    at com.caucho.quercus.env.Value.callMethod(Value.java:1608)
    at com.caucho.quercus.lib.spl.ArrayAccessDelegate.isset(ArrayAccessDelegate.java:77)
    at com.caucho.quercus.env.ObjectValue.isset(ObjectValue.java:289)
    at com.caucho.quercus.env.Value.keyExists(Value.java:2668)
    at com.caucho.quercus.lib.ArrayModule.array_key_exists(ArrayModule.java:423)
    at sun.reflect.GeneratedMethodAccessor1131.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
Attached Files  server.log_2010-11-15T10-47-25.zip [^] (22,720 bytes) 11-16-10 08:58

- Relationships

- Notes
(0004943)
ymakhno
01-15-11 17:37

I've debugged this problem and sure that this is problem of damn Zend coders, because of such code in Zend/Registry.php.
{{{
    /**
     * @param string $index
     * @returns mixed
     *
     * Workaround for http://bugs.php.net/bug.php?id=40442 [^] (ZF-960).
     */
    public function offsetExists($index)
    {
        return array_key_exists($index, $this);
    }
}}}
comment this method out and try again.

The problem is in quercus implementation such code goes to something like : {{{

    public function offsetExists($index) {
        return offsetExists($index);
    }
}}}
 

- Issue History
Date Modified Username Field Change
11-16-10 08:58 timboco New Issue
11-16-10 08:58 timboco File Added: server.log_2010-11-15T10-47-25.zip
11-16-10 09:00 timboco Issue Monitored: timboco
11-16-10 11:46 domdorn Status new => assigned
11-16-10 11:46 domdorn Assigned To  => domdorn
12-03-10 13:15 kdecherf Issue Monitored: kdecherf
01-15-11 17:37 ymakhno Note Added: 0004943
03-22-12 13:42 domdorn Assigned To domdorn =>


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