调试闪存堆栈溢出
我有一个正在由第三方 swf 加载的 swf。 我有源代码并重新编译我的 swf,但没有第三方 swf 的代码。
某个地方,可能在我的代码中,存在堆栈溢出。 在调试 Flash 播放器中,当溢出发生时,我会看到一个带有堆栈跟踪的漂亮弹出对话框:
Error: Error #1023: Stack overflow occurred.
at Object$/Object::_hasOwnProperty()
at Object/http://adobe.com/AS3/2006/builtin::hasOwnProperty()
at Object$/Object::_hasOwnProperty()
at Object/http://adobe.com/AS3/2006/builtin::hasOwnProperty()
at Object$/Object::_hasOwnProperty()
它像这样持续 64 行。 然而,看起来我只看到了最后 64 个堆栈帧,而不是整个堆栈跟踪。
有没有办法查看完整的堆栈跟踪? 作为替代方案,有没有办法限制堆栈深度?
我花了一整天的时间尝试调试这个,但运行的信息非常少,而且缺乏工具。 这是我尝试过的:
- 将我的代码连接到调试器。 这是在 VM 内的 Windows 中运行的 Flash 9.0.28 中,连接到在 VM 外部运行的 Flex 构建器。 它似乎已连接,但我没有收到跟踪语句,并且断点不会触发。
- 将日志行发送到 http 服务器。 这是可行的,但我怀疑我在溢出/服务器崩溃之前错过了最后 n 个堆栈帧。
- 盲目的二分搜索类型的方法禁用部分代码 - 这很慢,但可能会起作用。
我还应该尝试其他策略吗?
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/http://adobe.com/AS3/2006/builtin::hasOwnProperty()
at Object$/Object::_hasOwnProperty()
at Object/http://adobe.com/AS3/2006/builtin::hasOwnProperty()
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个 听起来是同样的问题吗? 抱歉,因为它不是直接回答如何进一步调试此问题,而是指向遇到类似问题并找到解决方案的人。
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.