You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Andrew Lamb (Jira)" <ji...@apache.org> on 2021/03/04 19:56:00 UTC

[jira] [Updated] (ARROW-11862) [Rust] String and BinaryArray created from iterators that don't accurately report size can lead to undefined behavior

     [ https://issues.apache.org/jira/browse/ARROW-11862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Lamb updated ARROW-11862:
--------------------------------
    Component/s: Rust

> [Rust] String and BinaryArray created from iterators that don't accurately report size can lead to undefined behavior
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-11862
>                 URL: https://issues.apache.org/jira/browse/ARROW-11862
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Rust
>            Reporter: Andrew Lamb
>            Priority: Major
>
> As [~jorgecarleitao] says on  https://github.com/apache/arrow/pull/9588#discussion_r584290701
> The (Rust) Iterator spec recommends, but does not require, that the iterator reports a correct length. Consumer that lead to undefined behavior from an incorrect size_hint are the causers of said undefined behavior.
> The only case where consumers can trust the iterators' length is when the interator implement unsafe trait TrustedLen. Unfortunately, TrustedLen is still in unstable. For that reason, we have been exposing unsafe Buffer::from_trusted_len_iter and the like for those cases.
> So the code should be updated to handle the case where the reported `size_hint` turns out to be incorrect



--
This message was sent by Atlassian Jira
(v8.3.4#803005)