Re: Debugging a difficult refcount issue.

2011-12-19 Thread buck
what helpful > > > since I can reliably find the memory address of the dict, but it does not > > > help me pinpoint the issue. I was able to find the piece of code that > > > allocates the problematic dict via a malloc/LD_PRELOAD interposer, but > > > that co

Re: Debugging a difficult refcount issue.

2011-12-18 Thread buck
> > python. I don't think it was the cause. > > > > I believe that the dict was deallocated, cached, and re-allocated via > > PyDict_New to a C routine with bad refcount logic, then the above error > > manifests when the dict is again deallocated, cached, and re-alloc

Re: Debugging a difficult refcount issue.

2011-12-18 Thread Jack Diederich
allocates the > problematic dict via a malloc/LD_PRELOAD interposer, but that code was pure > python. I don't think it was the cause. > > I believe that the dict was deallocated, cached, and re-allocated via > PyDict_New to a C routine with bad refcount logic, then the above err

Re: Debugging a difficult refcount issue.

2011-12-18 Thread buck
On Saturday, December 17, 2011 11:55:13 PM UTC-8, Paul Rubin wrote: > buck writes: > > I tried to pinpoint this intermediate allocation with a similar > > PyDict_New/LD_PRELOAD interposer, but that isn't working for me[2]. > > Did you try a gdb watchpoint? I didn't try that, since that piece of

Re: Debugging a difficult refcount issue.

2011-12-18 Thread Paul Rubin
buck writes: > I tried to pinpoint this intermediate allocation with a similar > PyDict_New/LD_PRELOAD interposer, but that isn't working for me[2]. Did you try a gdb watchpoint? -- http://mail.python.org/mailman/listinfo/python-list

Debugging a difficult refcount issue.

2011-12-17 Thread buck
ated via PyDict_New to a C routine with bad refcount logic, then the above error manifests when the dict is again deallocated, cached, and re-allocated. I tried to pinpoint this intermediate allocation with a similar PyDict_New/LD_PRELOAD interposer, but that isn't working for me[2]. How sh

Re: Refcount problem in ceval.c

2008-09-11 Thread Berthold Höllmann
Christian Heimes <[EMAIL PROTECTED]> writes: > Berthold Höllmann wrote: >> Is there any "common" reason to for such a strange object on the command >> stack, or is it more likely that any of my extension modules is causing >> havoc? > > It's very likely that your extension has a reference counting

Re: Refcount problem in ceval.c

2008-09-10 Thread Christian Heimes
Berthold Höllmann wrote: Is there any "common" reason to for such a strange object on the command stack, or is it more likely that any of my extension modules is causing havoc? It's very likely that your extension has a reference counting bug. It looks like you are either missing a Py_INCREF o

Refcount problem in ceval.c

2008-09-10 Thread Berthold Höllmann
I have a problem with my debug Python 2.5.2 executable with Py_REF_DEBUG and Py_TRACE_REFS set. With one of my scripts I get: ... Fatal Python error: Python/ceval.c:947 object at 0x2aa3f4d840 has negative ref count -2604246222170760230 Program received signal SIGABRT, Aborted. [Switching to Thre

Re: refcount

2008-01-30 Thread Sion Arrowsmith
Benjamin <[EMAIL PROTECTED]> wrote: >> [ help(sys.getrefcount) says: ] >> [ ... ] The count returned is generally >> one higher than you might expect, because it includes the (temporary) >> reference as an argument to getrefcount(). >Are there any cases when it wouldn't? When the temporary refer

Re: refcount

2008-01-29 Thread Mel
Benjamin wrote: > On Jan 29, 5:46 am, Christian Heimes <[EMAIL PROTECTED]> wrote: >> Simon Pickles wrote: >>> Hi, >>> Is is possible to access the refcount for an object? >>> Ideally, I am looking to see if I have a refcount of 1 before calling del &

Re: refcount

2008-01-29 Thread Benjamin
On Jan 29, 5:46 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Simon Pickles wrote: > > Hi, > > > Is is possible to access the refcount for an object? > > > Ideally, I am looking to see if I have a refcount of 1 before calling del > > Help on buil

Re: refcount

2008-01-29 Thread Christian Heimes
Simon Pickles wrote: > Hi, > > Is is possible to access the refcount for an object? > > Ideally, I am looking to see if I have a refcount of 1 before calling del Help on built-in function getrefcount in module sys: getrefcount(...) getrefcount(object) -> integer Return t

Re: refcount

2008-01-29 Thread Duncan Booth
Simon Pickles <[EMAIL PROTECTED]> wrote: > Is is possible to access the refcount for an object? >>> import sys >>> sys.getrefcount(42) 6 > Ideally, I am looking to see if I have a refcount of 1 before calling del That's a pointless exercise: you probably d

refcount

2008-01-29 Thread Simon Pickles
Hi, Is is possible to access the refcount for an object? Ideally, I am looking to see if I have a refcount of 1 before calling del Thanks Simon -- Linux Counter: User# 424693 -- http://mail.python.org/mailman/listinfo/python-list

Re: PyDict_*() refcount assumptions

2007-10-31 Thread Gabriel Genellina
En Wed, 31 Oct 2007 22:01:53 -0300, <[EMAIL PROTECTED]> escribió: > i checked this: > http://svn.python.org/projects/python/trunk/Doc/data/refcounts.dat > and it seems that > PyDict_SetItem incref the value being added and the key > and PyDict_DelItem does not decrement any refcounts > so i have

PyDict_*() refcount assumptions

2007-10-31 Thread sndive
i checked this: http://svn.python.org/projects/python/trunk/Doc/data/refcounts.dat and it seems that PyDict_SetItem incref the value being added and the key and PyDict_DelItem does not decrement any refcounts so i have to do so manually for the key and for the data( by calling PyDict_GetItem first

refcount differences in 2.5

2007-05-16 Thread Gabriel Genellina
Hi With Python 2.5, there is a change on the reference count of objects compared with previous versions (as reported by sys.getrefcount). All Python versions from 2.1 thru 2.4 gave these same results: Python 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] on win32 Type "copyright", "cr

Re: beginner's refcount questions

2006-10-30 Thread Scott David Daniels
Jens Theisen wrote: > python uses gc only where refcounts alone haven't yet done the > job. Thus, the following code > class Foo: > def __del__(self): >print "deled!" ... In c++, this is a central technique used for all sorts of tasks, whereas in garbage collected languages

Re: beginner's refcount questions

2006-10-29 Thread Fredrik Lundh
Jens Theisen wrote: > Thus, the following code > > class Foo: > def __del__(self): > print "deled!" > > def foo(): > f = Foo() > > foo() > print "done!" > > prints > > deled! > done! > > and not the other way round. the behaviour you see in this simple program is not guarant

Re: beginner's refcount questions

2006-10-29 Thread Terry Reedy
"Jens Theisen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > python uses gc only where refcounts alone haven't yet done the > job. /python/The CPython implementation/ > And some other minor question: Is there a way to query the use count > of an object? This would be useful for

Re: beginner's refcount questions

2006-10-29 Thread Jean-Paul Calderone
On 30 Oct 2006 00:30:53 +, Jens Theisen <[EMAIL PROTECTED]> wrote: >Hello, > >python uses gc only where refcounts alone haven't yet done the >job. Thus, the following code > >class Foo: >def __del__(self): >print "deled!" > >def foo(): >f = Foo() > >foo() >print "done!" > >print

beginner's refcount questions

2006-10-29 Thread Jens Theisen
Hello, python uses gc only where refcounts alone haven't yet done the job. Thus, the following code class Foo: def __del__(self): print "deled!" def foo(): f = Foo() foo() print "done!" prints deled! done! and not the other way round. In c++, this is a central technique used