[Zope] Py_BuildValue Error

Dieter Maurer dieter at handshake.de
Thu Sep 9 14:53:21 EDT 2004


Travis Miller wrote at 2004-9-9 09:26 -0500:
>On Sep 8, 2004, at 3:11 PM, Dieter Maurer wrote:
>
>> Travis Miller wrote at 2004-9-8 07:29 -0500:
>>> ...
>>>   File "/opt/Zope/SoftwareHome272/lib/python/ZODB/Connection.py", line
>>> 411, in commit
>>>     state=object.__getstate__()
>>> SystemError: NULL object passed to Py_BuildValue
> ...
>> The easiest way to do this is to catch the exception
>> and print or (better) log "str(object.__class__)" in the
>> "except" clause.
>> Do not forget to reraise the exception afterwards.
>
>you'll see from my later posts in the thread that the object seems to 
>be of class BTrees.IOBTree.IOBTree

I checked the "Py_BuildValue" occurrences in the "BTrees" package.

I am quite convinced that they cannot show this behaviour
unless your computer executes different code than coded there.

I would try to analyse the problem as follows:

  *  catch the exception and use
     "import pdb; pdb.set_trace()"
     in the except clause

  *  run Zope in the foreground until the error occurs
     and Zope stops in "set_trace()".

  *  attach the Zope process with GDB (or another debugger
     able to attach a running process

  *  put a GDB breakpoint on "Py_BuildValue"

  *  continue execution

  *  use "pdb" to reexecute "object.__getstate()__"

     When your problem is deterministic, it will occur again.

     You will stop in "Py_BuildValue".
     Continue until "Py_BuildValue" is called with a "NULL" value.
     Analyse the backtrace.

-- 
Dieter


More information about the Zope mailing list