Skip to content

[litertlm] Fix stat() overflow for large models on Windows in LiteRT-LM JNI#2147

Merged
copybara-service[bot] merged 1 commit intomainfrom
litert_lm_pr_908868048
May 1, 2026
Merged

[litertlm] Fix stat() overflow for large models on Windows in LiteRT-LM JNI#2147
copybara-service[bot] merged 1 commit intomainfrom
litert_lm_pr_908868048

Conversation

@copybara-service
Copy link
Copy Markdown
Contributor

[litertlm] Fix stat() overflow for large models on Windows in LiteRT-LM JNI

Replaced raw stat() calls with FileExists utility from file_util.h in litertlm.cc.
stat() defaults to a 32-bit version on Windows (with UCRT/MSVCRT) which fails for files larger than 2GB (returning EOVERFLOW).

The FileExists utility uses std::filesystem::exists which is 64-bit safe.

Also updated BUILD file to depend on //third_party/odml/litert_lm/runtime/util:file_util.

Fixes #2000.

@copybara-service copybara-service Bot force-pushed the litert_lm_pr_908868048 branch from 1f4b078 to 5d97a47 Compare May 1, 2026 20:59
LiteRT-LM-PiperOrigin-RevId: 908892173
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] JVM SDK fails for models > 2 GB — stat() in nativeCreateEngine / nativeCreateBenchmark hits MSVCRT 32-bit overflow

1 participant