Boost logo

Boost :

From: Paul C. Kunysch (Illume_at_[hidden])
Date: 2001-02-07 08:22:59


Hi

I've compiled bpl_static with BOOST_DEBUG_PYTHON and linked it
with python20. [MSVC6, NT4] Now I get exceptions from pythons
"object.c":

  void
  _Py_ForgetReference(register PyObject *op)
  {
    [...]
    if (op == &refchain ||
      op->_ob_prev->_ob_next != op ||
      op->_ob_next->_ob_prev != op)
    [...]

( _Py_ForgetReference() removes an object from a global
  "debug-list" when its refcount drops to zero. )

The fields _ob_prev and _ob_next are NULL in several objects
created by the BPL. May I assume that it's safe to ignore
"unknown" objects by ignoring them in _Py_ForgetReference():

  if (!op->_ob_prev || !op->_ob_next)
    return;

Or are these problems caused by bugs in boost? For example
the following code causes a DECREF in the init_function when
the function-scope is left:

  boost::python::class_base::initialize_instance( ... ) {
    [...]
    // Manage the reference to the bound function
    ref init_function_holder(init_function);
    [...]

Perhaps the refcount of 'init_function' shouldn't drop to zero?
Or should it be initialized with _Py_NewReference()?

Bye


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk