-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Seen when running locally. We should use the ptr_wise_atomic_memmove from listobject.c.
WARNING: ThreadSanitizer: data race (pid=833878)
Write of size 8 at 0x7fffb57ba460 by thread T10318:
#0 __tsan_memcpy <null> (python+0xf4b62) (BuildId: 62048a720cd5edc7e743b66781182a91a8a5cb4a)
#1 set_swap_bodies /home/sgross/cpython/Objects/setobject.c:1465:9 (python+0x396739) (BuildId: 62048a720cd5edc7e743b66781182a91a8a5cb4a)
#2 set_intersection_update /home/sgross/cpython/Objects/setobject.c:1740:5 (python+0x391a91) (BuildId: 62048a720cd5edc7e743b66781182a91a8a5cb4a)
#3 set_iand /home/sgross/cpython/Objects/setobject.c:1795:14 (python+0x391a91)
...
Previous atomic read of size 8 at 0x7fffb57ba460 by thread T10317:
#0 _Py_atomic_load_ptr_acquire /home/sgross/cpython/./Include/cpython/pyatomic_gcc.h:557:18 (python+0x38bb7c) (BuildId: 62048a720cd5edc7e743b66781182a91a8a5cb4a)
#1 set_compare_threadsafe /home/sgross/cpython/Objects/setobject.c:100:26 (python+0x38bb7c)
#2 set_do_lookup /home/sgross/cpython/Objects/setobject.c:234:22 (python+0x38bb7c)
#3 set_lookkey_threadsafe /home/sgross/cpython/Objects/setobject.c:452:14 (python+0x38bb7c)
#4 set_contains_entry /home/sgross/cpython/Objects/setobject.c:566:12 (python+0x38bb7c)
Lines 1463 to 1467 in 6536fab
| if (a_table == a->smalltable || b_table == b->smalltable) { | |
| memcpy(tab, a->smalltable, sizeof(tab)); | |
| memcpy(a->smalltable, b->smalltable, sizeof(tab)); | |
| memcpy(b->smalltable, tab, sizeof(tab)); | |
| } |
Lines 96 to 100 in 6536fab
| static inline Py_ALWAYS_INLINE int | |
| set_compare_threadsafe(PySetObject *so, setentry *table, setentry *ep, | |
| PyObject *key, Py_hash_t hash) | |
| { | |
| PyObject *startkey = FT_ATOMIC_LOAD_PTR_ACQUIRE(ep->key); |
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error