-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Go] cdata package leaks handles, difficulty debugging #33887
Comments
zeroshade
added a commit
to zeroshade/arrow
that referenced
this issue
Jan 26, 2023
zeroshade
added a commit
that referenced
this issue
Jan 26, 2023
### Rationale for this change Fixing a memory leak of malloc'd `uintptr_t` values used for cgo handles ### What changes are included in this PR? calling `free` on the handles after deleting the Go objects they point at, add `static` keyword to the helper function definitions in `helpers.h` so that compiling without optimizations for debugging doesn't fail. * Closes: #33887 Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
sjperkins
pushed a commit
to sjperkins/arrow
that referenced
this issue
Feb 10, 2023
…apache#33889) ### Rationale for this change Fixing a memory leak of malloc'd `uintptr_t` values used for cgo handles ### What changes are included in this PR? calling `free` on the handles after deleting the Go objects they point at, add `static` keyword to the helper function definitions in `helpers.h` so that compiling without optimizations for debugging doesn't fail. * Closes: apache#33887 Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
gringasalpastor
pushed a commit
to gringasalpastor/arrow
that referenced
this issue
Feb 17, 2023
…apache#33889) ### Rationale for this change Fixing a memory leak of malloc'd `uintptr_t` values used for cgo handles ### What changes are included in this PR? calling `free` on the handles after deleting the Go objects they point at, add `static` keyword to the helper function definitions in `helpers.h` so that compiling without optimizations for debugging doesn't fail. * Closes: apache#33887 Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Hmm, why would they? They are marked |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug, including details regarding any error messages, version, and platform.
When the "misuse of cgo.Handle" issue was fixed for #33864, it looks like we forgot to call
free
on the malloc'duintptr_t
that gets used causing a memory leak which was caught by leak sanitizer when testing ADBC.Also, we should add
static
to the definitions of the methods ingo/arrow/cdata/arrow/helpers.h
so that they don't cause multiple definition errors if you build without optimizations for debugging.Component(s)
Go
The text was updated successfully, but these errors were encountered: