lidavidm opened a new issue, #33864:
URL: https://github.com/apache/arrow/issues/33864

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   ```
   panic: runtime/cgo: misuse of an invalid Handle
   
   goroutine 17 [running, locked to thread]:
   runtime/cgo.Handle.Value(...)
        /usr/local/go/src/runtime/cgo/handle.go:124
   
github.com/apache/arrow/go/v11/arrow/cdata.releaseExportedArray(0x55889925b4d0)
        
/root/go/pkg/mod/github.com/apache/arrow/go/[email protected]/arrow/cdata/exports.go:104
 +0x1b8
   ```
   
   We saw this in ADBC as well: 
https://github.com/apache/arrow-adbc/commit/5029f7b8ed1e60dd7d41f175af0abee6ccadb02e
 Experimentally, heap-allocating the Go Handle would avoid this at the cost of 
an extra indirection. That makes sense; the documentation for Handle states:
   
   ```go
   // Some C functions accept a void* argument that points to an arbitrary
   // data value supplied by the caller. It is not safe to coerce a cgo.Handle
   // (an integer) to a Go unsafe.Pointer, but instead we can pass the address
   // of the cgo.Handle to the void* parameter, as in this variant of the
   // previous example:
   ```
   
   (https://github.com/golang/go/blob/master/src/runtime/cgo/handle.go)
   
   ### Component(s)
   
   Go


-- 
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