-
Notifications
You must be signed in to change notification settings - Fork 1.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
unable to statically link tcmalloc in a program that forks #856
Comments
That's caused by glibc bug #20432. |
malloc hooks removal commit is not related at all. I can see this issue in earlier gperftools versions. And linking gnu libc statically is not exactly recommended option anyways. It is quite possible that glibc 2.25 indeed fixes the problem on it's end. Closing as it is not seemingly gperftools problem. |
Looks like you're doing it for rookd. Not being expert, let me recommend again against trying to link libc statically. It is ok to link everything else statically (and linking tcmalloc statically is great idea), but even at Google with it's massive focus on efficiency, people don't link libc statically. |
yes this for rookd. I found a relatively easy workaround https://github.com/rook/rook/blob/master/pkg/cephmgr/cephd/malloc.go for our scenarios, in case anyone else sees this. I know that statically linking libc is not recommended, but when running in small containers I think the alternatives of bringing in a whole distro is not much better. I'm aware of the static nss issue, are there others that come up as gotchas? |
If a program calls fork there is one more reference to libc's malloc.o that would need to be implemented for the linker to drop malloc.o. Here's a simple repro
and if you look at test.map produced by the linker:
The text was updated successfully, but these errors were encountered: