在哪里可以找到从gpusGenerateCrashLog调用堆栈创建的日志?

时间:2016-06-07 11:22:24

标签: macos opengl driver gpu osx-elcapitan

在我的OpenGL渲染引擎中,当我按下一个开始发出一些新的OpenGL调用的键后,我正在崩溃1帧。

以下是崩溃的调用堆栈,它是一个CVDisplayLink线程。

0   libsystem_kernel.dylib          0x00007fff94d89f06 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff88d3e4ec pthread_kill + 90
2   libsystem_c.dylib               0x00007fff980246e7 abort + 129
3   libGPUSupportMercury.dylib      0x00007fff983a3e5c gpusGenerateCrashLog + 158
4   com.apple.driver.AppleIntelHD5000GraphicsGLDriver   0x000000010f750d4b gpusKillClientExt + 9
5   libGPUSupportMercury.dylib      0x00007fff983a5204 gpusSubmitDataBuffers + 162
6   com.apple.driver.AppleIntelHD5000GraphicsGLDriver   0x000000010f2ac3f2 IntelCommandBuffer::getNew(GLDContextRec*) + 48
7   com.apple.driver.AppleIntelHD5000GraphicsGLDriver   0x000000010f399849 intelSubmitCommands + 171
8   com.apple.driver.AppleIntelHD5000GraphicsGLDriver   0x000000010f3996c2 gldPresentFramebufferData + 142
9   GLEngine                        0x000000010f0ddc81 glSwap_Exec + 97
10  com.apple.GLEngineProfiler      0x000000010d759265 0x10d60b000 + 1368677
11  com.apple.opengl                0x00007fff8ed15ffe CGLFlushDrawable + 66
12  com.apple.AppKit                0x00007fff8846509f -[NSOpenGLContext flushBuffer] + 27
13  StarchipStudios.Marble          0x000000010a72c69c -[MarbleOpenGLView getFrameForTime:] + 172 (MarbleOpenGLView.mm:139)
14  StarchipStudios.Marble          0x000000010a72c337 displayLinkCallback(__CVDisplayLink*, CVTimeStamp const*, CVTimeStamp const*, unsigned long long, unsigned long long*, void*) + 55 (MarbleOpenGLView.mm:15)
15  com.apple.CoreVideo             0x00007fff92e183ba CVDisplayLink::performIO(CVTimeStamp*) + 258
16  com.apple.CoreVideo             0x00007fff92e17f45 CVDisplayLink::runIOThread() + 627
17  com.apple.CoreVideo             0x00007fff92e179a9 startIOThread(void*) + 147
18  libsystem_pthread.dylib         0x00007fff88d3b99d _pthread_body + 131
19  libsystem_pthread.dylib         0x00007fff88d3b91a _pthread_start + 168
20  libsystem_pthread.dylib         0x00007fff88d39351 thread_start + 13

在syslog中我也发现:

Jun 7 12:13:35 jamess-laptop kernel[0] <Notice>: The graphics driver has encountered internal error 0x0, 0xfffffffe.

看起来GPU驱动程序本身由于一些不正确的OpenGL调用而崩溃,但找到我错误地调用OpenGL的地方证明是困难的。我尝试使用OpenGL Profiler图形调试工具进行附加,但是在应用程序崩溃之前无法解决任何错误。

有没有人知道从图形驱动程序调用{​​{1}}(在上面的callstack中)生成的日志存储在哪里?也许这可能会给我一些关于它出错的线索?

1 个答案:

答案 0 :(得分:0)

崩溃报告(您在问题中引用了一部分)是morganBody(app, {stream: fs.createWriteStream('./logFileName.log', {flags: 'a'})}); 创建的崩溃报告。这样做是为崩溃报告的gpuGenerateCrashLog部分提供文本。

使用Hopper反汇编程序伪代码生成器,我们可以具体看到:

Application Specific Signatures:

因此,所产生的信息(int _gpusGenerateCrashLog(int arg0, int arg1, int arg2) { rdi = arg0; r14 = arg2; rbx = arg1; if (*0xc678 != 0x0) { rax = *___stack_chk_guard; if (rax != *___stack_chk_guard) { rax = __stack_chk_fail(); } } else { if (rdi != 0x0) { IOAccelDeviceGetName(*(rdi + 0x230), 0x0, 0x14); } if ((rbx & 0x20000000) == 0x0) { rdx = "Graphics kernel error: 0x%08x\n"; } else { rdx = "Graphics hardware encountered an error and was reset: 0x%08x\n"; } sprintf_l(var_A0, 0x0, rdx); *0xc680 = var_A0; rax = abort(); } return rax; } =“ string”)仅是单行代码,而不是大型的单独日志转储或报告。

Apple有一个网页,解释了如何获取各种情况下的日志。对于桌面图形,他们建议: https://download.developer.apple.com/OS_X/OS_X_Logs/Graphics_Diagnostic_Logging_Instructions.pdf

(假设您具有Apple开发者帐户登录名)

这为您提供了TimingSnoop程序。它获取系统的系统配置,而不是最近在其上运行的OpenGL命令。因此,除非您向Apple提出错误,否则这可能对您的特定问题没有太大帮助。

Apple确实提供了OpenGL分析器。我将首先看一下它是否提供了引发问题的线索。在以下位置提到: https://developer.apple.com/library/archive/technotes/tn2178/_index.html 并从Apple的下载页面(用于Xcode的附加工具)下载。 我试图使该工具正常工作,但在macOS 10.13.6上无法运行,因为它不会产生OpenGL配置文件跟踪(已在用于附加到进程的首选项中设置了密码)。因此,我希望其他人可以在此处提供其他帮助。