juce::Array crash on 64bit build


#1

Today I got strange crash.

Usually I build 32bit debug version but every couple of days I build 64bit for testing.
Today 64bit version crashed almost immediately after I started it. I traced error to juce::Array.
I’m using lots of arrays without any problems. That is why I find this strange.

This array is defined as:
juce::Array<UIState*> _UpdateList;

On program start I populate it with different components. When I call first .add:
if (!_UpdateList.contains(comp)) _UpdateList.add(comp);
my program crashes on 64bit build.

I’m lost. Can you point me into right direction?

Here is stack backtrace:

CrashHandler:
0: PlanetCNCLib64d: juce::SystemStats::getStackBacktrace + 0x7a
1: PlanetCNCLib64d: CrashHandlerFunction + 0x34
2: PlanetCNCLib64d: juce::handleCrash + 0xf
3: UnhandledExceptionFilter + 0x157
4: memset + 0x239b
5: _C_specific_handler + 0x96
6: _chkstk + 0x11d
7: RtlImageNtHeaderEx + 0x483
8: KiUserExceptionDispatcher + 0x3a
9: PlanetCNCLib64d: CheckBytes + 0x36
10: PlanetCNCLib64d: realloc_help + 0x36f
11: PlanetCNCLib64d: _realloc_dbg + 0x55
12: PlanetCNCLib64d: realloc + 0x2e
13: PlanetCNCLib64d: juce::HeapBlock<UIState * __ptr64,0>::realloc + 0x68
14: PlanetCNCLib64d: juce::ArrayAllocationBase<UIState * __ptr64,juce::DummyCriticalSection>::setAllocatedSize + 0x4f
15: PlanetCNCLib64d: juce::ArrayAllocationBase<UIState * __ptr64,juce::DummyCriticalSection>::ensureAllocatedSize + 0x50
16: PlanetCNCLib64d: juce::Array<UIState * __ptr64,juce::DummyCriticalSection,0>::add + 0x50
17: PlanetCNCLib64d: UIStateManager::Add + 0x96

#2

Forgot to say - I’m using Windows10 64bit.


#3

I found problem. Heap was overwritten by mistake because I mistyped.