apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
14.3k stars 3.48k forks source link

[Rust] There is no check for allocation failure #24654

Closed asfimport closed 4 years ago

asfimport commented 4 years ago

Reported by bluss on Github:

https://github.com/rust-ndarray/ndarray/issues/771

 

"What I can see, there is no check for allocation success, so any buffer can be created with a null pointer, which leads to soundness problems in most methods. Best look into using std::alloc::handle_alloc_error or alternatives. (This problem means that the mutablebuffer is not a safe abstraction, and it should preferably not be exposed as public API like this.)"

Reporter: Paddy Horan / @paddyhoran Assignee: Mahmut Bulut / @vertexclique

PRs and other links:

Note: This issue was originally created as ARROW-8480. Please see the migration documentation for further details.

asfimport commented 4 years ago

Mahmut Bulut / @vertexclique: Workaround for the first set of allocation related considerations:

https://github.com/apache/arrow/pull/7734

asfimport commented 4 years ago

Mahmut Bulut / @vertexclique: Suggested API can't be used until it stabilizes. So leaving this open until it stabilizes. Tracking issue: https://github.com/rust-lang/rust/issues/32838

asfimport commented 4 years ago

Wes McKinney / @wesm: Issue resolved by pull request 7734 https://github.com/apache/arrow/pull/7734