]> granicus.if.org Git - python/commit
Make (most of) Python's tests pass under Thread Sanitizer.
authorJeffrey Yasskin <jyasskin@gmail.com>
Mon, 3 May 2010 19:29:34 +0000 (19:29 +0000)
committerJeffrey Yasskin <jyasskin@gmail.com>
Mon, 3 May 2010 19:29:34 +0000 (19:29 +0000)
commit39370830a96068ecbad006fe38fdb13107d8cd6b
tree80469ca84c0bf45573c3a83bfd8b7adca6cb97b0
parent6be8876623ffab3f2d1e4af46e7ce169d84b35a6
Make (most of) Python's tests pass under Thread Sanitizer.

http://code.google.com/p/data-race-test/wiki/ThreadSanitizer is a dynamic data
race detector that runs on top of valgrind. With this patch, the binaries at
http://code.google.com/p/data-race-test/wiki/ThreadSanitizer#Binaries pass many
but not all of the Python tests. All of regrtest still passes outside of tsan.

I've implemented part of the C1x atomic types so that we can explicitly mark
variables that are used across threads, and get defined behavior as compilers
advance.

I've added tsan's client header and implementation to the codebase in
dynamic_annotations.{h,c} (docs at
http://code.google.com/p/data-race-test/wiki/DynamicAnnotations).
Unfortunately, I haven't been able to get helgrind and drd to give sensible
error messages, even when I use their client annotations, so I'm not supporting
them.
17 files changed:
Include/Python.h
Include/dynamic_annotations.h [new file with mode: 0644]
Include/pyatomic.h [new file with mode: 0644]
Include/pystate.h
Makefile.pre.in
Objects/dictobject.c
PC/VS7.1/pythoncore.vcproj
PC/VS8.0/pythoncore.vcproj
PC/os2emx/Makefile
PCbuild/pythoncore.vcproj
Python/ceval.c
Python/ceval_gil.h
Python/dynamic_annotations.c [new file with mode: 0644]
Python/pystate.c
Python/thread_pthread.h
configure
configure.in