Scotty Allen Scotty Allen -4 years ago 246
ActionScript Question

Debugging a flash stack overflow

I have a swf that is being loaded by a third party swf. I have source code and recompile my swf, but don't have code to the third party swf.

Somewhere, likely in my code, there's a stack overflow. In a debug flash player, I get a nice popup dialog with a stack trace when the overflow occurs:

Error: Error #1023: Stack overflow occurred.
at Object$/Object::_hasOwnProperty()
at Object/
at Object$/Object::_hasOwnProperty()
at Object/
at Object$/Object::_hasOwnProperty()

It goes on like this for 64 lines. However, it looks like I'm only seeing the last 64 stack frames, not the whole stack trace.

Is there a way to see the full stack trace? As an alternative, is there a way to limit the stack depth?

I've spent a full day trying to debug this, but am running on very little information, and a lack of tools. Here's what I've tried:

  • Hooking my code up to a debugger. This is in flash 9.0.28 running in windows inside a VM, connecting to flex builder running outside the VM. It appears to connect, but I don't get trace statements, and breakpoints don't fire.

  • Sending log lines to an http server. This works, but I suspect I'm missing the last n stack frames before the overflow/server crash.

  • A blind, binary search type approach disabling portions of code - this is slow, but probably will work.

Any other strategies I should be trying?

Answer Source

Does this sounds like the same problem? Sorry as it's not directly an answer on how you could further debug this but more a pointer to someone who had a similar problem and found a solution.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download