[PATCH] D114487: [LAA] Support runtime checks for select GEP base pointers.

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 16:57:32 PDT 2022


vitalybuka added a comment.

In D114487#3547560 <https://reviews.llvm.org/D114487#3547560>, @fhahn wrote:

> In D114487#3546674 <https://reviews.llvm.org/D114487#3546674>, @vitalybuka wrote:
>
>> I will continue to minimize the reproducer.
>> Should we revert the patch, because it breaks Msan and maybe there is a chance the bounds are calculated incorrectly?
>
> Thanks for the report, I'll take a look. I already have suspicion of what's going wrong.

My current reproducer is

  #include "third_party/absl/container/flat_hash_map.h"
  #include "third_party/tensorflow/core/framework/tensor.h"
  
  int main() {
    absl::flat_hash_map<std::string, int> ids_map;
    std::vector<std::string> ids = {"1405217"};
    int d = 0;
    tensorflow::Tensor tensor(tensorflow::DataTypeToEnum<float>::v(),
                              {1, 20, 50, 1});
    tensor.flat<float>().setConstant(0);
  
    auto tm = tensor.tensor<float, 4>();
    int i = 0;
    for (const auto& other_agent_id : ids) {
      auto it = ids_map.find(other_agent_id);
      const int& f = it != ids_map.end() ? it->second : d;
      for (int j = 0; j < 50; ++j) {
        tm(0, i, j, 0) = f;
      }
      ++i;
    }
  }

Not sure if it's helpful, as it requires TF with dependencies build with msan:
-O2 -fsanitize=memory -fsanitize-memory-param-retval -fsanitize-memory-use-after-dtor

> Hopefully I'll be able to write up a test case & fix today. If not, we can revert tomorrow.

Thanks, revert will help, as out internal release is blocked on this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114487/new/

https://reviews.llvm.org/D114487



More information about the llvm-commits mailing list