Hi everyone !
My JUCE-plugins seem to have their GUI not working anymore in release. At startup, my debugger catches messages from the CRT about some evil things happening (typically reading or writing at NULL, unhandled exceptions, heap corruption, etc.) The “fun” thing is, it only happens in release config. Debug config is working absolutely fine…
The problem seems to have appeared when I upgraded to GIT tip (couple of days ago. I was using version from mid februrary 2011 previously, and it was working fine… I can probably trace back exact JUCE version if that is relevant.)
Some information that may be relevant :
- I said the Problem is GUI-related, because when I load my plugin but leaves its GUI closed, it works fine. It’ll only crash when I open its GUI. Plus, in my company, it seems that most of the things using JUCE-GUI are broken now, as other things using JUCE non-GUI stuff are still working…
- My plugins are using /MD (Multi-threaded DLL) version of CRT (since juce’s default seems to be /MT, this may play a role)
- Using Visual Studio 2008. The plugin I describe below is Win32 VST, but it’s not the only place where I get issues, it’s just (hopefully) the easiest to debug…
Here is my (pseudo-)code :
{
_heapchk(); // <- this one says the heap is valid at this point !
// We are within some of my component's constructor, btw
m_pMyComponent = new CMyComponent(this));
}
class CMyComponent: public CMyComponentBase
{
public :
CMyComponent(CSomeOtherComponent* const pParent)
: CMyComponentBase(),
m_pParent(pParent)
{
}
protected :
CSomeOtherComponent* const m_pParent;
};
class CMyComponentBase : public Compoent
{
public :
CMyComponentBase()
: Component(L"CMyComponentBase")
{
_heapchk(); // <- this one is already complaining that the heap is NOT valid anymore !
// Do some other stuff... but as my heap is corrupt, no
// wonder something is going to go wrong at some point...
}
};
Now, trying to understand what was happening, I changed a bit the release-config compile options to have debug information (so maybe this is not relevant at all, cause I cannot actually be sure my plugin is doing the same as before… but as I cannot debug assembly code, this is better than nothing…) Anyway, what came out, is that when calling my operator “new”, it (obviously) allocates a memory space that corresponds to the size of my CMyComponent object, but it also fills it with 0xbaadf00d…Which is odd, imho :
- First, because there is a pattern (a release allocator shouldn’t waste time and fill allocated space with any pattern…)
- Second, if any pattern, why baadf00d ? -> In debug config, newly allocated space is filled with 0xcdcdcdcd…
So, anybody with an idea ?..
Thanks in advance for your help !
cheers !
Val
