You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jmestwa-coder (via GitHub)" <gi...@apache.org> on 2026/05/25 17:47:59 UTC
[PR] MINOR: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
jmestwa-coder opened a new pull request, #50038:
URL: https://github.com/apache/arrow/pull/50038
ReadSparseCSXIndex sizes its indices/indptr buffer checks with `non_zero_length * byte_width` and `(shape + 1) * byte_width` in int64, but both come straight from the SparseTensor flatbuffer via GetSparseTensorMetadata. A non_zero_length near INT64_MAX wraps the product, so the size guard passes and the index Tensor is built over a buffer smaller than its shape. Use the checked helpers from tensor.cc.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50077: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #50038:
URL: https://github.com/apache/arrow/pull/50038#issuecomment-4797443324
@rok Can you take a look here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50077: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #50038:
URL: https://github.com/apache/arrow/pull/50038#discussion_r3345228026
##########
cpp/src/arrow/ipc/reader.cc:
##########
@@ -2336,26 +2337,40 @@ Result<std::shared_ptr<SparseIndex>> ReadSparseCSXIndex(
/*allow_short_read=*/false));
std::vector<int64_t> indices_shape({non_zero_length});
Review Comment:
`non_zero_length` is read directly from the SparseTensor flatbuffer and can be negative in crafted input. A negative value makes `indices_minimum_bytes` negative, which bypasses the buffer-size guard and constructs an indices Tensor with an invalid (negative) shape. Reject negative `non_zero_length` before doing the overflow-checked size computation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50077: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #50038:
URL: https://github.com/apache/arrow/pull/50038#issuecomment-4849644007
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit a3d630fc19af967761b84b87bb3aa3f0c26f3235.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/84440935931) has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50077: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
Posted by "rok (via GitHub)" <gi...@apache.org>.
rok merged PR #50038:
URL: https://github.com/apache/arrow/pull/50038
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50077: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #50038:
URL: https://github.com/apache/arrow/pull/50038#issuecomment-4599754531
:warning: GitHub issue #50077 **has been automatically assigned in GitHub** to PR creator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50077: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
Posted by "jmestwa-coder (via GitHub)" <gi...@apache.org>.
jmestwa-coder commented on PR #50038:
URL: https://github.com/apache/arrow/pull/50038#issuecomment-4599751694
Done. Opened #50077 and retitled the PR to reference it, and restored the PR template in the description.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #50038:
URL: https://github.com/apache/arrow/pull/50038#issuecomment-4537133482
* Could you open an issue for non MINOR change? See https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes for details.
* Could you use our PR template instead of removing it entirely?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50077: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
Posted by "jmestwa-coder (via GitHub)" <gi...@apache.org>.
jmestwa-coder commented on code in PR #50038:
URL: https://github.com/apache/arrow/pull/50038#discussion_r3418658901
##########
cpp/src/arrow/ipc/reader.cc:
##########
@@ -2336,26 +2337,40 @@ Result<std::shared_ptr<SparseIndex>> ReadSparseCSXIndex(
/*allow_short_read=*/false));
std::vector<int64_t> indices_shape({non_zero_length});
Review Comment:
good catch. added a guard rejecting negative non_zero_length up front. the bare Tensor constructor used here skips CheckTensorValidity, so a negative shape wasn't being caught downstream.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50077: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex [arrow]
Posted by "jmestwa-coder (via GitHub)" <gi...@apache.org>.
jmestwa-coder commented on PR #50038:
URL: https://github.com/apache/arrow/pull/50038#issuecomment-4781591532
gentle ping
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org