appscope icon indicating copy to clipboard operation
appscope copied to clipboard

Running new lxc containers does not automatically set env or mounts

Open iapaddler opened this issue 2 years ago • 1 comments

$ /bin/linux/aarch64/scope run -- lxc ls ERROR: ld.so: object 'libscope.so' from /etc/ld.so.preload cannot be preloaded (failed to map segment from shared object): ignored. (same result with LD_PRELOAD or ld.so.preload)

$ LD_DEBUG=libs lxc ls results in numerous symbol errors. a few examples: calling init: /lib/libscope.so

 20015:	/lib/libscope.so: error: symbol lookup error: undefined symbol: SSL_read (fatal)
 20015:	/lib/libscope.so: error: symbol lookup error: undefined symbol: SSL_write (fatal)
 20015:	/lib/libscope.so: error: symbol lookup error: undefined symbol: SSL_get_fd (fatal)

 20015:	/lib/libscope.so: error: symbol lookup error: undefined symbol: PR_SetError (fatal)

 20015:	/lib/libscope.so: error: symbol lookup error: undefined symbol: uv__read (fatal)

 20015:	/lib/libscope.so: error: symbol lookup error: undefined symbol: uv_fileno (fatal)

other libs exhibit symbol errors, such as librt. however, are not preloaded.

iapaddler avatar Jun 23 '23 21:06 iapaddler

Poking around a bit with this. There are 2 independent issues:

  1. The lxc exec is a script which execs /snap/bin/lxc and that is a soft link; /snap/bin/lxc -> lxd.lxc, that, in turn, is a link; /snap/bin/lxd.lxc -> /usr/bin/snap. It is the start of lxd.lxc that causes the ld.so issue with loading libscope
  2. An lxc container is started using lxd and not containerd. Therefore, runc is not exec'd. Therefore, we don't attempt to update config.json for the new container.

iapaddler avatar Jun 26 '23 21:06 iapaddler