(0004445)
|
lamsap
|
02-22-10 04:34
|
|
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)
|
|