Skip to content

Commit

Permalink
Enable TSan validation to detect when a mutable accessor of a message…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Jun 22, 2023
1 parent bcf3e36 commit 6d79d13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/google/protobuf/port_def.inc
Original file line number Diff line number Diff line change
Expand Up @@ -862,11 +862,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)
#define PROTOBUF_TSAN_READ_REPEATED(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_READ_PRIMITIVE(addr)
#define PROTOBUF_TSAN_READ_STRING(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_STRING(addr)
#define PROTOBUF_TSAN_WRITE_MESSAGE(addr)
Expand Down

0 comments on commit 6d79d13

Please sign in to comment.