A.M. Kuchling added the comment:
I believe the most recent 2 commits fix the segfault problem, so I'll now close
this again. Please re-open if there are further issues with the bugfix.
--
resolution: - fixed
stage: commit review - committed/rejected
status: open - closed
Roundup Robot added the comment:
New changeset 99733ff98a50 by Andrew Kuchling in branch '2.7':
#18113: avoid segfault if Py_XDECREF triggers code that calls set_panel_userptr
again
http://hg.python.org/cpython/rev/99733ff98a50
--
___
Python tracker
Roundup Robot added the comment:
New changeset 61fafef4c8a2 by Andrew Kuchling in branch '3.3':
#18113: avoid segfault if Py_XDECREF triggers code that calls set_panel_userptr
again
http://hg.python.org/cpython/rev/61fafef4c8a2
--
___
Python tracker
Serhiy Storchaka added the comment:
I've attached a new version of the patch that does this check, and also adds
a test.
You are right. Your patch LGTM.
(OTOH, looking at the ncurses 5.9 source code, set_panel_userptr() only
returns an error if the panel object is NULL, which should
Serhiy Storchaka added the comment:
There is a problem with this patch. Py_XDECREF can execute arbitrary Python
code and this code can call set_panel_userptr. Here is a reproducer (it causes
segfault).
--
resolution: fixed -
stage: committed/rejected - commit review
status: closed -
Serhiy Storchaka added the comment:
And here is a patch which fixes a segfault. But I can't write a test for it.
--
keywords: +patch
Added file: http://bugs.python.org/file30607/userptr_segfault.patch
___
Python tracker rep...@bugs.python.org
A.M. Kuchling added the comment:
serhiy.storchaka: good point! I wonder if, for strict correctness, we should
only incref obj (the new object) if set_panel_userptr() returns OK and not an
error code. I've attached a new version of the patch that does this check, and
also adds a test.
Changes by A.M. Kuchling li...@amk.ca:
--
nosy: +akuchling
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18113
___
___
Python-bugs-list mailing
Roundup Robot added the comment:
New changeset aff0bdab358e by Andrew Kuchling in branch '2.7':
#18113: Objects associated to a curses.panel object with set_userptr() were
leaked.
http://hg.python.org/cpython/rev/aff0bdab358e
--
nosy: +python-dev
Roundup Robot added the comment:
New changeset 3d75bd69e5a9 by Andrew Kuchling in branch '3.3':
#18113: Objects associated to a curses.panel object with set_userptr() were
leaked.
http://hg.python.org/cpython/rev/3d75bd69e5a9
--
___
Python tracker
Changes by A.M. Kuchling li...@amk.ca:
--
stage: needs patch - committed/rejected
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18113
___
___
A.M. Kuchling added the comment:
Thanks for the bug report! I've committed a fix to the 2.7 and 3.3 branches
that retrieves the existing userptr and Py_DECREFs it if it's not null. This
seems to fix the leak.
--
assignee: - akuchling
resolution: - fixed
status: open - closed
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18113
___
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
components: +Extension Modules
keywords: +easy
nosy: +serhiy.storchaka
stage: - needs patch
type: - behavior
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
New submission from Atsuo Ishimoto:
Objects associated to the panel with panel.set_userptr() are never DECREF()ed.
Attached file is script to reproduce the leak.
Confirmed with Python2.7/3.3.
--
files: userptr-leak.py
messages: 190433
nosy: ishimoto
priority: normal
severity: normal
15 matches
Mail list logo