Skip to content

Commit b8d808d

Browse files
authored
GH-112536: Add more TSan tests (#116911)
These may all exercise some non-trivial aspects of thread synchronization.
1 parent 649857a commit b8d808d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Lib/test/libregrtest/tsan.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# chosen because they use threads and run in a reasonable amount of time.
33

44
TSAN_TESTS = [
5+
# TODO: enable more of test_capi once bugs are fixed (GH-116908, GH-116909).
6+
'test_capi.test_mem',
7+
'test_capi.test_pyatomic',
58
'test_code',
69
'test_enum',
710
'test_functools',
@@ -11,6 +14,9 @@
1114
'test_io',
1215
'test_logging',
1316
'test_queue',
17+
'test_signal',
18+
'test_socket',
19+
'test_sqlite3',
1420
'test_ssl',
1521
'test_syslog',
1622
'test_thread',

Modules/_testinternalcapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,8 +1287,8 @@ check_pyobject_forbidden_bytes_is_freed(PyObject *self,
12871287
static PyObject *
12881288
check_pyobject_freed_is_freed(PyObject *self, PyObject *Py_UNUSED(args))
12891289
{
1290-
/* This test would fail if run with the address sanitizer */
1291-
#ifdef _Py_ADDRESS_SANITIZER
1290+
/* ASan or TSan would report an use-after-free error */
1291+
#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER)
12921292
Py_RETURN_NONE;
12931293
#else
12941294
PyObject *op = PyObject_CallNoArgs((PyObject *)&PyBaseObject_Type);

0 commit comments

Comments
 (0)