Hi!
I've followed all the tutorials and docs and even copy pasted the code, but my project keeps crashing if i step the visual debugger instance, when the visual debugger itself is launched.
In details.
Here is my initialization code:
hkMallocAllocator baseMalloc; hkMemoryRouter *memoryRouter = hkMemoryInitUtil::initDefault(&baseMalloc, hkMemorySystem::FrameInfo(1024 * 1024 * 1024)); hkBaseSystem::init(memoryRouter, ErrorReport); hkpWorldCinfo worldInfo; currentWorld = new hkpWorld(worldInfo); hkpAgentRegisterUtil::registerAllAgents(currentWorld->getCollisionDispatcher()); hkpPhysicsContext::registerAllPhysicsProcesses(); currentContext = new hkpPhysicsContext; currentContext->addWorld(currentWorld); hkArray contexts; contexts.pushBack(currentContext); currentVisualDebugger = new hkVisualDebugger(contexts); currentVisualDebugger->serve();
As you can see, nothing really special here.
And here is how i step the world every frame:
currentWorld->stepDeltaTime(0.01f); currentVisualDebugger->step();
This works perfectly, until i connect with a visual debugger to my app. The VDB itself registers the connection in it's local console output and then my app crashes with a:
0xC0000005: Access violation reading location 0xccccccd8.
And the call stack:
GHostEngine.dll!hkLargeBlockAllocator::blockAlloc(int bytes) Line 736 + 0x13 bytes C++
GHostEngine.dll!hkFreeListAllocator::bufAlloc(int & reqNumInOut) Line 553 + 0xc bytes C++
GHostEngine.dll!hkFreeListAllocator::blockAlloc(int nbytes) Line 575 C++
GHostEngine.dll!hkMemoryRouter::alignedAlloc(hkMemoryAllocator & b, int nbytes, int alignment) Line 43 + 0x29 bytes C++
GHostEngine.dll!hkBufferedStreamWriter::hkBufferedStreamWriter(hkStreamWriter * s, int bufSize) Line 40 C++
GHostEngine.dll!hkDisplaySerializeOStream::hkDisplaySerializeOStream(hkStreamWriter * writer) Line 39 + 0x5a bytes C++
GHostEngine.dll!hkVersionReporter::sendVersionInformation(hkStreamWriter * connection) Line 147 C++
GHostEngine.dll!hkVisualDebugger::createClient(hkSocket * socket, hkStreamReader * reader, hkStreamWriter * writer) Line 237 + 0x6 bytes C++
GHostEngine.dll!hkVisualDebugger::pollForNewClients() Line 287 C++
GHostEngine.dll!hkVisualDebugger::step(float frameTimeInMs) Line 323 C++
The error reporter on init says:
Havok Message .\\hkVisualDebugger.cpp(44): [0x1293ADEF] Report : VDB Server instance has been created
Havok Message .\\System\\Io\\Socket\\Bsd\\hkBsdSocket.cpp(396): [0x1293ADE8] Report : Listening on host[-] port 25001
Havok Message .\\hkVisualDebugger.cpp(107): [0x1293ADE8] Report : Server created and will poll for new client(s) on port 25001 every frame
And after connection:
Havok Message .\\System\\Io\\Socket\\Bsd\\hkBsdSocket.cpp(451): [0xFFFFFFFF] Report : Socket got connection from [127.0.0.1:49883]
Havok Message .\\hkVisualDebugger.cpp(280): [0xFFFFFFFF] Report : A new network client has been received (host name not available at present)
I just don't understand what i did wrong. All the demos work OK with VDB, but not my app.
P.S.
There are no bodies added to the world. Basically, these are the only Havok functions i used. Nothing else (except for deinitialization).


