Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003840 [Quercus] major always 01-07-10 05:05 02-22-10 04:34
Reporter rajesh View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version
Summary 0003840: com.caucho.quercus.QuercusModuleException: java.lang.StackOverflowError
Description I have successfully installed wordpress tomcat and quercus.. im getting the following error while running the application.I have attached the document with screenshot of the screens..
Additional Information
Attached Files  screenshot.doc [^] (89,600 bytes) 01-07-10 05:05

- Relationships

- Notes
(0004445)
lamsap
02-22-10 04:34
edited on: 02-22-10 04:37

I have this issue too. Resin 3.1.9, Wordpress 2.9.2.

Boils down to a PHP4 class constructor calling a PHP5 class constructor in WP_Widget (wp-includes/widgets.php), and (I don't know why) it goes into a StackOverflow. Is the constructor being called twice somehow?

Starting from wp-includes/plugin.php:336 (via the stack trace):

function do_action($tag, $arg = '') { ... }

the do { } while () loop at the end of the function is the problem. I tracked it down to the loading of 'wp_maybe_load_widgets'.

Looking at functions.php:wp_maybe_load_widgets we see a require_once:

function wp_maybe_load_widgets() {
        if ( ! apply_filters('load_default_widgets', true) )
                return;
        require_once( ABSPATH . WPINC . '/default-widgets.php' );
        add_action( '_admin_menu', 'wp_widgets_add_menu' );
}

Looking at default-widgets.php, at the last line it has:
add_action('init', 'wp_widgets_init', 1);

Comment that out, and the exception goes away. So, following the rabbit a bit further... All widgets are classes, and the default constructor is in WP_Widget in widgets.php:

        /**
         * PHP4 constructor
         */
        function WP_Widget( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
              $this->__construct( $id_base, $name, $widget_options, $control_options );
        }

        /**
         * PHP5 constructor
         *
         * @param string $id_base Optional Base ID for the widget, lower case,
         * if left empty a portion of the widget's class name will be used. Has to be unique.
         * @param string $name Name for the widget displayed on the configuration page.
         * @param array $widget_options Optional Passed to wp_register_sidebar_widget()
         * - description: shown on the configuration page
         * - classname
         * @param array $control_options Optional Passed to wp_register_widget_control()
         * - width: required if more than 250px
         * - height: currently not used but may be needed in the future
         */
        function __construct( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
                $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : strtolower($id_base);
                $this->name = $name;
                $this->option_name = 'widget_' . $this->id_base;
                $this->widget_options = wp_parse_args( $widget_options, array('classname' => $this->option_name) );
                $this->control_options = wp_parse_args( $control_options, array('id_base' => $this->id_base) );
        }

Note the PHP4 constructor calls the PHP5 constructor. If I comment out the call, the code works:

        function WP_Widget( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
           // $this->__construct( $id_base, $name, $widget_options, $control_options );
        }

While I'm not sure of how this code should behave (I haven't used PHP in years), I guess there may be a difference in how Quercus and the standard PHP handle class construction?

Hope that helps...

Stacktrace:

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:159)
    at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java:606)
    at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:541)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:182)
    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.IfStatement.execute(IfStatement.java:81)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:81)
    at com.caucho.quercus.program.ForeachStatement.execute(ForeachStatement.java:99)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.DoStatement.execute(DoStatement.java:68)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.Function.callImpl(Function.java:352)
    at com.caucho.quercus.program.Function.call(Function.java:292)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:182)
    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:105)
    at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:272)
    at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:70)
    at com.caucho.quercus.env.Env.include(Env.java:3742)
    at com.caucho.quercus.env.Env.includeOnce(Env.java:3691)
    at com.caucho.quercus.expr.IncludeOnceExpr.eval(IncludeOnceExpr.java:88)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:272)
    at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:70)
    at com.caucho.quercus.env.Env.include(Env.java:3742)
    at com.caucho.quercus.env.Env.includeOnce(Env.java:3691)
    at com.caucho.quercus.expr.IncludeOnceExpr.eval(IncludeOnceExpr.java:88)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:81)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:272)
    at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:70)
    at com.caucho.quercus.env.Env.include(Env.java:3742)
    at com.caucho.quercus.expr.IncludeExpr.eval(IncludeExpr.java:86)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:272)
    at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:70)
    at com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java:119)
    at com.caucho.quercus.servlet.ResinQuercusServlet.service(ResinQuercusServlet.java:149)
    at com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:355)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
    at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
    at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
    at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
    at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
    at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
    at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
    at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.StackOverflowError
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.Function.callImpl(Function.java:352)
    at com.caucho.quercus.program.Function.callRef(Function.java:302)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:178)
    at com.caucho.quercus.expr.FunctionExpr.evalRef(FunctionExpr.java:138)
    at com.caucho.quercus.expr.AssignRefExpr.eval(AssignRefExpr.java:74)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.Function.callImpl(Function.java:352)
    at com.caucho.quercus.program.Function.call(Function.java:292)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:182)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126)
    at com.caucho.quercus.program.ReturnStatement.execute(ReturnStatement.java:68)
    at com.caucho.quercus.program.Function.callImpl(Function.java:352)
    at com.caucho.quercus.program.Function.call(Function.java:292)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:182)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126)
    at com.caucho.quercus.expr.Expr.evalArg(Expr.java:411)
    at com.caucho.quercus.expr.ArrayFunExpr.eval(ArrayFunExpr.java:108)
    at com.caucho.quercus.expr.Expr.evalCopy(Expr.java:398)
    at com.caucho.quercus.expr.AssignExpr.eval(AssignExpr.java:86)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.Function.callImpl(Function.java:352)
    at com.caucho.quercus.program.Function.call(Function.java:292)
    at com.caucho.quercus.program.AbstractFunction.callMethod(AbstractFunction.java:309)
    at com.caucho.quercus.env.ObjectExtValue.callMethod(ObjectExtValue.java:602)
    at com.caucho.quercus.expr.MethodCallExpr.eval(MethodCallExpr.java:104)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.Function.callImpl(Function.java:352)
    at com.caucho.quercus.program.Function.call(Function.java:292)
// lots of lines removed
    at com.caucho.quercus.program.AbstractFunction.callMethod(AbstractFunction.java:309)
    at com.caucho.quercus.env.ObjectExtValue.callMethod(ObjectExtValue.java:602)
    at com.caucho.quercus.expr.MethodCallExpr.eval(MethodCallExpr.java:104)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.Function.callImpl(Function.java:352)
    at com.caucho.quercus.program.Function.call(Function.java:292)
    at com.caucho.quercus.program.AbstractFunction.callMethod(AbstractFunction.java:309)
    at com.caucho.quercus.env.ObjectExtValue.callMethod(ObjectExtValue.java:602)
    at com.caucho.quercus.expr.MethodCallExpr.eval(MethodCallExpr.java:104)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.Function.callImpl(Function.java:352)
    at com.caucho.quercus.program.Function.call(Function.java:292)
    at com.caucho.quercus.program.AbstractFunction.callMethod(AbstractFunction.java:309)
    at com.caucho.quercus.env.ObjectExtValue.callMethod(ObjectExtValue.java:602)
    at com.caucho.quercus.expr.MethodCallExpr.eval(MethodCallExpr.java:104)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:105)
    at .do_action(/usr/local/resin/webapps/ROOT/blog/wp-includes/plugin.php:337)

 

- Issue History
Date Modified Username Field Change
01-07-10 05:05 rajesh New Issue
01-07-10 05:05 rajesh File Added: screenshot.doc
01-07-10 05:05 rajesh Issue Monitored: rajesh
02-22-10 04:34 lamsap Note Added: 0004445
02-22-10 04:37 lamsap Note Edited: 0004445
02-23-10 11:17 lamsap Issue Monitored: lamsap


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