469,955 Members | 2,576 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

Re: Python GC does not work as it should be

On Mon, 16 Jun 2008 18:11:24 +0700, Jaimy Azle <ja***@nospam.log.web.idwrote:
>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
Jun 27 '08 #1
2 1334
Jean-Paul Calderone wrote:
>
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. :)
Yes I did my job, i had mention it before. but an application would not
consist mine only, it could be incorporate your c extension module(s), and
others, means problem could be from my side, yours, or others. Though
forcing to reset the state would not mean fixing the real problem, but
making sure the GC would always try to do its job is important as python
itself used as an integrator engine no matter whether it succeed or not.

Salam,

- Jaimy.
Jun 27 '08 #2
Yes I did my job, i had mention it before. but an application would not
consist mine only, it could be incorporate your c extension module(s), and
others, means problem could be from my side, yours, or others. Though
forcing to reset the state would not mean fixing the real problem, but
making sure the GC would always try to do its job is important as python
itself used as an integrator engine no matter whether it succeed or not.
Python does not support the Microsoft structured exceptions at all, and
there is nothing that can be done about it. There are many many many
places in the that would work incorrectly if a structured exception
occurred, including many which lead to significant memory leaks or
completely block the interpreter (as it won't return the GIL. That it
can also happen in GC is just a tiny detail of the problem.

If you think you absolutely need to have that work, just change the
code and use a modified Python DLL.

Regards,
Martin
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

68 posts views Thread by Lad | last post: by
3 posts views Thread by fdsl ysnh | last post: by
reply views Thread by Kurt B. Kaiser | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.