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

[jira] [Updated] (ARROW-11488) [Rust]: StructBuilder's Drop impl leaks memory

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

Andy Grove updated ARROW-11488:
-------------------------------
    Fix Version/s: 3.0.1

> [Rust]: StructBuilder's Drop impl leaks memory
> ----------------------------------------------
>
>                 Key: ARROW-11488
>                 URL: https://issues.apache.org/jira/browse/ARROW-11488
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Rust
>    Affects Versions: 3.0.0
>            Reporter: Steven Fackler
>            Assignee: Steven Fackler
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0, 3.0.1
>
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> The StructBuilder stores two copies of the inner ArrayBuilders in two separate Vecs via some unsafe code. To avoid double-dropping the builders, the StructBuilder Drop impl uses mem::forget on one of the vectors. This avoids calling the destructor of the ArrayBuilders twice, but also leaks the memory of the Vec itself.
> In addition, the double-vecs with the unsafe code is completely unnecessary since you can just call `ArrayBuilder::as_mut_any` on the `dyn ArrayBuilder` instead of having to covert to a `Box<dyn Any>`.



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