[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-06 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Benjamin! -- assignee: mark.dickinson -> ___ Python tracker ___ ___ Python-bugs-list mailin

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 30925a3b2324 by Benjamin Peterson in branch '3.4': fix potential refleak in PyFloat_AsDouble (closes #23590) https://hg.python.org/cpython/rev/30925a3b2324 New changeset f31b91b6683a by Benjamin Peterson in branch '2.7': fix potential refleak in PyF

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-06 Thread Mark Dickinson
Mark Dickinson added the comment: The patch should have a test before it goes in. As an aside, it's a bit disturbing that we apparently don't have any code already in our test-suite that exercises this case. -- ___ Python tracker

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-06 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-06 Thread Mark Dickinson
Mark Dickinson added the comment: Patch LGTM. Marking as high priority. -- nosy: +mark.dickinson priority: normal -> high ___ Python tracker ___

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-05 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: -> patch review type: behavior -> resource usage versions: +Python 2.7, Python 3.5 ___ Python tracker ___ _

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-05 Thread Patrick Miller
Patrick Miller added the comment: This is also in the 2.7.x branch. Same patch. -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-05 Thread Patrick Miller
Patrick Miller added the comment: Shout out to amaury for a much simpler recreator :-) Checked to see if the int conversion suffered the same problem... it does not as it is structured somewhat differently. Note that it DOES do the proper DECREF (missing in PyFloat_AsDouble). result = n

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Simple script to reproduce the issue: import sys, time class C(object): def __float__(self): return "" for x in range(1): try: time.sleep(C()) except TypeError: pass if x % 1000 == 0: print(sys.getrefcount("")) -- nosy:

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-05 Thread Patrick Miller
Patrick Miller added the comment: Here's a simple recreator... It returns a 100-meg string instead of a float. The memory is leaked each time through the loop -- Added file: http://bugs.python.org/file38343/recreate.tar ___ Python tracker

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-05 Thread Patrick Miller
New submission from Patrick Miller: There is a reference counting error in PyFloat_AsDouble. When the function calls the nb_float conversion, if the method does not return an actual float object, an exception is set, but the object is not collected. --- Objects/floatobject.c 2014-10-08 0