SDK 3.6.12: AGain plugin crashes Tracktion Waveform 9 (and others)

VSTSDK 3.6.12 (and 3.6.10)
VSTGUI4 4.7 (and 4.6)
DAWS: Tracktion Waveform 9 (and VSTHost and Mixcraft 8 Pro Studio x64)
OS: Win 8.1 (not tested on Win10)
Compiler: VS 2017 Community (SDK 3.6.12) and VS 2015 Community (SDK 3.6.10)
all x64

This issue was reported by a SW user with VSTSDK 3.6.10, but I have confirmed this is still an issue in 3.6.12. The AGain plugins were compiled directly from the SDK with no modifications.

The AGain sample plugin crashes Tracktion Waveform 9.3.2 (latest version) when you move the gain slider around rapidly. Smoother movements of the slider will eventually cause a crash, but it happens more quickly with rapid motion. I confirmed this myself with AGain/3.6.12 after a software user reported it; that user also reports that AGain crashes in the same manner in VSTHost and Mixcraft 8 Pro Studio x64 though I have not confirmed that personally.

For Tracktion Waveform 9, the crash may occur almost immediately after moving the slider, or it may take several seconds (~10-20 secs) but eventually it will crash.

The crash is related to the CVuMeter object update at the end of the process( ) method, and the CFrame::CollectInvalidRects related methods. It is unclear if this is truly a VST3 SDK or a VSTGUI4 problem.

The crash can be prevented in two ways:

  1. remove the line of code that calls addPoint( ):

paramQueue->addPoint(0, fVuPPM, index2);

In this case, the meters don’t get updated and are dead

  1. send a fixed value into the addPoint( ) method

paramQueue->addPoint(0, 0.5, index2);

In this case, the meters are frozen half-way

The user’s plugin made with my software also crashes identically and also has LED meter objects. One difference is that plugin uses a CAnimKnob object rather than the CSlider from AGain, but it crashes in an identical manner - rapid motion of the knob causes changes to the audio gain, which causes (other) changes to the LED meters, which then crashes - the crash and the call stack has the same fingerprint involving CollectInvalidRects.

The user reports that with AGain, Mixcraft 8 Pro Studio x64 crashes immediately upon opening the plugin’s editor with SDK 3.6.10 and eventually crashes with SDK 3.6.12.

I have observed multiple, different call stacks after the crash, however they all involve:

again.vst3!VSTGUI::CFrame::CollectInvalidRects

In most cases it is the CollectInvalidRects::addRect( ) function but on at least one occasion it was the destructor:

CollectInvalidRects::~CollectInvalidRects()

Several different call stacks after the crash are here:

----- Tracktion Waveform 9 Call Stacks after crashes: -----

(1) ----- Crash 1 -----

ucrtbased.dll!00007ffd2b75765c() Unknown Non-user code. Cannot find or open the PDB file.
ucrtbased.dll!00007ffd2b7575a7() Unknown Non-user code. Cannot find or open the PDB file.

again.vst3!std::_Vector_const_iterator<std::_Vector_val<std::_Simple_typesVSTGUI::CRect > >::_Compat(const std::_Vector_const_iterator<std::_Vector_val<std::_Simple_typesVSTGUI::CRect > > & _Right) Line 225 C++ Symbols loaded.
again.vst3!std::_Vector_const_iterator<std::_Vector_val<std::_Simple_typesVSTGUI::CRect > >::operator==(const std::_Vector_const_iterator<std::_Vector_val<std::_Simple_typesVSTGUI::CRect > > & _Right) Line 189 C++ Symbols loaded.
again.vst3!std::_Vector_const_iterator<std::_Vector_val<std::_Simple_typesVSTGUI::CRect > >::operator!=(const std::_Vector_const_iterator<std::_Vector_val<std::_Simple_typesVSTGUI::CRect > > & _Right) Line 194 C++ Symbols loaded.
again.vst3!VSTGUI::CFrame::CollectInvalidRects::addRect(const VSTGUI::CRect & rect) Line 1909 C++ Symbols loaded.
again.vst3!VSTGUI::CFrame::invalidRect(const VSTGUI::CRect & rect) Line 1411 C++ Symbols loaded.
again.vst3!VSTGUI::CViewContainer::invalidRect(const VSTGUI::CRect & rect) Line 753 C++ Symbols loaded.
again.vst3!VSTGUI::CView::invalidRect(const VSTGUI::CRect & rect) Line 560 C++ Symbols loaded.
again.vst3!VSTGUI::CView::invalid() Line 78 C++ Symbols loaded.
again.vst3!VSTGUI::ParameterChangeListener::updateControlValue(double value) Line 308 C++ Symbols loaded.
again.vst3!VSTGUI::ParameterChangeListener::update(Steinberg::FUnknown * changedUnknown, long message) Line 177 C++ Symbols loaded.
again.vst3!Steinberg::UpdateHandler::doTriggerUpdates(Steinberg::FUnknown * u, long message, bool suppressUpdateDone) Line 416 C++ Symbols loaded.
again.vst3!Steinberg::UpdateHandler::triggerUpdates(Steinberg::FUnknown * u, long message) Line 441 C++ Symbols loaded.
again.vst3!Steinberg::FObject::changed(long msg) Line 110 C++ Symbols loaded.
again.vst3!Steinberg::Vst::Parameter::setNormalized(double normValue) Line 101 C++ Symbols loaded.
again.vst3!Steinberg::Vst::EditController::setParamNormalized(unsigned long tag, double value) Line 186 C++ Symbols loaded.
again.vst3!Steinberg::Vst::AGainController::setParamNormalized(unsigned long tag, double value) Line 308 C++ Symbols loaded.
Waveform 9 (64-bit).exe!0000000140affbfd() Unknown No symbols loaded.
Waveform 9 (64-bit).exe!0000000140af1021() Unknown No symbols loaded.
[External Code] Annotated Frame



(2) ----- Crash 2 -----

again.vst3!VSTGUI::CRect::CRect(const VSTGUI::CRect & r) Line 85 C++ Symbols loaded.
again.vst3!std::_Default_allocator_traits<std::allocatorVSTGUI::CRect >::construct<VSTGUI::CRect,VSTGUI::CRect & __ptr64>(std::allocatorVSTGUI::CRect & __formal, VSTGUI::CRect * const _Ptr, VSTGUI::CRect & <_Args_0>) Line 855 C++ Symbols loaded.
again.vst3!std::_Uninitialized_copy_al_unchecked<VSTGUI::CRect * __ptr64,VSTGUI::CRect * __ptr64,std::allocatorVSTGUI::CRect >(VSTGUI::CRect * _First, VSTGUI::CRect * _Last, VSTGUI::CRect * _Dest, std::allocatorVSTGUI::CRect & _Al, std::_General_ptr_iterator_tag __formal, std::_Unused_parameter __formal) Line 93 C++ Symbols loaded.
again.vst3!std::_Uninitialized_copy<VSTGUI::CRect * __ptr64,VSTGUI::CRect * __ptr64,std::allocatorVSTGUI::CRect >(VSTGUI::CRect * _First, VSTGUI::CRect * _Last, VSTGUI::CRect * _Dest, std::allocatorVSTGUI::CRect & _Al) Line 122 C++ Symbols loaded.
again.vst3!std::vector<VSTGUI::CRect,std::allocatorVSTGUI::CRect >::_Umove_if_noexcept1(VSTGUI::CRect * _First, VSTGUI::CRect * _Last, VSTGUI::CRect * _Dest, std::integral_constant<bool,0> __formal) Line 1930 C++ Symbols loaded.
again.vst3!std::vector<VSTGUI::CRect,std::allocatorVSTGUI::CRect >::_Umove_if_noexcept(VSTGUI::CRect * _First, VSTGUI::CRect * _Last, VSTGUI::CRect * _Dest) Line 1936 C++ Symbols loaded.
again.vst3!std::vector<VSTGUI::CRect,std::allocatorVSTGUI::CRect >::emplace_back<VSTGUI::CRect const & __ptr64>(const VSTGUI::CRect & <_Val_0>) Line 960 C++ Symbols loaded.
again.vst3!VSTGUI::CFrame::CollectInvalidRects::addRect(const VSTGUI::CRect & rect) Line 1926 C++ Symbols loaded.
again.vst3!VSTGUI::CFrame::invalidRect(const VSTGUI::CRect & rect) Line 1411 C++ Symbols loaded.
again.vst3!VSTGUI::CViewContainer::invalidRect(const VSTGUI::CRect & rect) Line 753 C++ Symbols loaded.
again.vst3!VSTGUI::CView::invalidRect(const VSTGUI::CRect & rect) Line 560 C++ Symbols loaded.
again.vst3!VSTGUI::CView::invalid() Line 78 C++ Symbols loaded.
again.vst3!VSTGUI::ParameterChangeListener::updateControlValue(double value) Line 308 C++ Symbols loaded.
again.vst3!VSTGUI::ParameterChangeListener::update(Steinberg::FUnknown * changedUnknown, long message) Line 177 C++ Symbols loaded.
again.vst3!Steinberg::UpdateHandler::doTriggerUpdates(Steinberg::FUnknown * u, long message, bool suppressUpdateDone) Line 416 C++ Symbols loaded.
again.vst3!Steinberg::UpdateHandler::triggerUpdates(Steinberg::FUnknown * u, long message) Line 441 C++ Symbols loaded.
again.vst3!Steinberg::FObject::changed(long msg) Line 110 C++ Symbols loaded.
again.vst3!Steinberg::Vst::Parameter::setNormalized(double normValue) Line 101 C++ Symbols loaded.
again.vst3!Steinberg::Vst::EditController::setParamNormalized(unsigned long tag, double value) Line 186 C++ Symbols loaded.
again.vst3!Steinberg::Vst::AGainController::setParamNormalized(unsigned long tag, double value) Line 308 C++ Symbols loaded.
Waveform 9 (64-bit).exe!0000000140affbfd() Unknown No symbols loaded.
Waveform 9 (64-bit).exe!0000000140af1021() Unknown No symbols loaded.
[External Code] Annotated Frame



(3) ----- Crash 3 -----

ntdll.dll!00007ffd4bd4aa15() Unknown Non-user code. Cannot find or open the PDB file.
ntdll.dll!00007ffd4bd0eb7a() Unknown Non-user code. Cannot find or open the PDB file.
ntdll.dll!00007ffd4bcb6be1() Unknown Non-user code. Cannot find or open the PDB file.
KernelBase.dll!00007ffd490a656a() Unknown Non-user code. Cannot find or open the PDB file.
ucrtbased.dll!00007ffd31bf1501() Unknown Non-user code. Cannot find or open the PDB file.
ucrtbased.dll!00007ffd31bef905() Unknown Non-user code. Cannot find or open the PDB file.
ucrtbased.dll!00007ffd31bf2ef5() Unknown Non-user code. Cannot find or open the PDB file.

again.vst3!operator delete(void * block) Line 21 C++ Non-user code. Symbols loaded.
again.vst3!std::_Deallocate(void * _Ptr, unsigned __int64 _Count, unsigned __int64 _Sz) Line 152 C++ Symbols loaded.
again.vst3!std::allocatorVSTGUI::CRect::deallocate(VSTGUI::CRect * const _Ptr, const unsigned __int64 Count) Line 942 C++ Symbols loaded.
again.vst3!std::vector<VSTGUI::CRect,std::allocatorVSTGUI::CRect >::Tidy() Line 2009 C++ Symbols loaded.
again.vst3!std::vector<VSTGUI::CRect,std::allocatorVSTGUI::CRect >::~vector<VSTGUI::CRect,std::allocatorVSTGUI::CRect >() Line 921 C++ Symbols loaded.
again.vst3!VSTGUI::CFrame::CollectInvalidRects::~CollectInvalidRects() Line 1882 C++ Symbols loaded.
again.vst3!VSTGUI::CFrame::platformOnMouseMoved(VSTGUI::CPoint & where, const VSTGUI::CButtonState & buttons) Line 1603 C++ Symbols loaded.
again.vst3!VSTGUI::Win32Frame::proc(HWND
* hwnd, unsigned int message, unsigned __int64 wParam, int64 lParam) Line 830 C++ Symbols loaded.
again.vst3!VSTGUI::Win32Frame::WindowProc(HWND
* hwnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 961 C++ Symbols loaded.
[External Code] Annotated Frame
Waveform 9 (64-bit).exe!000000014100d4e6() Unknown No symbols loaded.
Waveform 9 (64-bit).exe!000000014100f683() Unknown No symbols loaded.
Waveform 9 (64-bit).exe!0000000141011a4e() Unknown No symbols loaded.
Waveform 9 (64-bit).exe!0000000140cb6b92() Unknown No symbols loaded.
[External Code] Annotated Frame



(4) ----- Crash 4 -----

ucrtbased.dll!00007ffd31c0765c() Unknown Non-user code. Cannot find or open the PDB file.
ucrtbased.dll!00007ffd31c075a7() Unknown Non-user code. Cannot find or open the PDB file.

again.vst3!std::_Vector_const_iterator<std::_Vector_val<std::_Simple_typesVSTGUI::CRect > >::operator*() Line 64 C++ Symbols loaded.
again.vst3!std::_Vector_iterator<std::_Vector_val<std::_Simple_typesVSTGUI::CRect > >::operator*() Line 293 C++ Symbols loaded.
again.vst3!VSTGUI::CFrame::CollectInvalidRects::addRect(const VSTGUI::CRect & rect) Line 1912 C++ Symbols loaded.
again.vst3!VSTGUI::CFrame::invalidRect(const VSTGUI::CRect & rect) Line 1411 C++ Symbols loaded.
again.vst3!VSTGUI::CViewContainer::invalidRect(const VSTGUI::CRect & rect) Line 753 C++ Symbols loaded.
again.vst3!VSTGUI::CView::invalidRect(const VSTGUI::CRect & rect) Line 560 C++ Symbols loaded.
again.vst3!VSTGUI::CView::invalid() Line 78 C++ Symbols loaded.
again.vst3!VSTGUI::ParameterChangeListener::updateControlValue(double value) Line 308 C++ Symbols loaded.
again.vst3!VSTGUI::ParameterChangeListener::update(Steinberg::FUnknown * changedUnknown, long message) Line 177 C++ Symbols loaded.
again.vst3!Steinberg::UpdateHandler::doTriggerUpdates(Steinberg::FUnknown * u, long message, bool suppressUpdateDone) Line 416 C++ Symbols loaded.
again.vst3!Steinberg::UpdateHandler::triggerUpdates(Steinberg::FUnknown * u, long message) Line 441 C++ Symbols loaded.
again.vst3!Steinberg::FObject::changed(long msg) Line 110 C++ Symbols loaded.
again.vst3!Steinberg::Vst::Parameter::setNormalized(double normValue) Line 101 C++ Symbols loaded.
again.vst3!Steinberg::Vst::EditController::setParamNormalized(unsigned long tag, double value) Line 186 C++ Symbols loaded.
again.vst3!Steinberg::Vst::AGainController::setParamNormalized(unsigned long tag, double value) Line 308 C++ Symbols loaded.
Waveform 9 (64-bit).exe!0000000140affbfd() Unknown No symbols loaded.
Waveform 9 (64-bit).exe!0000000140af1021() Unknown No symbols loaded.
[External Code] Annotated Frame



Thanks,

Will Pirkle

Hi,
I just checked it with Mixcraft. And the problem here is, that the host calls the IEditController instance of AGain on a secondary thread, not on the main thread. This is a host problem and I expect that the other hosts have the same issue. A host is only allowed to call the edit controller of a VST3 plug-in from the main thread as described in the VST3 documentation (see “Edit Controller Call Sequence”).

With VSTHost from Herman Seib I was not able to reproduce this issue, and I don’t have Tracktion Waveform installed to check.

Cheers,
Arne

Thanks for clearing this up, Arne.

It looks like I owe DaveClark a beer.

-Will

Hi Arne,

Here is a video I posted showing the crash in Hermann Seib’s VSTHost:

It may not crash without a signal source.

Also, I owe Will Pirkle a week or more of labor.

Regards,
Dave Clark

Hi,
OK with a working input I was able to get VSTHost crashing. And it’s the same as with Mixcraft. It is calling the IEditController from the audio thread :

>	again.vst3!Steinberg::Vst::AGainController::setParamNormalized(unsigned long tag, double value) Line 308	C++
 	vsthost.exe!CVST3PlugIn::DoProcess(long)	Unknown
 	vsthost.exe!CSpecVst3PlugIn::ProcessReplacing(float * *,float * *,long)	Unknown
 	vsthost.exe!CSpecPlugIF::ProcessReplacing(long)	Unknown
 	vsthost.exe!CSpecPlugIF::ProcessAudio(int,bool)	Unknown
 	vsthost.exe!CSpecPlugInHost::PassThruPlugIn(class CSpecPlugIF *,bool,bool)	Unknown
 	vsthost.exe!CSpecPlugInHost::PassThruPlugIn(class CSpecPlugIF *,bool,bool)	Unknown
 	vsthost.exe!CSpecPlugInHost::PassThruPlugIns(bool)	Unknown
 	vsthost.exe!CSpecPlugInHost::OnSamples(float * *,int,int,unsigned long)	Unknown
 	vsthost.exe!CWorkThread::OnEvent(void)	Unknown
 	vsthost.exe!CBackgroundThread::GetEvent(unsigned long)	Unknown
 	vsthost.exe!CBackgroundThread::RunThread(void)	Unknown
 	vsthost.exe!CWorkThread::RunThread(void)	Unknown
 	vsthost.exe!CBackgroundThread::EvtThreadProc(void *)	Unknown
 	vsthost.exe!_AfxThreadEntry(void *)	Unknown
 	vsthost.exe!_endthreadex()	Unknown
 	vsthost.exe!_endthreadex()	Unknown
 	kernel32.dll!00007fffaabe3034()	Unknown
 	ntdll.dll!00007fffad2a3691()	Unknown

Please report this issues to the host developers. We try to do the same :wink:

Cheers,
Arne

Thanks! This all makes sense now, and I would guess that it is the same issue with Samplitude. And since it is an IEditController function call, then it is a developer mistake with the VST3 hosting and not with VSTGUI4 - this also makes sense because I’ve been using VSTGUI4 in all sorts of non VST3 plugins and standalone app interfaces for years and have never had any problems like this. So while it means more work for devs to correct this, I am relieved that it is not on the plugin side.

  • Will

Hi Arne,

Thanks for your help. I just contacted Hermann and will contact Magix. One of the developers at Tracktion just sent me an email containing a link to a post on their forums saying that IEditController was being called from numerous places (in one of the JUCE files) which violated the guidelines for VST3:

Regards,
Dave

Hi Arne,

Thank you for uploading the stack trace; makes things easier for me.

:wink: indeed. Well, Dave Clark reported the issue to me; I’m looking into it. For future reference, I, Hermann Seib, author of VSTHost / SAVIHost, am registered as user “Arakula” here since quite some time; while I’m not a regular lurker, an incoming PM should be brought to my attention per eMail quite fast.

Hi Hermann,

Two of the posts above regarding VSTHost would have been unnecessary if the forum would have permitted me to PM Arne about replication of the problem with VSTHost. I didn’t have enough posts to do that, apparently. I did try.

Regards,
Dave Clark

That’s good to know. And thanks for looking into it.

Cheers,
Arne

Just in case anybody’s interested - I uploaded a new beta version of VSTHost (and SAVIHost, if anyone uses that for VST3 PlugIn testing) to
http://www.hermannseib.com/programs/beta/
this morning that should only send parameter changes to the editor in the UI thread.

If anybody (well, maybe except Dave, whom I’ve already notified directly :wink: ) could try that one, I’d be grateful.

Thanks Arakula. I tried the beta. Something seems off with the parameter ids. When I log a parameter id on parameter change, the beta shows me the wrong ids for some parameters. The same plugin in the current SAVIHost shows the correct ids.

Kind regards,
PJ