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

Running the compiled executable is killed instantly, while go run works well #1092

Open
2 of 7 tasks
dengpan-edgejumps opened this issue Nov 1, 2023 · 1 comment
Open
2 of 7 tasks
Labels

Comments

@dengpan-edgejumps
Copy link

Description

After compiling CGO_ENABLED=1 go build -o ./kafka, run ./kafka, throws:
image

However, go run . will work well
image

How to reproduce

  1. go get -u github.com/confluentinc/confluent-kafka-go/v2/kafka
package main

import (
	"fmt"
	"github.com/confluentinc/confluent-kafka-go/v2/kafka"
)

func main() {

	info, ver := kafka.LibraryVersion()

	fmt.Printf("Kafka library version: %d %s\n", info, ver)
}
  1. CGO_ENABLED=1 go build
  2. ./kafka

Checklist

Please provide the following information:

  • confluent-kafka-go and librdkafka version (LibraryVersion(2.3.0)):
  • Apache Kafka broker version:
  • Client configuration: ConfigMap{...}
  • Operating system: MacOS Ventura v13.5.2
  • Provide client logs (with "debug": ".." as necessary)
  • Provide broker log excerpts
  • Critical issue

Output of go env:

GO111MODULE=''
GOARCH='arm64'
GOBIN='/Users/simonwang/go/bin'
GOCACHE='/Users/simonwang/Library/Caches/go-build'
GOENV='/Users/simonwang/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/simonwang/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/simonwang/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/simonwang/edgejumps/labs/kafka/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/y7/7cxh20915rx3lkv0td8s8ybm0000gn/T/go-build3768843624=/tmp/go-build -gno-record-gcc-switches -fno-common'
@milindl
Copy link
Contributor

milindl commented Apr 4, 2024

Thanks for the report. Linking this comment here: #1161 (comment)

At a first glance, it looks like a code signing issue for macOS. If possible, can you try the methods for code signing mentioned in the comment? Let me know if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants