-
Notifications
You must be signed in to change notification settings - Fork 18k
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
runtime: darwin using -buildmode=c-shared so got runtime: unexpected return pc for runtime.sigpanic called from 0x41e745a #40131
Comments
Thank you for this report @wangzhione and welcome to the Go project! I can reproduce this even for Go1.13.12, Go1.12.17, but for Go1.11.13 there are CGO errors. Kindly paging @ianlancetaylor @cherrymui |
I tried to debug this problem, it crashed at method
It looks like the
Then I tried to add many
But I still do not know why the shared library was accessing the wrong
any thoughts? |
A shared library built with I don't know whether the Mach-O symbol visibility rules can support using |
Emmanual @odeke-em found that Go 1.11 gave a CGO error, not a segfault. |
@networkimprov - Did you get this working by any chance? @ianlancetaylor - IMHO, If golang is providing a way to build native shared library, then it does not matter, whether caller is written in Go, C, C++ or any other language, as long as caller follow the rules. |
Unless we have strict symbol visibility control, it matters what language the caller is written, because a Go program and a Go shared library will define many symbols with the same names. Those symbols must be distinct, and not combined by the dynamic linker. |
这个问题,你在dll的代码里面只要用到了接口,必报错 |
这个问题在go任何一个支持cgo的版本都会出现,包括最新的1.19 |
go version: go1.20.5 darwin/amd64 this is Makefile
error
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
Outputuname -a
OutputWhat did you do?
verify.go
sec/key.go
go build genrate c-shared .so
go build -buildmode=c-shared -a -o libverify.so verify.go
using libverify.so
What did you expect to see?
no panic, and print out a string.
What did you see instead?
The text was updated successfully, but these errors were encountered: