Skip to content

Commit 0275e51

Browse files
Enable TSan validation to detect when a mutable accessor of a message is called concurrently with another accessor on the same message, which is a data race.
This is the fourth phase, in which we enable validation for message fields. PiperOrigin-RevId: 545695188
1 parent 532d2a2 commit 0275e51

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/google/protobuf/port_def.inc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -860,16 +860,15 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
860860
#define PROTOBUF_TSAN_DECLARE_MEMBER
861861
#endif
862862

863-
// TODO(b/280674214): enable these macros in phases. The phases are: repeated
864-
// fields/maps, enum/primitive fields, string fields, message fields.
863+
// TODO(b/280674214): cleanup these macros.
865864
#define PROTOBUF_TSAN_READ_REPEATED(addr) PROTOBUF_TSAN_READ(addr)
866865
#define PROTOBUF_TSAN_READ_PRIMITIVE(addr) PROTOBUF_TSAN_READ(addr)
867866
#define PROTOBUF_TSAN_READ_STRING(addr) PROTOBUF_TSAN_READ(addr)
868-
#define PROTOBUF_TSAN_READ_MESSAGE(addr)
867+
#define PROTOBUF_TSAN_READ_MESSAGE(addr) PROTOBUF_TSAN_READ(addr)
869868
#define PROTOBUF_TSAN_WRITE_REPEATED(addr) PROTOBUF_TSAN_WRITE(addr)
870869
#define PROTOBUF_TSAN_WRITE_PRIMITIVE(addr) PROTOBUF_TSAN_WRITE(addr)
871870
#define PROTOBUF_TSAN_WRITE_STRING(addr) PROTOBUF_TSAN_WRITE(addr)
872-
#define PROTOBUF_TSAN_WRITE_MESSAGE(addr)
871+
#define PROTOBUF_TSAN_WRITE_MESSAGE(addr) PROTOBUF_TSAN_WRITE(addr)
873872

874873
#ifdef PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION
875874
#error PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION was previously defined

0 commit comments

Comments
 (0)