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 second phase, in which we enable validation for enum/primitive fields.

PiperOrigin-RevId: 543475296
pull/13142/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent f10e56cbe1
commit 80dbc50118
  1. 4
      src/google/protobuf/port_def.inc

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

Loading…
Cancel
Save