激動の2020年も気づけば残り3ヵ月,
転回
この問題をメンテナMLに報告してあれこれ議論しているうち,
straceは,
$ strace /sbin/installer/ls -l |& cat -n 1 execve("/sbin/installer/ls", ["/sbin/installer/ls", "-l"], 0x7ffcf614a268 /* 28 vars */) = 0 2 uname({sysname="Linux", nodename="2020_0822", ...}) = 0 3 brk(NULL) = 0x1b62000 4 brk(0x1b63200) = 0x1b63200 5 arch_prctl(ARCH_SET_FS, 0x1b628c0) = 0 ... 80 openat(AT_FDCWD, "/etc/passwd", O_RDONLY|O_CLOEXEC) = 4 81 fstat(4, {st_mode=S_IFREG|0644, st_size=1686, ...}) = 0 82 lseek(4, 0, SEEK_SET) = 0 83 read(4, "root:x:0:0::/root:/bin/bash\nbin:"..., 4096) = 1686 84 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xe5} --- 85 +++ killed by SIGSEGV +++
この結果を見ると,
もう少し絞り込むために,
$ strace /sbin/installer/ls -l |& grep open | cat -n .... 9 openat(AT_FDCWD, ".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 10 open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 4 11 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 4 12 open("/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 4 13 open("/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 4 14 open("/lib64/ld-linux-x86-64.so.2", O_RDONLY|O_CLOEXEC) = 4 15 openat(AT_FDCWD, "/etc/passwd", O_RDONLY|O_CLOEXEC) = 4
最初の方は今回の問題とは関係ないロケール回りの処理なので省略しました。
この結果を見ると,
この動作はどう見ても仕様のレベルだよなぁ…… と,
「あれれ,
$ cat -n configure | less .... 1436 --enable-stack-protector=[yes|no|all|strong] 1437 Use -fstack-protector[-all|-strong] to detect glibc 1438 buffer overflows 1439 --enable-static-nss build static NSS modules [default=no] 1440 --disable-force-install don't force installation of files from this package, 1441 even if they are older than the installed files ....
configureの説明は"build static NSS modules
$ cat -n INSTALL | less .... 149 '--enable-static-nss' 150 Compile static versions of the NSS (Name Service Switch) libraries. 151 This is not recommended because it defeats the purpose of NSS; a 152 program linked statically with the NSS libraries cannot be 153 dynamically reconfigured to use a different name database. 154 ....
どうやらこのオプションを指定しないとNSS回りのライブラリを静的リンク用にできないようです。ただし,