Skip to content

Commit

Permalink
pythonGH-112536: Add more TSan tests (python#116911)
Browse files Browse the repository at this point in the history
These may all exercise some non-trivial aspects of thread synchronization.
  • Loading branch information
pitrou authored and vstinner committed Mar 20, 2024
1 parent 1ccbc3d commit 89e1e57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Lib/test/libregrtest/tsan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# chosen because they use threads and run in a reasonable amount of time.

TSAN_TESTS = [
# TODO: enable more of test_capi once bugs are fixed (GH-116908, GH-116909).
'test_capi.test_mem',
'test_capi.test_pyatomic',
'test_code',
'test_enum',
'test_functools',
Expand All @@ -11,6 +14,9 @@
'test_io',
'test_logging',
'test_queue',
'test_signal',
'test_socket',
'test_sqlite3',
'test_ssl',
'test_syslog',
'test_thread',
Expand Down
4 changes: 2 additions & 2 deletions Modules/_testinternalcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,8 +1287,8 @@ check_pyobject_forbidden_bytes_is_freed(PyObject *self,
static PyObject *
check_pyobject_freed_is_freed(PyObject *self, PyObject *Py_UNUSED(args))
{
/* This test would fail if run with the address sanitizer */
#ifdef _Py_ADDRESS_SANITIZER
/* ASan or TSan would report an use-after-free error */
#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER)
Py_RETURN_NONE;
#else
PyObject *op = PyObject_CallNoArgs((PyObject *)&PyBaseObject_Type);
Expand Down

0 comments on commit 89e1e57

Please sign in to comment.