I'm a total newbie to snap. Apologies if this question is trivial.
I'm experiencing unintended side effects when trying to use snap on a slightly customized Ubuntu system.
My slight customization is:
To replace the standard malloc with libjemalloc (better performance, works well, never encountered an issue), I have this in /etc/ld.so.preload
#--override the system malloc--#
/usr/lib/x86_64-linux-gnu/libjemalloc.so
Understandably, libjemalloc.so is not included in the ubuntu snap core package.
Which leads to the following side effects when trying to use snap:
$ snap list
Name Version Rev Developer Notes
core 16.04.1 888 canonical -
hello 2.10 20 canonical -
$ /snap/bin/hello
ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libjemalloc.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libjemalloc.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libjemalloc.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Hello, world!
Questions:
- Why does the ERROR repeat 3 times? Is this a bug?
- Why does the
snapsystem try to inherit this preload. Shouldn't containers be self contained and be isolated from the caller user-land environment? Is this a bug? - What's the easiest way to add
libjemalloc.soto the core snap, preferably as an overlay that doesn't include all of the core?