Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-117657: Fix QSBR race condition#118843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
colesbury merged 14 commits intopython:mainfromSonicField:main
May 10, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
14 commits
Select commitHold shift + click to select a range
f3a362d
gh-117657: initialize_new_array
SonicFieldMay 9, 2024
ec921f7
gh-118817: Fix `asyncio REPL` on Windows (#118819)
Eclips4May 9, 2024
154a3f5
gh-117657: Acquire a critical section around `SemLock.__{enter,exit}_…
mpageMay 9, 2024
a6bc4e3
gh-118773: Use language-invariant SDDL string instead of aliases for …
zoobaMay 9, 2024
63af4b5
gh-118849: Fix "code will never be executed" warning in `dictobject.c…
sobolevnMay 9, 2024
fa80517
gh-118561: Fix crash involving list.extend in free-threaded build (#1…
colesburyMay 9, 2024
e0bb384
gh-116984: Make mimalloc header includes relative to the current file…
colesburyMay 9, 2024
888d3d7
gh-118846: Fix PGO tests in free-threaded build (#118862)
colesburyMay 9, 2024
64a7f49
gh-117657: Replace TSAN suppresions with more specific rules (#118722)
swtaarrsMay 9, 2024
bb8677d
gh-118851: Default ctx arguments to AST constructors to Load() (#118854)
JelleZijlstraMay 9, 2024
9c4ae02
Revert "gh-115432: Add critical section variant that handles a NULL o…
colesburyMay 9, 2024
6502eb3
Docs: fix typos in documentation (GH-118815)
xybMay 10, 2024
1dff338
Merge branch 'python:main' into main
SonicFieldMay 10, 2024
0f901c9
gh-117657: initialize_new_array remove suppresion
SonicFieldMay 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionInclude/internal/pycore_qsbr.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -140,7 +140,7 @@ _Py_qsbr_register(struct _PyThreadStateImpl *tstate,

// Disassociates a PyThreadState from the QSBR state and frees the QSBR state.
extern void
_Py_qsbr_unregister(struct _PyThreadStateImpl *tstate);
_Py_qsbr_unregister(PyThreadState *tstate);

extern void
_Py_qsbr_fini(PyInterpreterState *interp);
Expand Down
2 changes: 1 addition & 1 deletionPython/pystate.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1785,7 +1785,7 @@ tstate_delete_common(PyThreadState *tstate)
HEAD_UNLOCK(runtime);

#ifdef Py_GIL_DISABLED
_Py_qsbr_unregister((_PyThreadStateImpl *)tstate);
_Py_qsbr_unregister(tstate);
#endif

// XXX Unbind in PyThreadState_Clear(), or earlier
Expand Down
11 changes: 6 additions & 5 deletionsPython/qsbr.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -231,20 +231,21 @@ _Py_qsbr_register(_PyThreadStateImpl *tstate, PyInterpreterState *interp,
}

void
_Py_qsbr_unregister(_PyThreadStateImpl *tstate)
_Py_qsbr_unregister(PyThreadState *tstate)
{
struct _qsbr_shared *shared = tstate->qsbr->shared;
struct _qsbr_shared *shared = &tstate->interp->qsbr;
struct _PyThreadStateImpl *tstate_imp = (_PyThreadStateImpl*) tstate;

PyMutex_Lock(&shared->mutex);
// NOTE: we must load (or reload) the thread state's qbsr inside the mutex
// because the array may have been resized (changing tstate->qsbr) while
// we waited to acquire the mutex.
struct _qsbr_thread_state *qsbr =tstate->qsbr;
struct _qsbr_thread_state *qsbr =tstate_imp->qsbr;

assert(qsbr->seq == 0 && "thread state must be detached");
assert(qsbr->allocated && qsbr->tstate ==(PyThreadState *)tstate);
assert(qsbr->allocated && qsbr->tstate == tstate);

tstate->qsbr = NULL;
tstate_imp->qsbr = NULL;
qsbr->tstate = NULL;
qsbr->allocated = false;
qsbr->freelist_next = shared->freelist;
Expand Down
1 change: 0 additions & 1 deletionTools/tsan/suppressions_free_threading.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,6 @@ race_top:_PyParkingLot_Park
race_top:_PyType_HasFeature
race_top:assign_version_tag
race_top:gc_restore_tid
race_top:initialize_new_array
race_top:insertdict
race_top:lookup_tp_dict
race_top:mi_heap_visit_pages
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp