Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#] The C data interface implementation can leak on import #35988

Closed
CurtHagenlocher opened this issue Jun 8, 2023 · 0 comments · Fixed by #35996
Closed

[C#] The C data interface implementation can leak on import #35988

CurtHagenlocher opened this issue Jun 8, 2023 · 0 comments · Fixed by #35996
Assignees
Milestone

Comments

@CurtHagenlocher
Copy link
Contributor

Describe the bug, including details regarding any error messages, version, and platform.

An imported stream will leak memory as CArrowArray instances are allocated for each batch but they're never freed.

Code which imports an IArrowArrayStream may have trouble freeing the CArrowArrayStream that was used to import it because it can't necessarily track the stream's lifetime.

Component(s)

C#

CurtHagenlocher added a commit to CurtHagenlocher/arrow that referenced this issue Jun 8, 2023
eerhardt pushed a commit that referenced this issue Jun 14, 2023
…#35996)

### What changes are included in this PR?

To ensure proper cleanup, immediately copies the contents of the C structure into the imported class for arrays and streams.
Relaxes the requirement when exporting that the target structure appear uninitialized.

### Are these changes tested?

Existing tests pass. We don't as yet seem to have a good way to test for memory leaks so no new tests have been added.

### Are there any user-facing changes?

No.

* Closes: #35988

Authored-by: Curt Hagenlocher <curt@hagenlocher.org>
Signed-off-by: Eric Erhardt <eric.erhardt@microsoft.com>
@eerhardt eerhardt added this to the 13.0.0 milestone Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants