Menu

#2 Fatal Python error: GC object already tracked

closed
None
5
2014-08-21
2003-12-28
Vikram.V
No

please see:

http://mail.python.org/pipermail/python-bugs-list/2003-October/020505.html

describes the problem. the thread in the above link
suggests that this might be a pycurl problem not a
python problem.

i was not the submitter of the python bug mentioned in
the above link but i recently had the exact same
error. this was caused by some code which starts up
multiple threads and uses pycurl to download some pages
on a freebsd box. i am not able to reproduce it; if and
when i do so i will add to this report.

curl version used was 7.10.8 (with CURLOPT_ENCODING set
to "gzip") and python version was 2.3.

thanks.

Vikram

Discussion

  • Kjetil Jacobsen

    Kjetil Jacobsen - 2004-01-13

    Logged In: YES
    user_id=5685

    This is a known issue with pycurl. Until we resolve this,
    you can avoid the problem by turning off the gc tracking.
    No gc tracking is the default behaviour in the current cvs
    version of pycurl, so as an intermediate solution you can
    use this..

     
  • Kjetil Jacobsen

    Kjetil Jacobsen - 2004-01-13
    • assigned_to: nobody --> mfx
     
  • Michael Hudson-Doyle

    Logged In: YES
    user_id=6656

    Is there a testcase for this? I thought I'd try to stop
    this being reported against Python (:-) but can't see
    anything obviously wrong...

     
  • Kjetil Jacobsen

    Kjetil Jacobsen - 2004-01-14

    Logged In: YES
    user_id=5685

    I've spent some time trying to reproduce this and my only
    luck so far has been in a large system where this happens
    after many hours of runtime. Debugging hasn't payed off yet.

    After turning off the gc tracking things have been working
    so I have naturally suspected this to be a pycurl specific
    issue. But it might very well be that we're hitting a
    strange corner-case in Python.

     
  • Michael Hudson-Doyle

    Logged In: YES
    user_id=6656

    Hmm, that sounds like Tim's guess that this was a memory
    scribble is more likely.

    It might be worth trying a debug build of Python 2.3, but
    without a easy way of reproducing the fault it's hard to say.

    I agree this /could/ be a problem in Python, but would say
    that's still unlikely.

     
  • Kjetil Jacobsen

    Kjetil Jacobsen - 2004-01-29

    Logged In: YES
    user_id=5685

    I've done some more testing in our application, and it seems
    that the problem still remains (although occurs only after a
    very long test cycle) even if the gc-tracking code is not
    enabled.

     
  • Phil Schwartz

    Phil Schwartz - 2004-04-16

    Logged In: YES
    user_id=420501

    I receive the error, intermittently (yet frequently) with
    python2.2.2 and python2.3.3 using libcurl 7.11.1 and pycurl
    7.11.1.

    I've tried disable the gc support in pycurl but that doesn't
    solve anything. I've also done:

    import gc
    gc.disable()

    in my python script but that doesn't solve the problem
    either. If I do:

    import gc
    gc.threshold(1)

    I've seen the script die immediiately on several occassions
    with the only output being "Killed".

    Unfortunately, it's difficult to isolate a test case. All I
    know is that I have a multithreaded script that perodically
    results in the "GC object already tracked" error. I've seen
    this occur with as few as 20 connections or as many as
    several thousand connections. Given this range it's hard to
    figure out what the cause is.

    Phil

     
  • Kjetil Jacobsen

    Kjetil Jacobsen - 2004-05-03

    Logged In: YES
    user_id=5685

    I've been going through the code which deals with callbacks
    in pycurl, and I've found instance where py_buildvalue is
    called without having the interpreter lock. I think this is
    the cause of the problem. The current cvs version of pycurl
    has a fix, try if that helps.

     
  • Kjetil Jacobsen

    Kjetil Jacobsen - 2004-05-04

    Logged In: YES
    user_id=5685

    Setting this to closed for now, reopen if the problem persists.

     
  • Kjetil Jacobsen

    Kjetil Jacobsen - 2004-05-04
    • status: open --> closed