[issue26811] segfault due to null pointer in tuple

2017-04-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1384 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue26811] segfault due to null pointer in tuple

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

[issue26811] segfault due to null pointer in tuple

2016-05-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset a98ef122d73d by Serhiy Storchaka in branch '3.5': Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL https://hg.python.org/cpython/rev/a98ef122d73d New changeset 3fe1c7ad3b58 by Serhiy Storchaka in branch 'default': Issue #26

[issue26811] segfault due to null pointer in tuple

2016-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be using _PyObject_GC_UNTRACK() is more correct than setting the size to 0 or setting the item to None. But property_descr_get_gc_untrack.patch makes the code a little slower. Here is optimized version of Victor's patch. -- Added file: http://bu

[issue26811] segfault due to null pointer in tuple

2016-04-21 Thread STINNER Victor
STINNER Victor added the comment: Oh, I see "The property() getter calls are up to 25% faster. (Contributed by Joe Jevnik in issue 23910.)" in https://docs.python.org/dev/whatsnew/3.5.html#optimizations Hum... This is embarrassing :-/ Ok, let's keep it, but we must fix it ;-) -- __

[issue26811] segfault due to null pointer in tuple

2016-04-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I suggest to remove the micro-optimization from Python 3.5 for safety. Then we should remove the promise from What's New In Python 3.5. That will cause a regression in namedtuple attributes access about 30%. --

[issue26811] segfault due to null pointer in tuple

2016-04-21 Thread STINNER Victor
STINNER Victor added the comment: I created the issue #26814: "Add a new _PyObject_CallStack() function which avoids the creation of a tuple or dict for arguments". -- ___ Python tracker __

[issue26811] segfault due to null pointer in tuple

2016-04-21 Thread STINNER Victor
STINNER Victor added the comment: I suggest to remove the micro-optimization from Python 3.5 for safety. I'm ok to experiment a new safer implementation on Python 3.6 ;-) We have more time to fix the code in Python 3.6 if new issues are found. Setting the tuple size to zero looks simple and sa

[issue26811] segfault due to null pointer in tuple

2016-04-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: References: Issue23910 -- added original optimization (661cdbd617b8). Issue24276 -- it was significant rewritten (5dbf3d932a59). My suggestion in msg263886 to revert the optimization was related to the original code. Now, after reminding the background, I th

[issue26811] segfault due to null pointer in tuple

2016-04-21 Thread STINNER Victor
STINNER Victor added the comment: > Maybe a new C function can be designed to call a function: it would uses > PyEval_EvalCodeEx() to call functions implemented in Python, or create the > tuple for functions implemented in C. I would expect C code to be more optimized that Python functions, bu

[issue26811] segfault due to null pointer in tuple

2016-04-21 Thread STINNER Victor
STINNER Victor added the comment: Serhiy: "Ah, yes, 5dbf3d932a59 partially fixed this optimization." Since we already talking about hacks, another hack is to hide this private tuple from the GC using _PyObject_GC_UNTRACK(): see attached property_descr_get_gc_untrack.patch. Note: I dislike my

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I'm late with my comments. All my posts are written without seeing your previous message. -- ___ Python tracker ___ __

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, yes, 5dbf3d932a59 partially fixed this optimization. Saving None in a tuple (as I believe done in itertools/zip/enumerate optimization) should fix this issue. I agree that the code is too tricky (as well as the code in itertools/zip/enumerate). It would

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur. Please do the honors and revert it from 3.5 and 3.6. -- assignee: rhettinger -> serhiy.storchaka ___ Python tracker ___ __

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> high ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 661cdbd617b8 can cause problems with recursion and with cached getters. I suggest to revert it. -- ___ Python tracker ___ ___

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Also, see https://hg.python.org/cpython/rev/5dbf3d932a59 Serhiy, I'll thinking the whole optimization ought to be reverted as being too tricky and error-prone for the small benefit. A less aggressive approach would be to have the tuple save a valid object

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Xiang Zhang
Xiang Zhang added the comment: hg bisect tells me changeset 95830:661cdbd617b8 introduces this behaviour. -- nosy: +xiang.zhang type: crash -> ___ Python tracker ___ ___

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +brett.cannon, eric.snow, ncoghlan, serhiy.storchaka type: -> crash ___ Python tracker ___ ___

[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread random832
New submission from random832: I was writing something that iterates over all objects in gc.get_objects(). I don't know precisely where the offending tuple is coming from, but nearby objects in gc.get_objects() appear to be related to frozen_importlib. A tuple exists somewhere with a null poin