I have found similar infinite recursion problems anytime there is a
php notice thrown. I've been able to work around it by disabling the
debugger from handling phps error handling
I put

define("DISABLE_DEFAULT_ERROR_HANDLING", true);

temporarily in debugger.php until this is fixed but you could define
it anywhere that always gets called.

On Jan 23, 8:48 pm, jonknee <[EMAIL PROTECTED]> wrote:
> It is a bit odd. Unfortunately theDebuggerclass is new in 1.2 so
> there is nothing to look back on. I'm not familiar enough with the
> inner workings to fix it fully, but there is definitely some more work
> to be done in the class. As you mentioned, $recursion doesn't seem to
> be doing anything (one of my ideas was that it was missing from
> __object() which is why it never gets out of the loop, but then I saw
> $recursion is never checked anywhere).
>
> Anyway, I appreciate your help. If I figure it all out I'll post back
> and put a patch up.
>
> -Jon
>
> On Jan 23, 7:21 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > I haven't yet had the time to look into it in much detail so I'm
> > afraid I'm not much help. I think you are absolutely right though. I
> > also think it's odd that the $recursion variable that keeps getting
> > counted down whenever exportVar() is called (except when it is called
> > from __object()) and is never used.  $recursion seems to be
> > deincremented and that's it, it is never used for anything else.
> > Perhaps it was meant to break when $recursion reached some value but
> > the code was never implemented? I'll have to compare to 1.1's code and
> > see if I can make sense of what they are trying to do.
>
> > Dave
>
> > On Jan 23, 3:22 pm, jonknee <[EMAIL PROTECTED]> wrote:
>
> > > Great, thanks for the tip. This is almost certainly a bug since the
> > >debuggershould never get stuck in an infinite loop. If I take the
> > > __object() call out of the 'object' case, everything works fine (even
> > > with get_class() intact). I just wonder what the intended behavior is,
> > > the documentation isn't there.
>
> > > I did some digging and here's what I found:
>
> > > __object() is getting called infinitely from that object case, I added
> > > a counter and it counts as long as I let it. So here's what I think is
> > > going on,Debugger::exportVar() is called and when it gets to the
> > > object case it callsDebugger::__object().Debugger::__object()
> > > executes and in turn callsDebugger::exportVar(). Which calls
> > >Debugger::__object(), rinse and repeat.
>
> > > I'm not sure what the intended data is, so I can't write up a patch.
> > > Any ideas?
>
> > > On Jan 23, 4:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > actually, after re-reading my post I think you're seeing problems with
> > > > the same function that I am (the __object($var) function, not the
> > > > get_class() function as I stated above) try commenting out the same
> > > > lines of code from my earlier post:
>
> > > >                       //causes some sort of overflow
> > > >                         //case 'object':
> > > >                         //      return get_class($var) . "\n" . $_this-
>
> > > > >__object($var);
>
> > > > on line 364. It's the only place in thedebuggerthat __object($var)
> > > > is called so I bet it will fix it.
>
> > > > Dave
>
> > > > On Jan 23, 2:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > here is my previous 
> > > > > post:http://groups.google.com/group/cake-php/browse_thread/thread/48c6a57a...
>
> > > > > On Jan 23, 2:40 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > > > wrote:
>
> > > > > > I was having a similar problem with the cakedebuggerrunning out of
> > > > > > memory on an error (in this case it was an undefined variable in the
> > > > > > view). I just commented out the offending lines of code in 
> > > > > > /cake/libs/
> > > > > >debugger.php. The problem was a call to the get_class() function and
> > > > > > it looks like it's happening with you on line 414 as well. I'd try
> > > > > > commenting out the following:
>
> > > > > > //if(in_array($serialized, $history, true)) {
> > > > > > //       $value = ife(is_object($value), "*RECURSION* -> " .
> > > > > > get_class($value), "*RECURSION*");
> > > > > > //}
>
> > > > > > and see if it starts behaving.
>
> > > > > > Dave
>
> > > > > > On Jan 23, 1:54 pm, jonknee <[EMAIL PROTECTED]> wrote:
>
> > > > > > > I recently upgraded to v1.2 and have been playing around to get 
> > > > > > > Smarty
> > > > > > > working (which is how I was using Cake 1.1). It's going fine 
> > > > > > > except
> > > > > > > when I call a variable that doesn't exist... Smarty throws the
> > > > > > > 'Undefined index' error that should be no problem (and in most 
> > > > > > > cases
> > > > > > > not be seen), but Cake'sdebuggertakes over and gets stuck in a 
> > > > > > > loop.
> > > > > > > The httpd process takes 100% of the CPU and 30 seconds later I 
> > > > > > > see a
> > > > > > > message that the script was halted because the maximum execution 
> > > > > > > time
> > > > > > > was exceeded.
>
> > > > > > > > [error] PHP Fatal error:  Maximum execution time of 30 seconds 
> > > > > > > > exceeded in /Library/WebServer/cake/cake/libs/debugger.php on 
> > > > > > > > line 414
>
> > > > > > > Any ideas on how I could either see what the code is choking on 
> > > > > > > or how
> > > > > > > to let Smarty opt-out of the Cake error sequence?
>
> > > > > > > The compiled Smarty code that's causing this comes out looking 
> > > > > > > like:
>
> > > > > > > <?php echo $this->_tpl_vars['variable_name']; ?>
>
> > > > > > > If $this->_tpl_vars['variable_name'] isn't defined the whole thing
> > > > > > > goes into the endless loop and I have to kill the process or wait 
> > > > > > > it
> > > > > > > out.- Hide quoted text -
>
> > > - Show quoted text -

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to