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/02/04 17:46:00 UTC

[jira] [Resolved] (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 ]

Andrew Lamb resolved ARROW-11488.
---------------------------------
    Fix Version/s: 4.0.0
       Resolution: Fixed

Issue resolved by pull request 9409
[https://github.com/apache/arrow/pull/9409]

> [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
>
>          Time Spent: 1h
>  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)