OpenGLContext In macOS Mojave

opengl

#1

Hey all,

So it’s known Apple is deprecating OpenGL use starting in Mojave, but of course it can still be used in this OS version…

…however, we’ve gotten a crash report from someone on the Mojave public beta when they open our plugin that uses juce::OpenGLContext. In the backtrace he sent me the crash occurs when juce::OpenGLContext makes UI calls ([NSView frame]) on the background thread:

Main Thread Checker: UI API called on a background thread: -[NSView frame]
PID: 55046, TID: 6434937, Thread name: Pool, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   AVA-ME                              0x000000012a8ba0c6 _ZNK4juce19NSViewComponentPeer9getBoundsEb + 54
5   AVA-ME                              0x000000012a8b8eef _ZN4juce19NSViewComponentPeer13globalToLocalENS_5PointIfEE + 31
6   AVA-ME                              0x000000012a867cd1 _ZN4juce9Component16ComponentHelpers22convertFromParentSpaceINS_5PointIiEEEET_RKS0_S5_ + 577
7   AVA-ME                              0x000000012a8bdb72 _ZNK4juce9Component18getMouseXYRelativeEv + 130
8   AVA-ME                              0x000000012a757d78 _ZN8Harrison5Graph5paintERN4juce8GraphicsE + 3496
9   AVA-ME                              0x000000012a761c61 _ZN8Harrison12CurvePainter5paintERN4juce8GraphicsE + 81
10  AVA-ME                              0x000000012a88f550 _ZN4juce9Component25paintComponentAndChildrenERNS_8GraphicsE + 192
11  AVA-ME                              0x000000012a8de679 _ZN4juce13OpenGLContext11CachedImage11renderFrameEv + 1913
12  AVA-ME                              0x000000012a8dd56c _ZN4juce13OpenGLContext11CachedImage6runJobEv + 1340
13  AVA-ME                              0x000000012a8dd8ad _ZThn8_N4juce13OpenGLContext11CachedImage6runJobEv + 13
14  AVA-ME                              0x000000012a7af6ba _ZN4juce10ThreadPool16ThreadPoolThread3runEv + 682
15  AVA-ME                              0x000000012a7969c9 threadEntryProc + 713
16  libsystem_pthread.dylib             0x0000000114bbdfd9 _pthread_body + 126
17  libsystem_pthread.dylib             0x0000000114bbdf4b _pthread_start + 70
18  libsystem_pthread.dylib             0x0000000114bbaa7d thread_start + 13
2018-08-29 18:39:56.199650+0200 Logic Pro X Internal[55046:6434937] [reports] Main Thread Checker: UI API called on a background thread: -[NSView frame]
PID: 55046, TID: 6434937, Thread name: Pool, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   AVA-ME                              0x000000012a8ba0c6 _ZNK4juce19NSViewComponentPeer9getBoundsEb + 54
5   AVA-ME                              0x000000012a8b8eef _ZN4juce19NSViewComponentPeer13globalToLocalENS_5PointIfEE + 31
6   AVA-ME                              0x000000012a867cd1 _ZN4juce9Component16ComponentHelpers22convertFromParentSpaceINS_5PointIiEEEET_RKS0_S5_ + 577
7   AVA-ME                              0x000000012a8bdb72 _ZNK4juce9Component18getMouseXYRelativeEv + 130
8   AVA-ME                              0x000000012a757d78 _ZN8Harrison5Graph5paintERN4juce8GraphicsE + 3496
9   AVA-ME                              0x000000012a761c61 _ZN8Harrison12CurvePainter5paintERN4juce8GraphicsE + 81
10  AVA-ME                              0x000000012a88f550 _ZN4juce9Component25paintComponentAndChildrenERNS_8GraphicsE + 192
11  AVA-ME                              0x000000012a8de679 _ZN4juce13OpenGLContext11CachedImage11renderFrameEv + 1913
12  AVA-ME                              0x000000012a8dd56c _ZN4juce13OpenGLContext11CachedImage6runJobEv + 1340
13  AVA-ME                              0x000000012a8dd8ad _ZThn8_N4juce13OpenGLContext11CachedImage6runJobEv + 13
14  AVA-ME                              0x000000012a7af6ba _ZN4juce10ThreadPool16ThreadPoolThread3runEv + 682
15  AVA-ME                              0x000000012a7969c9 threadEntryProc + 713
16  libsystem_pthread.dylib             0x0000000114bbdfd9 _pthread_body + 126
17  libsystem_pthread.dylib             0x0000000114bbdf4b _pthread_start + 70
18  libsystem_pthread.dylib             0x0000000114bbaa7d thread_start + 13

Making those calls has always generated warnings, but it seems be an error starting with Mojave

Is anyone running the Mojave beta and can confirm this?


#2

This post can be disregarded, the reporter was an Apple dev I reported a Logic X bug to who emailed me again today:

“I just realized that it doesn’t really crash. Only the debugger stops when the ‘called on a background thread’ warning is shown. I just have to continue running…” :upside_down_face:


#3

That makes me wonder, do people share develop builds as public beta?
I can see the benefit in both, so you can chase asserts in the field as well, but I guess normally people would share release builds?

Sorry for hijacking…