Development

#5178 (Exception output stack can't display because of huge sf_route object in request)

You must first sign up to be able to contribute.

Ticket #5178 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

Exception output stack can't display because of huge sf_route object in request

Reported by: eXtreme Assigned to: fabien
Priority: major Milestone: 1.2.1
Component: other Version: 1.2.0
Keywords: Cc:
Qualification: Unreviewed

Description

I've got a major, huge issue with debugging. I'm using Admin Generator with Doctrine. It holds an object of sfDoctrineRoute under sf_route in attributeHolder in request. I don't know if this issue affects also other sfObjectRouter, because I'm using Doctrine. ;) What can I say is that this "sf_route" is really huuuge.

Now imagine an exception thrown by symfony. It goes to sfException::outputStackTrace which wants to display Request as an array. It converts attribute and parameter holders to array and sends to sfYaml::Dump. Yes, with this HUGE sf_route. Page can't display, php is out of memory or something, I don't know. I replaced sfYaml with var_dump and the page had about 44MB! It is becase there is this sfDoctrineRoute object. So, as I said, output stack doesn't display, there is nothing (blank page).

As a temporary solution I made this in sfDebug::flattenParameterHolder() in else on main if:

        if(is_object($value))
        {
          $values[$key] = new ReflectionObject($value);
        }
        else
        {
           $values[$key] = $value;
        }

It makes that now I can see output stack trace. It displays dump of request object with something like that:

attributeHolder:
  sf_route: !!php/object:O:16:"ReflectionObject":1:{s:4:"name";s:15:"sfDoctrineRoute";}

what else could it do? It doesnt solve the problem for real, because now this attribute becomes ReflectionObject? object. ;) What about situations with array containing huge objects? It will crash again...

Maybe it is an issue with sfYaml? As I said sf_route holds huge sfDoctrineRoute object (~44MB of var_dump) and it does not know how to convert it to yaml format? ;d

I hope I explained it well. I've lost 1 hour to understand how it happens. ;d This issue makes working with admin generator really hard, because I don't really know what happens with the script and where is the error in my code.

Change History

(follow-up: ↓ 2 ) 12/05/08 22:32:22 changed by FabianLange

  • milestone set to 1.2.1.

i think we had this issue with propel and resolved it, didnt we?

(in reply to: ↑ 1 ) 12/06/08 09:25:10 changed by eXtreme

Replying to FabianLange:

i think we had this issue with propel and resolved it, didnt we?

Well, I don't use propel and this issue isn't solved in doctrine (don't know about propel). ;) I'm using SVN /branch/1.2/, not "stable 1.2 release" so I've got all revisions and patches.

12/10/08 23:25:32 changed by FabianLange

found it: r9459 I think we can apply the same here?

12/10/08 23:43:28 changed by FabianLange

  • status changed from new to closed.
  • resolution set to fixed.

(In [13931]) [1.2] removing objects from the debug output to prevent crashing php with recursions very likely happening on especially routing objects. fixes #5178. refs #3477

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.