[issue24257] Incorrect use of PyObject_IsInstance

2015-05-22 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue24257] Incorrect use of PyObject_IsInstance

2015-05-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset bccaba8a5482 by Serhiy Storchaka in branch '2.7': Issue #24257: Fixed segmentation fault in sqlite3.Row constructor with faked https://hg.python.org/cpython/rev/bccaba8a5482 New changeset c7b9645a6f35 by Serhiy Storchaka in branch '3.4': Issue #2425

[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy, go ahead and apply your patch. The existing code is clearly wrong. -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it is the case that if the current check passes incorrectly one will always get a segfauilt or other error. Added tests for types.SimpleNamespace and sqlite3.Cursor. It is not easy to reproduce a bug for StopIterator (not sure it is reproducible), but t

[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: > is it the case that if the current check passes incorrectly > one will always get a segfauilt or other error? Yes, that is the case. All four of these checks precede a reference to an structure member that depends on being an exact type or subtype. So,

[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread R. David Murray
R. David Murray added the comment: Is there any chance that these changes will break working code, or is it the case that if the current check passes incorrectly one will always get a segfauilt or other error? -- nosy: +r.david.murray ___ Python tra

[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: PyObject_IsInstance() is used incorrectly for testing if Python object is an instance of specified builtin type before direct access to internals of object. This is not correct, because PyObject_IsInstance() checks the __class__ attribute that can be modif