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

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

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

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.

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.

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!

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

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?

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

Thats very kind of you for providing this offer! I have my plugin here: Release v0.0.2 · zardini123/Xen-MIDI-Retuner · GitHub

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 :stuck_out_tongue:

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

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 :slight_smile: