zeroshade commented on PR #1526:
URL: https://github.com/apache/arrow-go/pull/1526#issuecomment-6809370849

   CI is failing on this, and it's a real leak rather than a flake, so I 
haven't merged. The Linux Test and Verify jobs run with `-asan` and fail in 
`arrow/cdata`:
   
   ```
   ==14189==ERROR: LeakSanitizer: detected memory leaks
   Direct leak of 8 byte(s) in 1 object(s) allocated from: ...
   SUMMARY: AddressSanitizer: 8 byte(s) leaked in 1 allocation(s).
   FAIL github.com/apache/arrow-go/v18/arrow/cdata
   ```
   
   Running each `TestExtensionArrayRoundTrip` case on its own under `go test 
-asan` in a `golang:1.26` container, only `string_view` leaks. `list`, 
`sparse_union` and `dictionary` are clean.
   
   The cause is an existing bug that your new test exposes. For view arrays, 
`exportArray` allocates a separate C array for the variadic buffer sizes with 
`allocateBufferSizeArr` and stores it as the last entry of `buffers`. 
`releaseExportedArray` frees `arr.buffers` but never that sizes array. One data 
buffer means one 8-byte entry.
   
   It reproduces on main without extensions: exporting a plain `string_view` 
array holding one out-of-line value and releasing it leaks the same 8 bytes 
under `-asan`. No existing test exports a view with a data buffer. Before this 
PR, extension-over-view arrays were exported without their data buffers, so the 
sizes array was empty.
   
   Could you free the sizes array in `releaseExportedArray` for view types? It 
fits in this PR since the new test needs it to pass. I'll re-review once CI is 
green.
   
   Sorry for approving before CI had run on the first commit. My local runs 
were on macOS, which doesn't do leak checking.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to