Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-100149

Disable sandboxing on protobuf compiler actions when TSAN is enabled

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Build
    • Fully Compatible

      Disable sandboxing on protobuf compiler actions when TSAN is enabled to avoid an assert from getting hit inside TSAN's initialization when trying to disable ASLR.

      Steps:

      1. The linux execution domain configuration function personality is returning -1 here inside tsan while it's trying to disable ASLR, likely because the personality function is not compatible with Bazel's sandbox
      2. The proto compiler action runner was ignoring the env variables I set in our custom compiled proto_compiler when trying to disable TSAN on protoc
      3. I went into the generate_cc grpc source code to find the runner and threaded in the TSAN_OPTIONS flag to disable bug reporting
      4. Unfortunately this wasn't enough since the error we're running into is an assert, and that assert gets his effectively unconditionally whenever TSAN is linked into a binary
      5. Instead I modified the grpc source code to disable Bazel sandboxing on the proto compiler action, which fixed the issue

      https://jira.mongodb.org/browse/SERVER-100148 is the followup work to rely on an external bazel repo instantiation for the proto cpp plugin, that way we can only enable TSAN on our internal libraries, disabling it in the proto compiler from the external repository.

            Assignee:
            zack.winter@mongodb.com Zack Winter
            Reporter:
            zack.winter@mongodb.com Zack Winter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: