GH-49716: [C++] FixedShapeTensorType::Deserialize should strictly validate serialized metadata#49718
Conversation
|
I suppose |
|
@raulcd I think this should be part of 24.0.0. |
We do have I added a validation step for |
|
@pitrou I pushed requested changes, please do another pass. |
| for (auto& x : document["shape"].GetArray()) { | ||
| for (const auto& x : document["shape"].GetArray()) { | ||
| if (!x.IsInt64()) { | ||
| return Status::Invalid("shape must contain integers"); |
There was a problem hiding this comment.
Can we show the actual type for easy to debug on failure?
There was a problem hiding this comment.
Changed. Now we emit value and type of the value on deserialization failure.
3395fec to
b0dcdb7
Compare
|
ping @pitrou |
|
I've re-added the |
|
I've restarted a failing R check, others seem to be passing ok. |
|
That failure is unrelated. Has been failing for some weeks and was tracked in: #49737 |
|
@raulcd shall I rebase and merge if green? Or just merge now? |
…idate serialized metadata (#49718) ### Rationale for this change FixedShapeTensorType::Deserialize should validate input from unknown sources. ### What changes are included in this PR? Adds stricter deserialization valideation. ### Are these changes tested? Yes. New tests are added. ### Are there any user-facing changes? Stricter validation should not be noticed if metadata is correct as per spec of fixed_shape_tensor. * GitHub Issue: #49716 Authored-by: Rok Mihevc <rok@mihevc.org> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 41035d4. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 32 possible false positives for unstable benchmarks that are known to sometimes produce them. |
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 41035d4. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 32 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
FixedShapeTensorType::Deserialize should validate input from unknown sources.
What changes are included in this PR?
Adds stricter deserialization valideation.
Are these changes tested?
Yes. New tests are added.
Are there any user-facing changes?
Stricter validation should not be noticed if metadata is correct as per spec of fixed_shape_tensor.