Python GC does not work as it should be

Jean-Paul Calderone exarkun at divmod.com
Mon Jun 16 13:38:51 CEST 2008


On Mon, 16 Jun 2008 18:11:24 +0700, Jaimy Azle <jazle at nospam.log.web.id> wrote:
>Jean-Paul Calderone wrote:
>
>>
>> A system exception?  What's that?  C doesn't have exceptions.
>>
>
>How could I determine it? I dont know GCC implementation, and others, but C
>on MSVC does have it. My application were not written in C, an exception
>raised was something like "access violation at address xxxx on module
>python25.dll", and MSVC debugger shows collecting state were not reset (1),
>that is why GC would never happen.

Ah, one of those.  Thanks for the clarification.  That basically means your
program was supposed to crash.  Instead, since you had visual studio around
it handled the violation by popping up a dialog and giving you the choice to
continue execution, which I guess you did.

There's plenty of things other than that one static variable that can get
messed up in this scenario.  The access violation could easily come along
with random memory corruption.  Fixing just the GC to handle this doesn't
mean your program will be able to keep running correctly.  It's difficult
or impossible to know what else has been put into an inconsistent state.

The real fix is probably to track down what is causing the access violation.
Once you fix that, the GC shouldn't need to be changed to account for this
possibility, and you'll stop getting dialogs popping up from your app. :)

Jean-Paul



More information about the Python-list mailing list