[ZODB-Dev] Latest news: core dump with small change to POSException.py
Jeremy Hylton
jeremy@zope.com
Wed, 26 Sep 2001 13:20:32 -0400 (EDT)
>>>>> "GW" == Greg Ward <gward@mems-exchange.org> writes:
GW> On 25 September 2001, Jeremy Hylton said:
>> One of the problems is that _p_resolveConflict() is C code that
>> raises a ConflictError and passes it four arguments. When the
>> exception is actually caught in the interpreter and turned into
>> an exception object, the call to ConflictError raises a
>> TypeError. After your patch, ConflictError only takes one
>> argument, but it's called with four. PyErr_NormalizeException()
>> returnes normally, but with the bare except it dumps core.
GW> Verrry interesting! Sounds like it just might be a Python bug
GW> after all.
And, lo, it is!
It's a fairly obscure problem that occurs exactly because the
exception is set in C and the attempt to construct the exception
instance fails before any Python code is executed. I think I can fix
it, but I think the proper forum for further discussion of the bug is
python-dev.
It means that the ConflictError changes need to be prepared to deal
with the arguments passed in C code. We'll need to check all the Zope
C code for PyErr_SetObject() where the first arg points to
ConflictError.
Jeremy