assertion error in deletedChain.T

New computer and development environment, lots of trouble…

well, I have a problem with this line of code:

PT(GeomTriangles) prim = new GeomTriangles( Geom::UH_dynamic );

Compiling works fine, but when running I get an assertion error pointing to this code in dtool/src/dtoolbase/deletedChain.T, line 31:

template<class Type>
INLINE Type *DeletedChain<Type>::
allocate(size_t size, TypeHandle type_handle) {
  TAU_PROFILE("Type *DeletedChain<Type>::allocate(size_t, TypeHandle)", " ", TAU_USER);
  assert(size <= sizeof(Type));

My code has been working on my old computer, so I guess it is the development environment. The new one is:

  • Windows Vista, 32bit
  • VC 2008
  • Windows SDK and DirectX SDK (Nov. 2007)
  • Panda3D-1.4.2 (not recompiled)

The old computer has been:

  • Windows XP, 32bit
  • VC 2005
  • Platform SDK and DirectX SDK (Apr. 2007)
  • Panda3D-1.4.2 (not recompiled)

Any ideas what could be the reason, or has been compiling with VS 2008 already? Thanks in advance.


This assertion error indicates a mismatch between your header files and your DLL’s: a particular data type in your own build environment is not the same size as the same data type in whatever build environment produced libpanda.dll.

Lots of things can change the size of data types. It might be safest to compile your own version of Panda3D within the same build environment.


Thanks for your help. I’m quite positive that compiling my own version of Panda3D would solve the problem, but there are reasons why I don’t want to do this:

(1) Distributing my own code would be possible in source form only, and not as hand binary .pyd or .dll. Everybody would also have to recompile Panda3D to use my code.

(2) I found that avoiding an error which I don’t understand is a bad thing. Sooner or later (usually sooner) the problem gets back at me. So I want to understand what is going wrong.

(3) I am using the unmodified Panda3D-1.4.2 headers and libraries. So headers and libraries should match.

I will try and investigate what the origin of my problem is. So far I have tracked it down to pmap, since the following code gives different results on both computers. But it is late already where I am from, and I will stop now and investigate some more tomorrow.


    typedef pmap<PreparedGraphicsObjects *, IndexBufferContext *> Contexts;
    printf( "--> %i\n", sizeof( GeomTriangles ) );
    printf( "--> %i\n", sizeof( Contexts ) );
    printf( "--> %i\n", sizeof( PreparedGraphicsObjects* ) );
    printf( "--> %i\n", sizeof( IndexBufferContext* ) );

“Old” computer:

--> 120
--> 32
--> 4
--> 4

“New” computer:

--> 112
--> 24
--> 4
--> 4

Hmm, it might be worth comparing the size of the standard STL std::map, which is what pmap is based from. If that differs between your two different environments, then you’ll just have to blame Microsoft for changing the system headers between environments.


Bingo. Size of std::map has changed in VS 2008 Express.

I think the only way to go with VS 2008 would be to compile Panda3D, and then link against the self-compiled libs. I have chosen to go the other way. VS 2008 Express is uninstalled, and VS 2005 Express is back again. The only difference is that I am still using the new Windows SDK (replaces Platform SDK).

First tests have been successful. Thank you for your help.