PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Jul 20, 2019 3:50 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Feb 12, 2014 11:00 am 
Offline
Forum Newbie

Joined: Wed Feb 12, 2014 10:30 am
Posts: 2
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.


Top
 Profile  
 
PostPosted: Wed Feb 12, 2014 11:31 am 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine
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).


Top
 Profile  
 
PostPosted: Mon Feb 17, 2014 11:17 pm 
Offline
Forum Newbie

Joined: Wed Feb 12, 2014 10:30 am
Posts: 2
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:
Syntax: [ Download ] [ Hide ]
   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);
 


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.


Top
 Profile  
 
PostPosted: Tue Feb 18, 2014 3:38 am 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine
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)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group