# JUCE VST2 Results in crash in Tracktion Waveform 8 on MIDI input

**URL:** <https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026>\
**Category:** Audio Plugins\
**Created:** [July 31, 2020, 10:53pm UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026 "2020-07-31T22:53:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![zardini123](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zardini123](https://forum.juce.com/u/zardini123)\
**Post date:** [July 31, 2020, 10:53pm UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/1 "2020-07-31T22:53:16Z")

</div>

I’m working on a MIDI Effect VST. Currently it does not result in any crashes when loaded into Bitwig 8 Track and Ableton. When loaded in Waveform 8, the moment I give the plugin MIDI input, Waveform 8 crashes. Waveform 8 only provides crash information via its log file, which I show below.

To be able to load the VST into Ableton, I have the plugin have MIDI in/out, plus two unused channels of Audio out. Would this be the reason? I can’t tell because the crash log is cryptic to my eyes.

```
31 Jul 2020 18:38:16 Crashed
31 Jul 2020 18:38:16  

31 Jul 2020 18:38:16 Thread 0:
31 Jul 2020 18:38:16 ** Plugin crashed: Xen MIDI Retuner (VST)
31 Jul 2020 18:38:16 0: tracktion_VSTPlugin.cpp:applyToBuffer:854
31 Jul 2020 18:38:16 1: tracktion_WaveOutputDevice.cpp:fillNextAudioBlock:122
31 Jul 2020 18:38:16 2: tracktion_EditPlaybackContext.cpp:fillNextAudioBlock:587
31 Jul 2020 18:38:16 3: tracktion_DeviceManager.cpp:audioDeviceIOCallback:851
31 Jul 2020 18:38:16  
0 Waveform 8 (64-bit) 0x000000010c2d9c30 Waveform 8 (64-bit) + 7289904
1 Waveform 8 (64-bit) 0x000000010bc635c2 Waveform 8 (64-bit) + 513474
2 Waveform 8 (64-bit) 0x000000010c2d9d39 Waveform 8 (64-bit) + 7290169
3 libsystem_platform.dylib 0x00007fff5b9a2b5d _sigtramp + 29
4 ??? 0x0000000000000000 0x0 + 0
5 Xen MIDI Retuner 0x00000001196c5792 _ZN14JuceVSTWrapper24internalProcessReplacingIfEEvPPT_S3_iRNS_14VstTempBuffersIS1_EE + 1330
6 Xen MIDI Retuner 0x00000001196c5232 _ZN14JuceVSTWrapper16processReplacingEPPfS1_i + 146
7 Xen MIDI Retuner 0x00000001196b3143 _ZN14JuceVSTWrapper18processReplacingCBEPN4Vst27AEffectEPPfS4_i + 51
8 Waveform 8 (64-bit) 0x000000010c20f87c Waveform 8 (64-bit) + 6461564
9 Waveform 8 (64-bit) 0x000000010c71a1e5 Waveform 8 (64-bit) + 11747813
10 Waveform 8 (64-bit) 0x000000010c713f4c Waveform 8 (64-bit) + 11722572
11 Waveform 8 (64-bit) 0x000000010c70328b Waveform 8 (64-bit) + 11653771
12 Waveform 8 (64-bit) 0x000000010c7268cd Waveform 8 (64-bit) + 11798733
13 Waveform 8 (64-bit) 0x000000010c725ef0 Waveform 8 (64-bit) + 11796208
14 Waveform 8 (64-bit) 0x000000010c725ef0 Waveform 8 (64-bit) + 11796208
15 Waveform 8 (64-bit) 0x000000010c725ef0 Waveform 8 (64-bit) + 11796208
16 Waveform 8 (64-bit) 0x000000010c725ef0 Waveform 8 (64-bit) + 11796208
17 Waveform 8 (64-bit) 0x000000010c66359f Waveform 8 (64-bit) + 10999199
18 Waveform 8 (64-bit) 0x000000010c66328e Waveform 8 (64-bit) + 10998414
19 Waveform 8 (64-bit) 0x000000010c662b66 Waveform 8 (64-bit) + 10996582
20 Waveform 8 (64-bit) 0x000000010c655880 Waveform 8 (64-bit) + 10942592
21 Waveform 8 (64-bit) 0x000000010c1912b1 Waveform 8 (64-bit) + 5943985
22 Waveform 8 (64-bit) 0x000000010c18b2a6 Waveform 8 (64-bit) + 5919398
23 Waveform 8 (64-bit) 0x000000010c29b582 Waveform 8 (64-bit) + 7034242
24 libsystem_pthread.dylib 0x00007fff5b9ab2eb _pthread_body + 126
25 libsystem_pthread.dylib 0x00007fff5b9ae249 _pthread_start + 66
26 libsystem_pthread.dylib 0x00007fff5b9aa40d thread_start + 13

31 Jul 2020 18:38:16 Binary Images:
0x10bbe6000 Waveform 8 (64-bit)
0x7fff5b99e000 libsystem_platform.dylib
0x1196b0000 Xen MIDI Retuner
0x7fff5b9a8000 libsystem_pthread.dylib
```

---

<div class="post-metadata">

**Author:** ![DavidCNAntonia](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/davidcnantonia/32/3293_2.png) [@DavidCNAntonia](https://forum.juce.com/u/DavidCNAntonia)\
**Post date:** [August 1, 2020, 12:57am UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/2 "2020-08-01T00:57:59Z")

</div>

Try attaching a debugger, should give you more of an idea

---

<div class="post-metadata">

**Author:** ![zardini123](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zardini123](https://forum.juce.com/u/zardini123)\
**Post date:** [August 1, 2020, 3:03am UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/3 "2020-08-01T03:03:59Z")

</div>

Being that the plugin is being hosted by an application/daw that I did not program, is there really a way to attach a debugger to that application? The application has no code symbols attached so there is no straight forward way to know anything, but only through the crash log (unless there is another way?).

To reiterate, this crash only happens in Trackation Waveform 8.

---

<div class="post-metadata">

**Author:** ![DavidCNAntonia](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/davidcnantonia/32/3293_2.png) [@DavidCNAntonia](https://forum.juce.com/u/DavidCNAntonia)\
**Post date:** [August 1, 2020, 12:59pm UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/4 "2020-08-01T12:59:59Z")

</div>

> [@How to debug a plugin in Visual Studio (for a Mac guy)](https://forum.juce.com/t/how-to-debug-a-plugin-in-visual-studio-for-a-mac-guy/27444):
>
> Can anyone please help out a Mac guy? I’m trying to debug my VST/VST3 in Cubase in Visual Studio 2017. This is what I’ve done: In the Properties panel of my VST3 target, I make sure it’s in Debug mode In Debugging-\>Command -\> points to Cubase Debugging -\> Attach -\> Yes Start up Cubase with a blank document In VS, I set a break point in prepareToPlay() (it’s red) Press the green arrow “Local Windows Debugger” (breakpoint now white and says “Breakpoint will not currently be hit. …

I’m not a windows guy so linking instructions is about as far as I can get to help! It’s easy to do in Xcode (I always run into problems with FL Studio and nothing else) so I assume it’s possible in Visual Studio.

---

<div class="post-metadata">

**Author:** ![zardini123](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zardini123](https://forum.juce.com/u/zardini123)\
**Post date:** [August 1, 2020, 4:40pm UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/5 "2020-08-01T16:40:27Z")

</div>

Ahh, gotcha. Attaching Xcode to Waveform 8 gives me much information on the crash. Now it’s so much easier to debug in general! Thank you for teaching me this!

---

<div class="post-metadata">

**Author:** ![cesare](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@cesare](https://forum.juce.com/u/cesare)\
**Post date:** [August 1, 2020, 6:13pm UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/6 "2020-08-01T18:13:10Z")

</div>

Another thing you could do is try running it under pluginval and see if you get a sensible error

> **[Tracktion/pluginval](https://github.com/Tracktion/pluginval)**
>
> Cross platform plugin testing and validation tool. Contribute to Tracktion/pluginval development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [August 1, 2020, 8:54pm UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/7 "2020-08-01T20:54:02Z")

</div>

Does it crash in Waveform free? If so I can debug it from the waveform end if you are able to send me a copy of the plugin?

---

<div class="post-metadata">

**Author:** ![DavidCNAntonia](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/davidcnantonia/32/3293_2.png) [@DavidCNAntonia](https://forum.juce.com/u/DavidCNAntonia)\
**Post date:** [August 2, 2020, 12:10pm UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/8 "2020-08-02T12:10:08Z")

</div>

No problem, it really helps when each DAW behaves in its own special way!

---

<div class="post-metadata">

**Author:** ![zardini123](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zardini123](https://forum.juce.com/u/zardini123)\
**Post date:** [August 4, 2020, 7:07pm UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/9 "2020-08-04T19:07:14Z")

</div>

> [@RolandMR](#):
>
> Does it crash in Waveform free? If so I can debug it from the waveform end if you are able to send me a copy of the plugin?

Thats very kind of you for providing this offer! I have my plugin here: [Release v0.0.2 · zardini123/Xen-MIDI-Retuner · GitHub](https://github.com/zardini123/Xen-MIDI-Retuner/releases/tag/v0.0.2-alpha)

Though for some reason it’s not crashing anymore on my end and I think I know why. With some pointer variables, I was checking if they were _nullptr_ before doing some critical code. Though when those pointer variables are initialized, my guess is they are not initialized as nullptr, and instead more like pointing to random spots in memory as the space where the pointer was allocated had leftover memory in it. So it seems explicitly setting _nullptr_ fixed it. This is my guess at least 😛

---

<div class="post-metadata">

**Author:** ![zardini123](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zardini123](https://forum.juce.com/u/zardini123)\
**Post date:** [August 4, 2020, 7:07pm UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/10 "2020-08-04T19:07:45Z")

</div>

> [@cesare](#):
>
> Another thing you could do is try running it under pluginval and see if you get a sensible error

This is very cool! Will give a shot in the future! Thanks!

---

<div class="post-metadata">

**Author:** ![cesare](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@cesare](https://forum.juce.com/u/cesare)\
**Post date:** [August 5, 2020, 7:11am UTC](https://forum.juce.com/t/juce-vst2-results-in-crash-in-tracktion-waveform-8-on-midi-input/41026/11 "2020-08-05T07:11:44Z")

</div>

If you think you have a fix for the problem, regress it and see if the problem recurs. It’s really best to understand problems like this, otherwise it’ll bite you on the arse again at some point in the future at a more embarrassing time, normally when you are demoing to a potential customer, or showing it at a conference 🙂
