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
pull/13210/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent 532d2a2480
commit 0275e51622
  1. 7
      src/google/protobuf/port_def.inc

@ -860,16 +860,15 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
#define PROTOBUF_TSAN_DECLARE_MEMBER
#endif
// TODO(b/280674214): enable these macros in phases. The phases are: repeated
// fields/maps, enum/primitive fields, string fields, message fields.
// TODO(b/280674214): cleanup these macros.
#define PROTOBUF_TSAN_READ_REPEATED(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_READ_PRIMITIVE(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_READ_STRING(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_READ_MESSAGE(addr)
#define PROTOBUF_TSAN_READ_MESSAGE(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_WRITE_REPEATED(addr) PROTOBUF_TSAN_WRITE(addr)
#define PROTOBUF_TSAN_WRITE_PRIMITIVE(addr) PROTOBUF_TSAN_WRITE(addr)
#define PROTOBUF_TSAN_WRITE_STRING(addr) PROTOBUF_TSAN_WRITE(addr)
#define PROTOBUF_TSAN_WRITE_MESSAGE(addr)
#define PROTOBUF_TSAN_WRITE_MESSAGE(addr) PROTOBUF_TSAN_WRITE(addr)
#ifdef PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION
#error PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION was previously defined

Loading…
Cancel
Save