[Bf-committers] CVS Python assert failure on shutdown?
Ken Hughes
khughes at pacific.edu
Tue Mar 20 18:45:09 CET 2007
I *think* I tracked down the cause of this but I'm not sure I understand
why it's a problem:
init_ourImport() has the following code:
EXPP_dict_set_item_str( d, "bpy", Main_Init() );
EXPP_dict_set_item_str() does a Py_DECREF on the third parameter, since
adding it to the dictionary creates a new ref.
If I replace this with:
PyDict_SetItemString(d, "bpy", Main_Init() );
the assert error goes away here.
I put in some test code and verified that after calling
PyDict_SetItemString() the object returned from Main_Init() has two
references.
Can anyone see something I'm missing?
Ken
Stephen Swaney wrote:
> On Mon, Mar 19, 2007 at 03:17:34PM -0600, Early Ehlinger wrote:
>> If I do a build in "Blender Debug" mode using MSVC 7.1, launch Blender,
>> and hit Ctrl+Q, then enter, I get the following assertion failure.
>>
>> This is using a freshly downloaded copy of CVS sources, no patches,
>> Python 2.5 installed.
>>
>> ---------------------------
>> Microsoft Visual C++ Runtime Library
>> ---------------------------
>> Assertion failed!
>>
>> Program: ...
>> File: ..\Modules\gcmodule.c
>> Line: 276
>>
>> Expression: gc->gc.gc_refs != 0
>
> This msg is coming from inside the Python source.
> Judging from the comments in the code there, it
> looks like the garbage collector is bailing when
> asked to delete an already deleted object.
>
> My guess is we have a bad refcount (missing incref?),
> probably due to the recent code cleanup.
>
> This behaviour does not show up here on loonix, so
> finding the problem will be interesting.
>
More information about the Bf-committers
mailing list