Skip to content

Add GetByteSizeOverflow test for ValidateInputs overflow early-return path#476

Draft
Copilot wants to merge 2 commits intoyinggeh/tri-737-psirt-triton-inference-servercore-integer-overflowfrom
copilot/sub-pr-475
Draft

Add GetByteSizeOverflow test for ValidateInputs overflow early-return path#476
Copilot wants to merge 2 commits intoyinggeh/tri-737-psirt-triton-inference-servercore-integer-overflowfrom
copilot/sub-pr-475

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 26, 2026

Adds test coverage for the GetByteSize(...) == OVERFLOW_SIZE early-return path introduced in infer_request.cc::ValidateInputs, which was previously untested.

Changes

  • src/test/input_byte_size_test.cc — New GetByteSizeOverflow test in InputByteSizeTest:
    • Sets input shape {1, INT64_MAX/sizeof(float) + 1} on onnx_zero_1_float32: element count stays within int64_t range, but element_count * 4 overflows it
    • Provides a minimal 4-byte buffer — overflow is detected before the byte-size comparison, so no large allocation is required
    • Asserts TRITONSERVER_ServerInferAsync returns INVALID_ARG with the expected message substring
int64_t large_dim = static_cast<int64_t>(INT64_MAX / sizeof(float)) + 1;
std::vector<int64_t> shape{1, large_dim};  // GetByteSize overflows, GetElementCount does not

FAIL_TEST_IF_SUCCESS(
    TRITONSERVER_ServerInferAsync(server_, irequest_, nullptr),
    "expect error with byte size overflow",
    "' causes total byte size to exceed maximum size of ");

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: yinggeh <157551214+yinggeh@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on integer overflow fixes for APIs Add GetByteSizeOverflow test for ValidateInputs overflow early-return path Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants