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 first phase, in which we enable validation for repeated/map fields.

PiperOrigin-RevId: 542623187
pull/13127/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent bcf3e36a48
commit 6d79d13e47
  1. 4
      src/google/protobuf/port_def.inc

@ -862,11 +862,11 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
// TODO(b/280674214): enable these macros in phases. The phases are: repeated // TODO(b/280674214): enable these macros in phases. The phases are: repeated
// fields/maps, enum/primitive fields, string fields, message fields. // fields/maps, enum/primitive fields, string fields, message fields.
#define PROTOBUF_TSAN_READ_REPEATED(addr) #define PROTOBUF_TSAN_READ_REPEATED(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_READ_PRIMITIVE(addr) #define PROTOBUF_TSAN_READ_PRIMITIVE(addr)
#define PROTOBUF_TSAN_READ_STRING(addr) #define PROTOBUF_TSAN_READ_STRING(addr)
#define PROTOBUF_TSAN_READ_MESSAGE(addr) #define PROTOBUF_TSAN_READ_MESSAGE(addr)
#define PROTOBUF_TSAN_WRITE_REPEATED(addr) #define PROTOBUF_TSAN_WRITE_REPEATED(addr) PROTOBUF_TSAN_WRITE(addr)
#define PROTOBUF_TSAN_WRITE_PRIMITIVE(addr) #define PROTOBUF_TSAN_WRITE_PRIMITIVE(addr)
#define PROTOBUF_TSAN_WRITE_STRING(addr) #define PROTOBUF_TSAN_WRITE_STRING(addr)
#define PROTOBUF_TSAN_WRITE_MESSAGE(addr) #define PROTOBUF_TSAN_WRITE_MESSAGE(addr)

Loading…
Cancel
Save