Juce-made 32-bit VST2 plugin GUIs have unusual behavior in Max 7 on Mac OS 10.12

Hey everyone, I’m still learning the ropes of Juce development, and searched the forums without any luck in finding an answer to my specific issue.

Any plugin I’ve tried to build as a VST2 plugin, including the GainPlugin Demo, will cause the GUI to be offset with no title bar, and will ultimately crash the host when I quit Max 7 (Max 6 as well). I’m focused on supporting universal builds on the Mac side, and have been running Max in 32-bit mode.

GainPluginOffsetGUI

I’ve tested older plugins that were built with older versions of Juce, as well as several other older plugins on the same host, without any issues.

I’m developing on Xcode 9.2, on MacOS 10.12.

See:

Rail

So in this particular case the host would be responsible for creating and managing the plugin window right? And even the GainPlugin demo example exhibits this behavior.

I responded to that same post before, but since then have found several older 32-bit plugins to work properly since then on Max 7.

The host creates the plug-in window.

Rail

Sorry this isn’t clear to me, according to this post:
How to use native-OS titlebar for plugin editor window

I don’t have any control over the title bar appearance or placement in a plugin correct? Sorry if I’m missing something.

Right… the Host (Max) creates the plug-in window… and loads the plug-in into it.

Rail

Yes, so if I can’t do anything about the title bar from the plugin perspective, how do I fix it? Or is there a bug in Juce causing this behavior?

Are you using the latest version of juce?

Yes, latest downloadable version from the website, 5.3.2.

OK, please make sure you’ve checked the tip of the develop branch before reporting bugs - I think Ed has been doing some window positioning stuff recently which could be related.

Does this only happen with 32-bit VST2s?

Thanks Jules, I’ll try that.

ed95, As far as I can tell yes, I only observe the behavior for 32-bit builds. 64-bit builds seem to work fine when I run Max in 64-bit mode.

Okay so I checked out the latest develop branch commit and built Juce. Tried building the GainPlugin demo again and I’m still observing the same behavior.

I tested on Max 7 32-bit and there was no crash, but I can only send open/wclose messages through Max to control the window.

So I recently tried making the GainPlugin example window resizable. I finding that when I load and resize the window manually, the GUI will snap back into the correct position within the window frame. This is based on building the project with the develop build of the projucer.

Hey guys,

Sorry for not providing more details, I’ve been on and off in revisiting this problem. I went ahead and tried building the GainPlugin example as a universal binary on another machine with Mac OS 10.13 and tested it in Max 7 running in 32-bit mode. I pulled the latest version of the develop branch of Juce as of this writing.

My test Max patch simply contains a vst~ object that loads the plugin and uses messages for opening, and closing the plugin window. Using the max messages to open/close the window prevents Max from crashing, but directly closing the plugin window using the title bar controls will make Max crash. I’m providing the crash log below:

Screenshot of window behavior:
VST%20Screenshot_06_24

Crash Log:

Process: Max [1795]
Path: /Applications/Max.app/Contents/MacOS/Max
Identifier: com.cycling74.Max
Version: 7.3.5 [be88c5a] (7.3.5)
Code Type: X86 (Native)
Parent Process: ??? [1]
Responsible: Max [1795]
User ID: 501

Date/Time: 2018-06-24 14:48:01.995 -0700
OS Version: Mac OS X 10.13.4 (17E202)
Report Version: 12

System Integrity Protection: enabled

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

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000000c0
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

VM Regions Near 0xc0:
–>
__TEXT 000000000007c000-0000000000813000 [ 7772K] r-x/rwx SM=COW Y [/Applications/Max.app/Contents/MacOS/Max]

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 com.cycling74.Max 0x0043a9ca juce::VSTPluginInstance::dispatch(int, int, int, void*, float) const + 20
1 com.cycling74.Max 0x0043d737 juce::VSTPluginWindow::InnerWrapperComponent::removeView(OpaqueControlRef*) + 143
2 com.cycling74.Max 0x00439efb juce::CarbonViewWrapperComponent::deleteWindow() + 39
3 com.cycling74.Max 0x0043db34 juce::VSTPluginWindow::InnerWrapperComponent::~InnerWrapperComponent() + 54
4 com.cycling74.Max 0x0043d667 juce::VSTPluginWindow::InnerWrapperComponent::~InnerWrapperComponent() + 19
5 com.cycling74.Max 0x0043dfda juce::VSTPluginWindow::~VSTPluginWindow() + 68
6 com.cycling74.Max 0x0043d30b juce::VSTPluginWindow::~VSTPluginWindow() + 19
7 com.cycling74.Max 0x003a2a22 PluginWindow::~PluginWindow() + 68
8 com.cycling74.Max 0x003a2873 PluginWindow::~PluginWindow() + 19
9 com.cycling74.Max 0x003a29d8 non-virtual thunk to PluginWindow::windowClosing() + 22
10 com.cycling74.Max 0x0043a5c6 -[VSTWindowDelegate windowWillClose:] + 20
11 com.apple.Foundation 0x952bc01c __66-[NSNotificationCenter _addObserver:selector:name:object:options:]_block_invoke + 32
12 com.apple.CoreFoundation 0x9378f812 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 18
13 com.apple.CoreFoundation 0x9378f6c1 _CFXRegistrationPost + 481
14 com.apple.CoreFoundation 0x9378f3b9 ___CFXNotificationPost_block_invoke + 201
15 com.apple.CoreFoundation 0x937500a3 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1555
16 com.apple.CoreFoundation 0x9374f037 _CFXNotificationPost + 631
17 com.apple.Foundation 0x951480e9 -[NSNotificationCenter postNotificationName:object:userInfo:] + 71
18 com.apple.Foundation 0x95153367 -[NSNotificationCenter postNotificationName:object:] + 37
19 com.apple.AppKit 0x91c1f3fe -[NSWindow _finishClosingWindow] + 179
20 com.apple.AppKit 0x915cf4db -[NSWindow _close] + 365
21 com.apple.AppKit 0x915cf368 -[NSWindow close] + 29
22 com.cycling74.Max 0x0043df0f juce::CarbonViewWrapperComponent::carbonEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*) + 247
23 com.cycling74.Max 0x0043de13 juce::CarbonViewWrapperComponent::carbonEventCallback(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 23
24 com.apple.HIToolbox 0x92da9736 _InvokeEventHandlerUPP(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*, long ()(OpaqueEventHandlerCallRef, OpaqueEventRef*, void*)) + 26
25 com.apple.HIToolbox 0x92d566f9 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1948
26 com.apple.HIToolbox 0x92d558ca SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 374
27 com.apple.HIToolbox 0x92d66b0f SendEventToEventTarget + 33
28 com.apple.HIToolbox 0x92e609c6 HIWindowButtonView::SendWindowEvent(unsigned long, unsigned long) + 158
29 com.apple.HIToolbox 0x92e60909 HIWindowButtonView::ControlHitSelf(OpaqueControlRef*, short, unsigned long) + 125
30 com.apple.HIToolbox 0x92d5f027 HIView::EventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 3491
31 com.apple.HIToolbox 0x92da9736 _InvokeEventHandlerUPP(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*, long ()(OpaqueEventHandlerCallRef, OpaqueEventRef*, void*)) + 26
32 com.apple.HIToolbox 0x92d566f9 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1948
33 com.apple.HIToolbox 0x92d558ca SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 374
34 com.apple.HIToolbox 0x92d66b0f SendEventToEventTarget + 33
35 com.apple.HIToolbox 0x92e1f791 SendControlHit(HIView*, OpaqueEventRef*, short, unsigned long) + 226
36 com.apple.HIToolbox 0x92e173da HIView::NotifyControlHit(OpaqueEventRef*, short, unsigned long) + 30
37 com.apple.HIToolbox 0x92e175ac HIView::ClickInternal(CGPoint const&, unsigned long, void ()(OpaqueControlRef, short), OpaqueEventRef*, bool) + 214
38 com.apple.HIToolbox 0x92e17775 HIView::ClickSelf(OpaqueEventRef*) + 327
39 com.apple.HIToolbox 0x92d5f421 HIView::EventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 4509
40 com.apple.HIToolbox 0x92da9736 _InvokeEventHandlerUPP(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*, long ()(OpaqueEventHandlerCallRef, OpaqueEventRef*, void*)) + 26
41 com.apple.HIToolbox 0x92d566f9 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1948
42 com.apple.HIToolbox 0x92d558ca SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 374
43 com.apple.HIToolbox 0x92d66b0f SendEventToEventTarget + 33
44 com.apple.HIToolbox 0x92dd1d63 HIView::Click(OpaqueEventRef*) + 249
45 com.apple.HIToolbox 0x92dd1c55 HIViewClick + 40
46 com.apple.HIToolbox 0x92eedf79 HandleClickAsHIView(OpaqueWindowPtr*, OpaqueEventRef*) + 137
47 com.apple.HIToolbox 0x92eeda8e HandleWindowClick(OpaqueWindowPtr*, Point, short, unsigned long, OpaqueEventRef*) + 430
48 com.apple.HIToolbox 0x92eedc8f HandleMouseEvent(OpaqueEventHandlerCallRef*, OpaqueEventRef*) + 458
49 com.apple.HIToolbox 0x92dca857 StandardWindowEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 84
50 com.apple.HIToolbox 0x92da9736 _InvokeEventHandlerUPP(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*, long ()(OpaqueEventHandlerCallRef, OpaqueEventRef*, void*)) + 26
51 com.apple.HIToolbox 0x92d566f9 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1948
52 com.apple.HIToolbox 0x92d558ca SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 374
53 com.apple.HIToolbox 0x92d66b0f SendEventToEventTarget + 33
54 com.apple.HIToolbox 0x92d8ba58 ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 1326
55 com.apple.HIToolbox 0x92d56b9c DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 3135
56 com.apple.HIToolbox 0x92d558ca SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 374
57 com.apple.HIToolbox 0x92d66b0f SendEventToEventTarget + 33
58 com.apple.AppKit 0x916d1dfc -[NSCarbonWindow sendEvent:] + 144
59 com.apple.AppKit 0x91aea2d1 -[NSApplication(NSEvent) sendEvent:] + 2657
60 com.cycling74.Max 0x003e4259 -[MaxCefApplication sendEvent:] + 130
61 com.apple.AppKit 0x9136eac8 -[NSApplication run] + 838
62 com.cycling74.Max 0x003e41a8 -[MaxCefApplication run] + 56
63 com.cycling74.chromium 0x00eafc6e 0xd83000 + 1231982
64 com.cycling74.chromium 0x00eaf54c 0xd83000 + 1230156
65 com.cycling74.chromium 0x00ef2fd2 0xd83000 + 1507282
66 com.cycling74.chromium 0x00f0dc7e 0xd83000 + 1617022
67 com.cycling74.chromium 0x00ef29ba 0xd83000 + 1505722
68 com.cycling74.chromium 0x00dfbade 0xd83000 + 494302
69 com.cycling74.Max 0x00536fe2 juce::MessageManager::runDispatchLoop() + 574
70 com.cycling74.Max 0x003fdb02 juce::JUCEApplication::main(juce::StringArray const&) + 62
71 com.cycling74.Max 0x003fdc19 juce::JUCEApplication::main(int, char const**) + 73
72 com.cycling74.Max 0x00083a35 start + 53