Skip to content

Solace client panic with CGO runtime errors when trying to instantiate with [boringcrypto] library. #14

@DeeptimanQlik

Description

@DeeptimanQlik
  • We are facing an issue with CGO runtime error: cgo argument has Go pointer to unpinned Go pointer, when we try to integrate both boringcrypto & solace-client libraries.

  • We don't see any issue when we tried to link solace-client library without boringcrypto. But with boringcrypto CGO started panic with a UnPin Go pointers exists at runtime and doesn't allow the application to start.

  • We did few investigation to see if the issue is known and resolved by other Go client libraries and found an interesting issues with imdb-go-client that claims, if the Go pointer pass to C function and the allocation is done with new() then CGO runtime panics with the unsafe pointer. And as resolution to replace new() with C.malloc(). Please check this issue for more details.

  • Also, please check this issue that we wanted to understand with boringcrypto. [boringcrypto] crypto/tls/fipsonly: panic runtime error: cgo argument has Go pointer to unpinned Go pointer  golang/go#64694

Error message

panic: runtime error: cgo argument has Go pointer to unpinned Go pointer
goroutine 1 [running]:
solace.dev/go/messaging/internal/ccsmp.(*SolClientContext).SolClientSessionCreate.func1.1(0x7f78f10cc5b8?, 0x30?, 0xc000640000?, 0xc000aca7e0?)	
/go/src/github.com/example/vendor/solace.dev/go/messaging/internal/ccsmp/ccsmp_core.go:265 +0x51solace.dev
/go/messaging/internal/ccsmp.(*SolClientContext).SolClientSessionCreate.func1()	
/go/src/github.com/example/vendor/solace.dev/go/messaging/internal/ccsmp/ccsmp_core.go:265 +0x25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions