I am working on a site built using Kohana 3.2.0.
It basically works fine. But occasionally, after I entered the site, remain idle for a while and then refresh the browser, one of the following errors will appear.
(1)
Maximum function nesting level of '100' reached, aborting
(2)
ErrorException [ 8 ]: Undefined property: Model_User::$id ~ APPPATH/views/en/template/topnav.php
The interesting thing is that, when these errors appear, the site will automatically comes back to normal after a while and refresh the browser again.
Hence I believe the errors are not due to the application code's problem.
Anyone has a hint? Thanks in advance.
[Kohana] Exceptions after idle for a while
Moderator: General Moderators
Re: [Kohana] Exceptions after idle for a while
Install xdebug (http://xdebug.org/docs/install), it will give you stack traces for fatal errors (like these: http://xdebug.org/docs/stack_trace). Looking at stack traces you'll get the idea what gets executed that deeply (my guess is unbounded recursion).
Re: [Kohana] Exceptions after idle for a while
I have installed xdebug.
I try to catch the 'Maximum function nesting level' error and output the stack trace, but I cannot catch the error or exception.
The way I test it is like:
When I load the page, the browser just shows a blank page. I tried to log to file in the handlers, but seems none of them is called.
I try to catch the 'Maximum function nesting level' error and output the stack trace, but I cannot catch the error or exception.
The way I test it is like:
Code: Select all
function my_error_handler() { ... } set_error_handler( 'my_error_handler' );
function my_exception_handler() { ... } set_exception_handler( 'my_exception_handler' );
function my_fatal_handler() { ... } register_shutdown_function( 'my_fatal_handler' );
// try infinite recursion
function xxx($i) { xxx($i) }
xxx(1);
Re: [Kohana] Exceptions after idle for a while
With xdebug you don't need to do anything fancy (like setting handlers). It displays stack traces by default. Just make sure you do not suppress the logging (error_reporting && display_errors)