Where can I find the log created from a gpusGenerateCrashLog callstack?

10

In my OpenGL rendering engine I'm currently crashing 1 frame after I press a key that starts issuing some new OpenGL calls.

The following is the crashed call stack, which is a CVDisplayLink thread.

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

In syslog I also found:

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

It looks like the GPU driver itself is crashing due to some incorrect OpenGL calls, but finding where I'm calling OpenGL incorrectly is proving difficult. I've tried attaching using the OpenGL Profiler graphics debugging tool but this fails to break on any errors before the application crashes.

Does anyone know where the log generated from the graphics driver call gpusGenerateCrashLog (in the callstack above) is stored? Perhaps this may give me some clues as to where its going wrong?

macos
opengl
driver
gpu
osx-elcapitan
asked on Stack Overflow Jun 7, 2016 by James Bedford • edited Oct 5, 2017 by James Bedford

1 Answer

1

The Crash Report (part of which you quote in your question) is the Crash Report that gpuGenerateCrashLog creates. What is does is to contribute text for the Application Specific Signatures: section of the crash report.

Using the Hopper disassembler pseudo-code generator we can see specifically:

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;
}

So the information produced (rdx = "string") is just a one-liner, not a large separate log dump, or report.

Apple have a web page which explains how to obtain logs for a variety of scenarios. For desktop graphics, they suggest: https://download.developer.apple.com/OS_X/OS_X_Logs/Graphics_Diagnostic_Logging_Instructions.pdf

(assuming you have a apple developer account login)

This gives you the TimingSnoop program. It gets the system configuration of your system rather than the OpenGL commands recently run on it. So it may not help much in your particular problem unless you raise a bug with Apple.

Apple do provide a OpenGL profiler. I would look at this first to see if it gives clues as to what triggered the problem. It is mentioned at: https://developer.apple.com/library/archive/technotes/tn2178/_index.html and downloaded from Apple's download page (Additional Tools for Xcode). I tried to get this tool to work but was unable on macOS 10.13.6 as it would not produce a OpenGL profile trace (having set the password in preferences for attaching to processes). So I hope other people can provide additional help here.

answered on Stack Overflow Aug 19, 2018 by Faisal Memon • edited Aug 19, 2018 by Faisal Memon

User contributions licensed under CC BY-SA 3.0