OpenGL Profiler is crash

Originator:mayoff
Number:rdar://32663848 Date Originated:08-Jun-2017 06:06 PM
Status:CLOSED Resolved:
Product:Developer Tools Product Version:Version 9.0 beta (9M136h) / 10.13 Beta (17A264c)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
My app crashes when I attach to it with OpenGL Profiler. If I tell OpenGL Profiler to launch my app, it launches the app but never finishes attaching.

Here’s the stack trace of my test app’s crash when I attach:

OGL Profiler (8)
#0	0x000000010896516b in ___lldb_unnamed_symbol1356$$GLProfilerFBDisp ()
#1	0x0000000108965060 in ___lldb_unnamed_symbol1355$$GLProfilerFBDisp ()
#2	0x0000000108a85242 in ___lldb_unnamed_symbol4046$$GLProfilerFBDisp ()
#3	0x000000010892fd80 in gloTerminateLibrary ()
#4	0x00007fffc3035873 in ___lldb_unnamed_symbol11$$OpenGL ()
#5	0x00007fffc3035761 in ___lldb_unnamed_symbol9$$OpenGL ()
#6	0x00007fffc3035d37 in glcDebugListener ()
#7	0x0000000100ede83a in _pthread_body ()
#8	0x0000000100ede71c in _pthread_start ()
#9	0x0000000100edde19 in thread_start ()

There’s also this message in the lldb console:

gloInitializeLibrary: mach_msg_overwrite(kGLOMessageInitialize) (ipc/send) invalid msg-type

And this is the error message overlay in the editor pane:

OGL Profiler (8): EXC_BAD_ACCESS (code=1, address=0xa0)


Steps to Reproduce:
1. Build and run the attached sample project.
2. Launch OpenGL Profiler.
3. Attach to openglProfilerBug with the OpenGL Profiler.


Expected Results:
help debugging my app

Actual Results:
filing a radar about the OpenGL Profiler making my app crash

Version:
Version 9.0 beta (9M136h) / 10.13 Beta (17A264c)

Notes:

Comments

Apple Developer Relations Aug 22 2017 Please verify this issue with the Xcode 9 beta and update your bug report at https://bugreport.apple.com/ with your results.

Xcode 9 beta 6 (9M214v) https://developer.apple.com/download/ Posted Date: Aug 21st, 2017

Apple Developer Relations Jul 13 2017 Thanks, we are working on the new information you provided. We appreciate your help!

Rob Mayoff Jul 13 2017 I'm not 100% sure your last update was intended for me. I suspect it was intended for an Apple developer. But I'll do my best.

Regarding glcValidateSender and glcIsEntitlementEnabledForProcessWithAuditToken, those are Apple private API that I'm not calling, so I don't have anything to say about them. SecTaskCopyValueForEntitlement is public but I'm not calling that either.

I discussed this problem with Chris Niederauer at WWDC 2017 and we discovered that you can reproduce the problem using Chess.app. Here are the steps:

  1. Launch Chess.app.
  2. Attach to the running Chess.app with OpenGL Profiler.
  3. Chess.app immediately crashes.

I've attached a crash report from Chess.app.

Do you need anything else from me? I'm not sure I can provide any more details.

Apple Developer Relations Jul 13 2017 Could you provide more details on the failure? Specifically, it looks like the glcValidateSender() function is failing, but that could fail for several reasons. One of those reasons is that glcIsEntitlementEnabledForProcessWithAuditToken() fails which ultimately could mean that SecTaskCopyValueForEntitlement() is failing.

We would need to know exactly what part of this code is failing before diagnosing.

Please provide your response or results by updating your bug report. If uploading files, please compress first.

Rob Mayoff Jun 9 2017 The OpenGL Profiler that is included in Additional Tools for Xcode 9 beta 1 works (doesn't crash my app) in macOS 10.12.5 but still fails (crashes my app) in macOS 10.13 beta 1.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!