-
Notifications
You must be signed in to change notification settings - Fork 18k
plugin: cannot reload .so of the same path #17980
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
Comments
This is how dynamic linking works on Linux (there could be only at most one
copy of a given shared library in a process and it's based on file path
alone), so it's working as intended.
|
@minux that's not the case, we can load multiple fPIC libraries with the same name. The issue caused by caching https://github.com/golang/go/blob/master/src/plugin/plugin_dlopen.go#L134 |
@amenzhinsky I tested this on both darwin and linux, and @minix appears to be correct. If I:
That is, plugin2.so is not opened. So doing the right thing here, returning an error on a second open of a .so that has changed, is tricky because dlopen won't do the work for us. We could do something fancier like taking a sha1 of the file first, but I don't think it's worth it for 1.8. (I definitely do not think we should support opening a different plugin with the same path, given we don't close plugins.) |
What did you do?
main.go
bar.go
bar2.go
run
What did you expect to see?
or throw error on the second Open call.
What did you see instead?
System details
The text was updated successfully, but these errors were encountered: