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

Data race infunctools.partial in Python 3.14 #143880

Closed
Labels
@colesbury

Description

@colesbury

Bug report

Seen by@ngoldbaum in NumPy innumpy/numpy#30653 (comment)

WARNING: ThreadSanitizer: data race (pid=15392)  Read of size 8 at 0x00010b6de6f8 by thread T325:    #0 object_vacall call.c:820 (libpython3.14t.dylib:arm64+0x8e0f4)    #1 PyObject_CallFunctionObjArgs call.c:927 (libpython3.14t.dylib:arm64+0x8e49c)    #2 array_str <null> (_multiarray_umath.cpython-314t-darwin.so:arm64+0x254dd8)    #3 PyObject_Str object.c:822 (libpython3.14t.dylib:arm64+0x13834c)...  Previous write of size 8 at 0x00010b6de6f8 by thread T327:    #0 partial_vectorcall_fallback _functoolsmodule.c:378 (libpython3.14t.dylib:arm64+0x424f94)    #1 partial_vectorcall _functoolsmodule.c:393 (libpython3.14t.dylib:arm64+0x4248dc)    #2 object_vacall call.c:820 (libpython3.14t.dylib:arm64+0x8e110)    #3 PyObject_CallFunctionObjArgs call.c:927 (libpython3.14t.dylib:arm64+0x8e49c)

The relevant code is:

Py_NO_INLINEstaticPyObject*
partial_vectorcall_fallback(PyThreadState*tstate,partialobject*pto,
PyObject*const*args,size_tnargsf,
PyObject*kwnames)
{
pto->vectorcall=NULL;
Py_ssize_tnargs=PyVectorcall_NARGS(nargsf);
return_PyObject_MakeTpCall(tstate, (PyObject*)pto,args,nargs,kwnames);
}

The assignemntpto->vectorcall = NULL leads to a data race in the free threading build.

This is fixed in main. We should fix it in 3.14 by guarding that assignment with an#ifndef Py_GIL_DISABLED

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp