-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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/race: doesn't support the plugin package #24245
Comments
/cc @dvyukov |
Sounds like an issue to our production application, which enables users to build their own Go plugins to enhance the application. It would be nice if this would get a fix. Is this complicated or just not prioritized yet, because of plugin is not first class anyhow? |
It's not prioritized. It would help if somebody could figure out what the actual problem is. It may be obvious, it may not; I don't know. |
I've tested this by building the core app with |
In my case, a simple plugin that runs an http server with a simple handler func for root path // plugin.go
func Init() {
http.HandleFunc("/", func (w http.ResponseWriter, _ *http.Request) {
fmt.Fprint(w, "Hello World")
})
http.ListenAndServe(":3000", nil)
}
// load-plugin.go
func main () {
p, err := plugin.Open("plugin.so")
if err != nil {
panic(err)
}
sym, err := p.Lookup("Init")
if err != nil {
panic(err)
}
init := sym.(func())
init()
} Error:
|
Any update on when this might be fixed? I just lost like 4 hours to this problem. |
Honestly plugins are barely supported at all. If somebody sends in a fix we will review it, but it's unlikely that anybody on the core Go team is going to work on this any time soon. Sorry. |
Good to know, thanks. Any chance this could make it into the docs on plugins? Edit: I've opened a PR #68792 |
…tation As described in golang#24245, the race detector isn't able to find some race conditions in plugins. This commit adds a warning about this to the plugins documentation. Updates golang#24245
Change https://go.dev/cl/604275 mentions this issue: |
As described in #24245, the race detector isn't able to find some race conditions in plugins. This commit adds a warning about this to the plugins documentation. Updates #24245 Change-Id: I1a5ab9b5e22b6a254efc639c3c03f75b79214d49 GitHub-Last-Rev: a5b4ff4 GitHub-Pull-Request: #68792 Reviewed-on: https://go-review.googlesource.com/c/go/+/604275 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
What did you do?
What did you expect to see?
A
DATA RACE
output similar to this one:What did you see instead?
No output. I reproduced it 100% on both linux and darwin.
System details
The text was updated successfully, but these errors were encountered: