简体   繁体   English

崩溃后从 Safari 记录 JavaScript 错误

[英]Logging JavaScript errors from Safari after crash

I'm trying to track down an issue with a site that's causing repeated segfaults and crashes for Safari 8.0.7 and Yosemite 10.10.4.我正在尝试查找导致 Safari 8.0.7 和 Yosemite 10.10.4 重复段错误和崩溃的站点的问题。 So far all we've managed to glean from the crash reports is that it's JavaScript related, but we haven't been able to track it down any further.到目前为止,我们设法从崩溃报告中收集到的是它与 JavaScript 相关,但我们无法进一步追踪它。

I was hoping to find something useful in examining the console output from the developer tools, but since that pane goes down when the browser does it's not terribly helpful.我希望找到一些有用的东西来检查开发人员工具的控制台输出,但是由于该窗格在浏览器关闭时关闭,所以它并不是很有帮助。 Does anyone know if there's a way to pipe the JavaScript console logs from a safari session to a text file that I can look at after the crash?有谁知道是否有办法将 JavaScript 控制台日志从 safari 会话传输到崩溃后我可以查看的文本文件?

EDIT So all I've gotten from the crash report (from console) is this truncated info编辑所以我从崩溃报告(来自控制台)中得到的只是这个被截断的信息

Process:               com.apple.WebKit.WebContent [54411]
Path:                      /System/Library/StagedFrameworks/Safari/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
Identifier:            com.apple.WebKit.WebContent
Version:               10600 (10600.6.3)
Build Info:            WebKit2-7600006003000000~2
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Safari [54397]
User ID:               502

Date/Time:             2015-07-28 14:30:14.094 -0700
OS Version:            Mac OS X 10.10.3 (14D136)
Report Version:        11
Anonymous UUID:        03F3B4F1-21D9-9B59-DB95-0CA2A9029887

Sleep/Wake UUID:       7638EA85-16D2-4E75-9913-0ACFA88EDAE8

Time Awake Since Boot: 540000 seconds
Time Since Wake:       19000 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x000000000000000e

VM Regions Near 0xe:
--> 
    __TEXT                 0000000103423000-0000000103424000 [    4K]   r-x/rwx SM=COW     /System/Library/StagedFrameworks/Safari/WebKit.framework/Versions/A/XPCServ ices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebCon tent

... ...

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore        0x0000000103fbab54   operationConvertJSValueToBoolean + 180
1   ???                             0x00005de77c8d56ab 0 + 103248808466091
2   ???                             0x00005de77c9753e1 0 + 103248809120737
3   ???                             0x00005de77c998a27 0 + 103248809265703
4   ???                             0x00005de77c601a3a 0 + 103248805501498
5   ???                             0x00005de77c6bb05a 0 + 103248806260826
6   ???                             0x00005de77c634e35 0 + 103248805711413
7   ???                             0x00005de77c75c760 0 + 103248806922080
8   ???                             0x00005de77c6a9dfa 0 + 103248806190586
9   ???                             0x00005de77c65eace 0 + 103248805882574
10  ???                             0x00005de77c601a3a 0 + 103248805501498
11  com.apple.JavaScriptCore        0x00000001040314a1 callToJavaScript + 311
12  com.apple.JavaScriptCore        0x0000000103fb55f3 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 35

Any thoughts on how to dig into this further would also be greatly appreciated.任何关于如何进一步深入研究的想法也将不胜感激。

If you are on a Mac, go to Applications > Utilities > Console and then choose the right log on the left sidebar.如果您使用的是 Mac,请转至应用程序 > 实用工具 > 控制台,然后在左侧边栏中选择正确的日志。 You'll be able to see there what's going on there.你将能够看到那里发生了什么。

If you know where to look on your code you can set up some breakpoints with the developer tools.如果您知道在哪里查看代码,则可以使用开发人员工具设置一些断点。 If you want something more automated you can track JS errors with trackjs You may need to add some extra lines of code but it keeps an error log (client information like browser version, OS and function (loc) that originates the error).如果您想要更自动化的东西,您可以使用trackjs跟踪 JS 错误您可能需要添加一些额外的代码行,但它会保留错误日志(客户端信息,如浏览器版本、操作系统和引发错误的功能 (loc))。 Also look the Console on your Mac.另请查看 Mac 上的控制台。

Have you tried to replicate the crash on more than one Mac?您是否尝试在不止一台 Mac 上复制崩溃?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM