Re: Python GC does not work as it should be

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jean-Paul Calderone

    Re: Python GC does not work as it should be

    On Mon, 16 Jun 2008 18:11:24 +0700, Jaimy Azle <jazle@nospam.l og.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
  • Jaimy Azle

    #2
    Re: Python GC does not work as it should be

    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.


    Comment

    • =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

      #3
      Re: Python GC does not work as it should be

      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

      Comment

      Working...