[C++-sig] debug mode triggers assert in class.hpp

Mark Russell mrussell8081 at pacbell.net
Fri Nov 22 04:47:58 CET 2002

I have built a debug version of python and BPL e.g. when I try to create an
object from a BPL extension it triggers the same assert in class.hpp at
allocate.  I must have some very basic config option wrong but I can't
figure out what. The python transcript below shows the problem, the assert
on line 453 in class.hpp is below that.  --Mark

Adding parser accelerators ...
Python 2.2.2 (#37, Nov 21 2002, 17:20:19) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import hello
[8161 refs]
>>> dir(hello)
['World', '__doc__', '__file__', '__name__']
[8172 refs]
>>> w = hello.World()
Assertion failed: self_->ob_type->ob_type == &class_metatype_object, file
ython\build\../src/object\class.cpp, line 453
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RuntimeError: unidentifiable C++ exception
[8211 refs]


void* instance_holder::allocate(PyObject* self_, std::size_t holder_offset,
std::size_t holder_size)
    assert(self_->ob_type->ob_type == &class_metatype_object);
    objects::instance<>* self = (objects::instance<>*)self_;

More information about the Cplusplus-sig mailing list