|
Meta tags:
description=The optimization that avoided allocating an info dict when no gc callbacks were registered introduces a time of check to time of use race in free threaded mode (lineno 1943-1955). I just pulled out the check. Since info is always non-null, I also replaced XDECREF use with DECREF. (lineno 1959, lineno 1982).
I implemented a stress test for this and uncovered what I believe to be a bug with _PyList_GetItemRef. I am following suit with python/cpython#149909 and not including the test with my PR for two reasons:
My implementation was resource intensive and not deterministic.
I didn t want to scope creep fixing the bug with _PyList_GetItemRef (but I m happy to open an issue for it!)
also, this is my first PR against CPython, I am doing it from PyCon US as part of the sprint! :) Hello world!
Issue: gh-149816;
Headings (most frequently used words):
uh, oh, navigation, gh, 149816, 96, fix, race, condition, in, invoke_gc_callback, with, free, threading, 150029, footer, diff, view, menu, repository, there, are, no, files, selected, for, viewing, filter, by, extension,
Text of the page (most frequently used words):
file (25), github (16), and (15), this (14), for (14), while (13), the (13), 149816 (13), 2026 (12), line (12), callbacks (12), applied (11), info (11), that (9), all (9), reload (9), expand (9), show (9), hidden (9), characters (9), unicode (9), threading (9), cannot (8), diff (8), dzaramelcone (8), you (7), suggestion (7), suggestions (7), code (7), changes (7), loading (7), invoke_gc_callback (7), null (7), include (7), open (7), race (7), with (7), sign (7), from (6), pyobject (6), gcstate (6), number (6), bidirectional (6), may (6), python (6), free (6), security (5), please (5), merge (5), comments (5), there (5), learn (5), about (5), view (5), fix (5), issue (5), thread (5), def (5), import (5), main (5), into (5), commits (5), your (5), can (4), time (4), not (4), pull (4), change (4), add (4), was (4), error (4), page (4), down (4), py_decref (4), phase_obj (4), pyerr_formatunraisable (4), exception (4), ignored (4), return (4), duration (4), candidates (4), uncollectable (4), collected (4), generation (4), what (4), review (4), more (4), next (4), rst (4), another (4), stop (4), test (4), files (4), branch (4), condition (4), support (4), copilot (4), community (3), navigation (3), request (3), batch (3), commit (3), retry (3), tstate (3), phase (3), pylist_get_size (3), invoking (3), original (3), contains (3), text (3), interpreted (3), compiled (3), differently (3), than (3), appears (3), below (3), editor (3), reveals (3), desktop (3), delete (3), edit (3), gc_free_threading (3), additions (3), deletions (3), misc (3), news (3), core_and_builtins (3), v18ypf (3), wait (3), threads (3), collect (3), lib (3), test_free_threading (3), test_gc (3), hide (3), whitespace (3), nbsp (3), filter (3), jul (3), 150029 (3), merged (3), account (3), quality (3), tab (3), window (3), refresh (3), session (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), build (3), contact (2), status (2), privacy (2), terms (2), footer (2), check (2), single (2), one (2), viewing (2), toggle (2), assert (2), py_xdecref (2), pythreadstate (2), const (2), char (2), stack (2), _pylist_getitemref (2), py_buildvalue (2), sisnsnsnsd (2), self (2), sleep (2), event (2), mutate (2), clear (2), range (2), is_set (2), selected (2), apply (2), split (2), unified (2), failed (2), load (2), jump (2), extension (2), encukou (2), aug (2), callback (2), select (2), tree (2), insights (2), projects (2), actions (2), repository (2), cpython (2), signed (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), business (2), fixes (2), products (2), secret (2), perform, action, share, personal, information, manage, cookies, docs, inc, right, now, back, later, queued, multi, pending, reviews, has, been, marked, resolved, outdated, must, existing, order, create, valid, applying, deleted, lines, supported, only, per, subset, closed, invalid, because, were, made, annotations, notes, oops, something, went, wrong, _pyerr_occurred, 1978, 1982, pyobject_vectorcall, break, pylistobject, py_incref, make, sure, doesn, away, pylist_get_item, py_ssize_t, pyunicode_fromstring, pylist_checkexact, local, variable, rebound, sanity, 1940, 1941, pycore_tstate, _pythreadstateimpl, pycore_pystate, _pythreadstate_get, pycore_object_alloc, _pyobject_mallocwithtype, pycore_list, pycore_interpframe, _pyframe_getlocalsarray, pycore_interp, pyinterpreterstate, pycore_initconfig, _pystatus_no_memory, mode, conditions, iterating, between, gc_should_collect, gc_set_threshold, functions, 148613, setting, threshold, could, cause, test_set_threshold, threading_helper, start_threads, set, barrier, len, target, lambda, test_gc_callbacks_race_with_mutation, join, start, evil, unittest, testcase, are, conversations, filters, viewed, types, 73d0954, f67ea2b, avoid, allocating, empty, list, 062d75a, a33bd91, 5c71bc1, mutation, regression, c2b7dbe, 2306df8, hold, shift, click, changed, checks, conversation, already, clicking, agree, our, occasionally, send, related, emails, statement, service, its, maintainers, have, question, project, new, items, requests, issues, message, dismiss, alert, switched, accounts, out, appearance, settings, search, pricing, talks, workshops, partners, company, forum, events, webinars, blog, resource, connect, resources, premium, advanced, ons, trust, why, evaluate, see, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, team, enterprises, stage, businesses, source, latest, improvements, across, place, developer, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, detection, remediation, secure, cloud, development, environments, codespaces, analysis, enforcement, automation, ship, coding, agent, tasks, automated, work, hosting, collaboration, platform, menu, skip, content,
|