ODR violation for Validator<BSONObj>

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • Fully Compatible
    • ALL
    • N&O 2026-07-20
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      `grpc_session.cpp` includes `data_type_validated.h` to import the `Validator<>` template class, but this class has no generic implementation, and is expected to specialize an implementation later.

      When modifying the specialized implementation of `Validator<BSONObj>`, LTO builds caused this function to become inlined. Because `grpc_session.cpp` does not include `object_check.h` explicitly, this specialization is only weakly linked if it is instantiated somewhere else. This is technically an ODR violation, but in practice is a wider issue with how `Validator` is defined (by enforcing checks at link time rather than compile time)

            Assignee:
            Alexander Ambrose
            Reporter:
            Alexander Ambrose
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: