Skip to content

Commit

Permalink
Temporary enable flatbuffer verification assertion to investigate a c…
Browse files Browse the repository at this point in the history
…rash on Windows.

PiperOrigin-RevId: 679034841
  • Loading branch information
tensorflower-gardener committed Sep 26, 2024
1 parent 53436d1 commit c26670c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tensorflow/compiler/mlir/lite/core/model_builder_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,15 @@ class FlatBufferModelBase {
size_t allocation_size =
std::min(allocation->bytes(),
static_cast<size_t>(FLATBUFFERS_MAX_BUFFER_SIZE - 1));
flatbuffers::Verifier::Options options;
// TODO(b/366118885): Remove after the root cause of the crash on Windows
// is found.
#if defined(_WIN32)
options.assert = true;
#endif
flatbuffers::Verifier base_verifier(
reinterpret_cast<const uint8_t*>(allocation->base()),
allocation_size);
reinterpret_cast<const uint8_t*>(allocation->base()), allocation_size,
options);
if (!VerifyModelBuffer(base_verifier)) {
TF_LITE_REPORT_ERROR(error_reporter,
"The model is not a valid Flatbuffer buffer");
Expand Down

0 comments on commit c26670c

Please sign in to comment.