[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2019-10-08 Thread Yury Selivanov
Yury Selivanov added the comment: > In bpo-38392, I modified PyObject_GC_Track() in debug mode to detect this bug. Awesome!!! -- ___ Python tracker ___ __

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2019-10-08 Thread STINNER Victor
STINNER Victor added the comment: Notes for myself. In bpo-38392, I modified PyObject_GC_Track() in debug mode to detect this bug. For example, this bug can be reproduced with this change: --- diff --git a/Python/hamt.c b/Python/hamt.c index 28b4e1ef6c..d7dd555d15 100644 --- a/Python/hamt.c +

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-08-30 Thread Berker Peksag
Change by Berker Peksag : -- type: enhancement -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-08-30 Thread ernest ruiz
Change by ernest ruiz : -- type: crash -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-08 Thread STINNER Victor
STINNER Victor added the comment: FYI the bug was also seen 8 hours ago on a different asyncio PR: https://github.com/python/cpython/pull/423#issuecomment-395681351 -- ___ Python tracker

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-08 Thread STINNER Victor
STINNER Victor added the comment: > FYI the bug was also seen 8 hours ago on a different asyncio PR: Oops, my message is misleading: the crash is not a regression. I just wanted to notice that a different PR also triggered the crash before the crash has been fixed. I'm just surprised that th

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-08 Thread STINNER Victor
STINNER Victor added the comment: > I'd love to have a flag to turn this on, or maybe we should enable it for -X > dev. Well, there is already a public API to do it manually: gc.set_threshold(5). I'm not sure about a threshold of 5 for -X dev: that's very very low and so kill performances.

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread Yury Selivanov
Yury Selivanov added the comment: > +if (core_config->dev_mode) { > +_PyRuntime.gc.generations[0].threshold = 5; > +} I'd love to have a flag to turn this on, or maybe we should enable it for -X dev. -- ___ Python tracker

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset a971a6fdb111bb62911ccf45aa9fe734e2e7a590 by Yury Selivanov (Miss Islington (bot)) in branch '3.7': bpo-33803: Fix a crash in hamt.c (GH-7504) (GH-7505) https://github.com/python/cpython/commit/a971a6fdb111bb62911ccf45aa9fe734e2e7a590 -

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread miss-islington
Change by miss-islington : -- pull_requests: +7133 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 378c53cc3187dba57c7560ccc2557f516c8a7bc8 by Yury Selivanov in branch 'master': bpo-33803: Fix a crash in hamt.c (#7504) https://github.com/python/cpython/commit/378c53cc3187dba57c7560ccc2557f516c8a7bc8 -- _

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks Victor for debugging this. I made a PR (which is now trivial) and double checked all other calls to GCTrack in context.c & hamt.c. -- ___ Python tracker ___

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +7132 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread STINNER Victor
STINNER Victor added the comment: Don't forget to merge https://github.com/python/cpython/pull/7487 once this bug is fixed. I would like to see https://bugs.python.org/issue33792 in Python 3.7 *if possible* (the feature now seems "required" for the new asyncio.loop() function). --

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread STINNER Victor
STINNER Victor added the comment: One solution to trigger so crash more frequently is to reduce the threshold of the generation 0 of the garbage collector. Here is a patch to do that when using -X dev: change the default threshold from 700 to 5 for the generation 0. With this patch, "PYTHON

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-06-07 Thread STINNER Victor
New submission from STINNER Victor : test_asyncio started to crash in https://github.com/python/cpython/pull/7487 I debugged the crash with Yury: _PyHAMT_New() triggers indirectly a GC collection at "o->h_root = hamt_node_bitmap_new(0);". Problem: the object that is being created is already t