当我在 Wordpress 中运行插件的 js 脚本时。页面冻结、超时并返回 SIGILL 错误。我在 Web 开发工具中看不到任何错误,页面只是冻结。
我使用 cargo 安装了 minidump_stackwalk。
sudo apt install cargo
cargo install minidump-stackwalk
然后我在调试模式下运行 Chrome,
google-chrome --enable-logging --v=1
我通过 minidump_stackwalk 运行了崩溃报告来解释转储文件。它给了我 chrome 库堆栈跟踪,但没什么用。
minidump_stackwalk ~/.config/google-chrome/'Crash Reports'/07*.dmp
当我运行这个 bash 命令(在 Linux 上)时获得的 chrome 调试日志更有用。
tail -n 100 ~/.config/google-chrome/chrome_debug.log
这是我的 chrome 调试日志的输出。
[140960:1:0721/122133.762869:ERROR:v8_initializer.cc(688)] V8 javascript OOM: (Reached heap limit).
[133755:134289:0721/122133.997566:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x34740a187720
[133755:134289:0721/122133.997588:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x34740a186ca0
[133755:134289:0721/122133.997593:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x3474091aff00
[133755:134289:0721/122133.997597:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x347409b3e760
[133755:134289:0721/122133.997601:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x34740a186f40
[133755:134289:0721/122133.997605:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x347409b3e4c0
[133755:134289:0721/122133.997609:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x34740a186e60
[133755:134289:0721/122133.997613:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x3474078d6a00
[133755:134289:0721/122133.997617:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x34740a1865a0
[133755:134289:0721/122133.997621:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x34740a185f80
[133755:134289:0721/122133.997840:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x347409b3ee60
[133755:134289:0721/122133.997850:VERBOSE1:bus.cc(708)] Requested to remove an unknown filter function: 1 with associated data: 0x347409b3ebc0
[133755:133755:0721/122133.999826:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://staging.rebelcitytour.com/test-maps/, status = 3, exit_code = 132
JS 对象似乎出现分段错误或内存不足。可能是无限循环。
但问题是,我不知道该查看哪个 JS 对象。正如我所说,chrome web dev tools 和网页一起崩溃了。我得到的只是一个 SIGILL 错误和崩溃报告。
我尝试逐块调试代码,但行为似乎有点不稳定。有时它会在注释掉代码的情况下工作,有时则不行。我每次都清除了缓存。
有人可以帮忙吗?
答案1
假设是不是无限循环,尝试增加 JavaScript 堆大小以允许更深入的调试。另请参阅有关堆大小的 V8 文章, 和StackOverflow 中的这个。