# AU Plugin Install Working for Ableton but Not Logic Pro X

**URL:** <https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211>\
**Category:** General JUCE discussion\
**Created:** [September 15, 2017, 7:22pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211 "2017-09-15T19:22:53Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 15, 2017, 7:22pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/1 "2017-09-15T19:22:53Z")

</div>

Hi, I am working on building an installer for my plugin and am running into a strange issue where the AU version shows up and works in Ableton but does not show up in Logic Pro X. I am installing to the path:

/Library/Audio/Plug-Ins/Components/myplugin.component

And also have a copy in my local plugins folder from the JUCE build:

/Users//Library/Audio/Plug-Ins/Components/myplugin.component

Both of these versions actually show up and work in Ableton, but neither shows up in Logic. I have tried

Any idea what might be causing this?

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [September 15, 2017, 9:28pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/2 "2017-09-15T21:28:33Z")

</div>

First thing to say is that in most hosts the one in the user library will be the ONLY one seen by them. The best thing to do to debug is to run auval.

From terminal I would run `auval -a`, does your plugin show up? (remember this will likely be the one in the user library ONLY)

If your plugin shows up you should see it in the list for example…  
`aufx bpas appl - Apple: AUBandpass`

If you take the first three 4 character codes you can use those in auval to test your plugin. For example to test the above plugin you would run…

`auval -v aufx bpas appl`

Hopefully this will highlight an issue. If you need further info you can debug with auval in Xcode quite easily.

- Select the **MyPlugin - AU** scheme
- Select **Edit Scheme…**
- Select **Run** on the left
- Select the **Info** tab at the top
- In the **Executable** drop down menu select **Other…**
- Hit **Shift + Command + G** on your keyboard and type **/usr/bin/auvaltool**
- **Enter** and select **Choose** (before you can run this executable from Xcode, you might need to move this executable to another location such as **/usr/local/bin** or [**disable integrity protection**](https://www.imore.com/el-capitan-system-integrity-protection-helps-keep-malware-away))
- Back in the edit scheme page now, select the **Arguments** tab at the top
- Add an argument such as **-v aufx bpas appl** (use the values you retrieved from running `auval -a`), you can add all these as one argument exactly like this.

Now when you build and run the AU scheme it will launch auval and run tests on your plugin - of which you can debug through.

Hopefully that helps.

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 16, 2017, 11:01pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/3 "2017-09-16T23:01:03Z")

</div>

Okay, I realized that something weird is happening where the plugin crashes the aufx validation when opening logic for the first time, but when I rescan for plugins it passes. This also happens with auval test in the command-line. When I use auval -v to run a test on my plugin via the command line, it fails the first time and then passes when I run the test again. This is a weirdly consistent pattern. Here is the error I get from when my plugin fails, failure happens due to a malloc error in the 1 channel render test:

> 1 Channel Test:  
> Render Test at 512 frames  
> PASS  
> auvaltool(6011,0x7fff7a7f5000) malloc: \*\*\* error for object 0x7fdfcc814808: incorrect checksum for freed object - object was probably modified after being freed.  
> \*\*\* set a breakpoint in malloc\_error\_break to debug  
> /usr/bin/auval: line 11: 6011 Abort trap: 6 arch -x86\_64 /usr/bin/auvaltool “$@”

Does this point to anything specific? Is there something I am doing incorrectly in terms of memory management or freeing resources that might be causing this? Also is there any way to get a more specific description of the object causing the error?

My plugin runs with no issues in Ableton, I’ve been testing it there for a while and have never had a crash.

Thanks!

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [September 17, 2017, 8:51am UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/4 "2017-09-17T08:51:42Z")

</div>

So as the message suggests you need to set a breakpoint in Xcode, for this you will need to use a **symbolic breakpoint**. To set this in Xcode go to **View \>\> Navigators \>\> Show Breakpoint Navigator**. You should see the left pane change to show you all of your breakpoints (of which there might be none). At the very bottom left of the pane is a “+” symbol, click it to reveal a menu suggesting different types of breakpoints that can be added. Select **Symbolic Breakpoint…** , in the window that appears, enter **malloc\_error\_break** for **symbol** and hit enter, click away from the window to dismiss it and start debugging.

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 17, 2017, 11:21pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/5 "2017-09-17T23:21:02Z")

</div>

Okay, I added a symbolic breakpoint as you suggested, but when I run in the plugin host I don’t get any errors. When the auval test fails I get:

auvaltool(2374,0x7fff76f54000) malloc: \*\*\* error for object 0x7fe653002a08: incorrect checksum for freed object - object was probably modified after being freed.  
\*\*\* set a breakpoint in malloc\_error\_break to debug

Which is weird because I did set a malloc\_error\_break to debug and it didn’t catch anything when I ran it in the JUCE plugin host.

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 17, 2017, 11:25pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/6 "2017-09-17T23:25:42Z")

</div>

I am catching a leaked object error for some AudioBuffer objects when the plugin passes the auval test:

> \*\*\* Leaked objects detected: 66 instance(s) of class AudioBuffer  
> JUCE Assertion failure in juce\_LeakedObjectDetector.h:97

The plugin is a reverb with several allpass filters built in, so there are a lot of AudioBuffers being used(not 66 though, so this seems weird). I have several classes in my project that contain an audio buffer (I only use AudioBuffers as a member of a class) declared as follows:

> class myClass{  
> public  
> myClass(){  
> myBuffer.setSize(1, MYSIZE);  
> }  
> …  
> private:  
> AudioBuffer myBuffer;  
> …  
> }

Is there some other way I should be declaring these, or freeing them in the class destructor? I am now realizing this is probably pretty bad practice in terms of resource management, but I never noticed it until now since it wasn’t causing any issues.

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [September 18, 2017, 12:13am UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/7 "2017-09-18T00:13:02Z")

</div>

In each of the classes using an AudioBuffer try adding the macro **JUCE\_DECLARE\_NON\_COPYABLE\_WITH\_LEAK\_DETECTOR(MyClass)**, that might highlight which class is actually the culprit, you’re probably leaking a class containing an AudioBuffer.

You say you’re not hitting the breakpoint when debugging with the JUCE plugin host, but have you attached to auval as suggested earlier on? auval will be doing a lot more than the JUCE host due to the tests it runs on the plugin.

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 18, 2017, 2:28am UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/8 "2017-09-18T02:28:07Z")

</div>

> but have you attached to auval as suggested earlier on?

What do you mean by attached to auval? I have tried adding a symbolic breakpoint as you suggested, but this does not seem to have any effect on auval’s operation. The auval error suggests adding a symbolic breakpoint, but how do I make this breakpoint catch an error which happens during the auval test?

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 18, 2017, 2:39am UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/9 "2017-09-18T02:39:27Z")

</div>

For now I will try fixing the memory leak issues and see if that helps. When I run in the JUCE plugin host and quit by closing the plugin host window (not the stop button in Xcode), I get the same type of error:

> \*\*\* Leaked objects detected: 33 instance(s) of class AudioBuffer

It makes sense that there would be 33 leaked objects since I have 8 instances of a double nested allpass filter class (3 buffers each) and 8 instances of an interpolated delay line class (1 buffer each), for a total of 32 buffer, +1, which is that being passed to process block, for 33. (66 for the auval test was because it tested twice at different buffer sizes). As of right now I don’t think I am freeing any of these resources correctly. Yikes!

I declare arrays of pointers to these classes in my AudioProcessor and then fill them with instances of the class in the AudioProcessor constructor as follows:

> delayLine[0] = new delayLine(params…)

I feel like I need to add something to the destructor either for AudioProcessor or for the classes that use AudioBuffer in order to free the buffer instances, because right now both are empty. How do I free them correctly?

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 18, 2017, 3:48am UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/10 "2017-09-18T03:48:18Z")

</div>

Okay, I figured out a way to prevent the leaks, though I am not sure if it is best practice so I’d still appreciate advice on the topic.

I am now declaring the AudioSampleBuffer pointers in my classes and instantiating instances using “new AudioSampleBuffer();” in the class constructor. I am then calling the destructor for the AudioSampleBuffer instances in the class destructor. Then in my Audio Processor I do the following:

> myAudioProcessor::~myAudioProcessor()  
> {  
> for(int i = 0; i \< 8; i++){  
> dnap[i]-\>~DoubleNestedAllpass();  
> line[i]-\>~InterpolatedDelayLine();  
> }  
> }

Is it necessary to call the destructors for all class instances being used in a class in this way, and is this the best way to handle things?

I updated my project to do this everywhere that I am using a Pointer to a class instance, and I am no longer getting any leaks detected. Still occasionally failing the auval test however, so I think something else is causing that.

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [September 18, 2017, 6:48am UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/11 "2017-09-18T06:48:34Z")

</div>

What I mean is have you set auvaltool (auval is just a script that calls auvaltool) as the executable in Xcode?

If you look at my earlier post I said:

> If you need further info you can debug with auval in Xcode quite easily.
> 
> - Select the MyPlugin - AU scheme
> - Select Edit Scheme…
> - Select Run on the left
> - Select the Info tab at the top
> - In the Executable drop down menu select Other…
> - Hit Shift + Command + G on your keyboard and type /usr/bin/auvaltool
> - Enter and select Choose (before you can run this executable from Xcode, you might need to move this executable to another location such as /usr/local/bin or disable integrity protection)
> - Back in the edit scheme page now, select the Arguments tab at the top
> - Add an argument such as -v aufx bpas appl (use the values you retrieved from running auval -a), you can add all these as one argument exactly like this.
> 
> Now when you build and run the AU scheme it will launch auval and run tests on your plugin - of which you can debug through.

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [September 18, 2017, 6:50am UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/12 "2017-09-18T06:50:13Z")

</div>

Maybe an [OwnedArray](https://www.juce.com/doc/classOwnedArray) might be a good option here?

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [September 18, 2017, 6:52am UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/13 "2017-09-18T06:52:58Z")

</div>

For every call to new, you will need to have a corresponding call to delete, but it’s best practice to avoid having to call new/delete, so use smart pointers and containers such as [ScopedPointer](https://www.juce.com/doc/classScopedPointer), [OwnedArray](https://www.juce.com/doc/classOwnedArray)

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 18, 2017, 4:12pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/14 "2017-09-18T16:12:52Z")

</div>

Okay, when I run a debug build of my AU using auvaltool as the executable (did indeed have to copy auvaltool to usr/local/bin) it passes every time, but I get a ton of leaked objects detected.

I’ve tried calling the destructor for all these objects, as well as delete for each object (I’ve tried using each one separately as well as both together), in the destructor for my AudioProcessor like so (I realized this is not best practice, but I want to understand why this does not work):

> ~myAudioProcessor(){  
> myClassPtr-\>~myClass();  
> delete myClassPtr;  
> …  
> }

Since I do this for all the class pointers I am using it seems strange to me that only some of the objects leak. If this method is failing to properly release resources why wouldn’t everything be leaking?

Longterm I am going to replace things with ScopedPointers and OwnedArrays, because that seems to be much cleaner, but I’d like to understand what is going on here if possible.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [September 18, 2017, 4:15pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/15 "2017-09-18T16:15:28Z")

</div>

You need to do some reading on how C++ object management works, but the TL;DR is that you must **never** call those ~ destructor functions manually! It’s a feature that’s only there for experts who really understand what they’re doing!

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 18, 2017, 4:35pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/16 "2017-09-18T16:35:43Z")

</div>

Yes, I will definitely be doing some research.

But why doesn’t calling delete for the class pointers in the AudioProcessor destructor release these resources? Is the destructor for myAudioProcessor not getting called at some point?

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 19, 2017, 5:15am UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/17 "2017-09-19T05:15:58Z")

</div>

Okay, I think I figured out why the plugin passes the auval test in Xcode but not in the terminal, and it has to do with an issue highlighting in another [thread](https://forum.juce.com/t/plugin-located-in-folder-with-company-name-via-installer/24196/14) I started, where two different version numbers of the plugin are being recognized by Logic. The current version (version number 0 for development) always passes the auval test and is always recognized by Logic. The old version (version 1.0.0, from before I modified the version number) of the plugin fails the test.

When I open Logic’s plugin manager I the current version always shows up as successfully validated, while the old version shows up as having failed validation. I have tried resetting the AudioUnit Cache on my computer several times and rescanning for plugins and this is always the result.

Therefore, when I run auval from the command line I think it does not always pick the correct version of the plugin (but sometimes picks the old version which is somehow stuck in Logic’s memory), and so sometimes fails. When it runs in Xcode it knows exactly which executable to use and therefore always passes.

Very strange issue. Thanks all for sticking with me and helping me figure this out. Hopefully I can find a solution for the multiple versions of the plugin being found by Logic, but I don’t believe this will be an issue for other users, so at least some progress was made.

---

<div class="post-metadata">

**Author:** ![thegrinch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thegrinch/32/1790_2.png) [@thegrinch](https://forum.juce.com/u/thegrinch)\
**Post date:** [September 19, 2017, 5:48pm UTC](https://forum.juce.com/t/au-plugin-install-working-for-ableton-but-not-logic-pro-x/24211/18 "2017-09-19T17:48:23Z")

</div>

Okay so apparently that does not fix things, I tried installing on a friends computer which had never before had any version of the plugin installed, and two version numbers are still recognized.

This issue has moved somewhat outside of the scope of this thread so I have made a new topic here: [Two AudioUnit Version Numbers Recognized by DAW](https://forum.juce.com/t/two-audiounit-version-numbers-recognized-by-daw/24264)
