nBlockUse)" error when it hits "delete note" on line 637 in TNL::handleNotify(TNL:U32, bool) located in netConnection.cpp. Similair errors I've read occur when mismatching the code generation in MSVC (/MDd, /MT"> TNL Segfault | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

TNL Segfault

by Mark Harmer · in Torque Game Engine · 06/18/2007 (11:56 am) · 2 replies

I'm receiving a "_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)" error when it hits "delete note" on line 637 in TNL::handleNotify(TNL:U32, bool) located in netConnection.cpp. Similair errors I've read occur when mismatching the code generation in MSVC (/MDd, /MTd). However I've double checked both TNL and our project and they are identical.

Here's our call stack:
msvcr80d.dll!operator delete(void * pUserData=0x059f4fcc) Line 52 + 0x51 bytes C++
enkiduo.dll!TNL::NetConnection::handleNotify(unsigned int sequence=63262179, bool recvd=true) Line 637 + 0x6 bytes C++
enkiduo.dll!TNL::NetConnection::readPacketHeader(TNL::BitStream * pstream=0x03c553d4) Line 455 C++
enkiduo.dll!TNL::NetConnection::readRawPacket(TNL::BitStream * bstream=0x03c555d6) Line 247 + 0xf bytes C++
enkiduo.dll!TNL::NetConnection::sendPacket(TNL::BitStream * stream=0x0534b1f0) Line 721 + 0xc bytes C++

Commenting out the specified line allows it to work properly, however we're concerned it may cause unnoticable sideaffects. We're porting our project over from linux to windows, and it works without problems on all distributions of linux. We are using OpenTNL 1.5, MSVC 8.

PS: To those that saw the same topic in General Discussion my apologies, unfortunately I realized after I posted it was in the wrong forum, and I cannot delete it myself.

About the author

Recent Threads

  • 3D Shapes not working

  • #1
    06/18/2007 (2:03 pm)
    Correct me if I am wrong.
    but it looks like you are deleting memory across boundaries. (as defined by the calling thread)

    this will only surface in debug mode, and release will not show this problem.

    In ms you cannot delete memory that was created from another process / thread / dll.
    #2
    06/19/2007 (11:09 am)
    I'll look into it thanks. We are linking it statically so it narrows it down to just a potential thread. I don't know the inner workings of TNL, so I'm speculating/guessing here: does the problem stem from that fact that our thread is creating a bitstream, handing it off to TNL and TNL is trying to clean it up itself?