Summary: | sys-libs/glibc-2.19: static linking breaks nss module loading (getaddrinfo/getpwnam/etc...) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Steve Arnold <nerdboy> |
Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dark, haven, kimmo.taskinen, metatheorem |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
URL: | https://sourceware.org/bugzilla/show_bug.cgi?id=17250 | ||
See Also: | https://sourceware.org/bugzilla/show_bug.cgi?id=17250 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | rc.log |
Description
Steve Arnold
2014-05-07 02:06:51 UTC
Oh, I almost forgot the most fun part: only uids/gids are left on the system, all user and group names are completely fubar'd everywhere. Thoughts? # ls -l /var/ total 28 drwxr-xr-x 9 0 0 4096 May 6 14:02 cache drwxr-xr-x 3 0 0 4096 May 6 18:26 db drwxr-xr-x 3 0 0 4096 May 5 23:00 empty drwxr-xr-x 15 0 0 4096 May 6 16:23 lib lrwxrwxrwx 1 0 0 9 Apr 2 18:29 lock -> /run/lock drwxr-xr-x 6 0 0 4096 May 6 16:23 log lrwxrwxrwx 1 0 0 15 May 6 14:21 mail -> /var/spool/mail lrwxrwxrwx 1 0 0 4 Apr 2 18:29 run -> /run drwxr-xr-x 4 0 0 4096 May 6 14:21 spool drwxrwxrwt 5 0 0 4096 May 6 18:02 tmp Double-WTF?!? # cat /etc/nsswitch.conf /etc/passwd /proc/self/mountinfo # /etc/nsswitch.conf: # $Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nsswitch.conf,v 1.1 2006/09/29 23:52:23 vapier Exp $ passwd: compat shadow: compat group: compat # passwd: db files nis # shadow: db files nis # group: db files nis hosts: files dns networks: files dns services: db files protocols: db files rpc: db files ethers: db files netmasks: files netgroup: files bootparams: files automount: files aliases: files root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/bin/false daemon:x:2:2:daemon:/sbin:/bin/false adm:x:3:4:adm:/var/adm:/bin/false lp:x:4:7:lp:/var/spool/lpd:/bin/false sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt news:x:9:13:news:/var/spool/news:/bin/false uucp:x:10:14:uucp:/var/spool/uucp:/bin/false operator:x:11:0:operator:/root:/bin/bash portage:x:250:250:portage:/var/tmp/portage:/bin/false nobody:x:65534:65534:nobody:/var/empty:/bin/false man:x:13:15:added by portage for man-db:/usr/share/man:/sbin/nologin sshd:x:22:22:added by portage for openssh:/var/empty:/sbin/nologin ldap:x:439:439:added by portage for openldap:/usr/lib64/openldap:/sbin/nologin gkrellmd:x:101:249:added by portage for gkrellm:/dev/null:/sbin/nologin cron:x:16:16:added by portage for cronbase:/var/spool/cron:/sbin/nologin distcc:x:240:2:added by portage for distcc:/dev/null:/sbin/nologin messagebus:x:102:247:added by portage for dbus:/dev/null:/sbin/nologin mail:x:8:12:added by portage for mailbase:/var/spool/mail:/sbin/nologin postmaster:x:14:246:added by portage for mailbase:/var/spool/mail:/sbin/nologin mysql:x:60:60:added by portage for mariadb:/dev/null:/sbin/nologin 15 19 0:3 / /proc rw,relatime - proc proc rw 16 19 0:5 / /dev rw,nosuid,relatime - devtmpfs udev rw,size=10240k,nr_inodes=943475,mode=755 17 16 0:11 / /dev/pts rw,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000 18 19 0:14 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sysfs rw 19 1 8:3 / / rw,noatime - ext4 /dev/sda3 rw,data=ordered 20 19 253:0 / /usr rw,noatime - ext4 /dev/mapper/vgOS-usr rw,data=ordered 21 19 0:15 / /run rw,nosuid,nodev,relatime - tmpfs tmpfs rw,size=755516k,mode=755 22 16 0:13 / /dev/mqueue rw,nosuid,nodev,noexec,relatime - mqueue mqueue rw 23 16 0:16 / /dev/shm rw,nosuid,nodev,noexec,relatime - tmpfs shm rw 24 18 0:17 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime - securityfs securityfs rw 25 18 0:6 / /sys/kernel/debug rw,nosuid,nodev,noexec,relatime - debugfs debugfs rw 26 18 0:18 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime - tmpfs cgroup_root rw,size=10240k,mode=755 27 18 0:19 / /sys/firmware/efi/efivars rw,nosuid,nodev,noexec,relatime - efivarfs efivarfs rw 28 26 0:20 / /sys/fs/cgroup/openrc rw,nosuid,nodev,noexec,relatime - cgroup openrc rw,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc 29 26 0:21 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime - cgroup cpuset rw,cpuset 30 26 0:22 / /sys/fs/cgroup/cpu rw,nosuid,nodev,noexec,relatime - cgroup cpu rw,cpu 31 26 0:23 / /sys/fs/cgroup/cpuacct rw,nosuid,nodev,noexec,relatime - cgroup cpuacct rw,cpuacct 32 26 0:24 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime - cgroup memory rw,memory 33 26 0:25 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime - cgroup devices rw,devices 34 26 0:26 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime - cgroup freezer rw,freezer 35 26 0:27 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime - cgroup blkio rw,blkio 36 26 0:28 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime - cgroup perf_event rw,perf_event 37 26 0:29 / /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime - cgroup hugetlb rw,hugetlb 38 19 253:6 / /home rw,noatime - ext4 /dev/mapper/vgOS-home rw,data=ordered 39 19 253:2 / /opt rw,noatime - ext4 /dev/mapper/vgOS-opt rw,data=ordered 40 19 253:3 / /var rw,noatime - ext4 /dev/mapper/vgOS-var rw,data=ordered 41 40 253:4 / /var/tmp rw,noatime - ext2 /dev/mapper/vgOS-vartmp rw,errors=continue,user_xattr,acl 42 19 253:5 / /tmp rw,noatime - ext2 /dev/mapper/vgOS-tmp rw,errors=continue,user_xattr,acl 43 20 253:1 / /usr/portage rw,noatime - ext2 /dev/mapper/vgOS-portage rw,errors=continue,user_xattr,acl 44 43 0:30 / /usr/portage/packages rw,relatime - nfs wimpy:/export/gentoo-packages/athlon-64 rw,vers=3,rsize=8192,wsize=8192,namlen=255,hard,nolock,proto=tcp,timeo=14,retrans=2,sec=sys,mountaddr=192.168.0.16,mountvers=3,mountport=45971,mountproto=udp,local_lock=all,addr=192.168.0.16 45 43 0:30 / /usr/portage/distfiles rw,relatime - nfs wimpy:/export/distfiles rw,vers=3,rsize=8192,wsize=8192,namlen=255,hard,nolock,proto=tcp,timeo=14,retrans=2,sec=sys,mountaddr=192.168.0.16,mountvers=3,mountport=45971,mountproto=udp,local_lock=all,addr=192.168.0.16 46 20 0:30 / /usr/local/portage rw,relatime - nfs wimpy:/export/portage-overlay rw,vers=3,rsize=8192,wsize=8192,namlen=255,hard,nolock,proto=tcp,timeo=14,retrans=2,sec=sys,mountaddr=192.168.0.16,mountvers=3,mountport=45971,mountproto=udp,local_lock=all,addr=192.168.0.16 # strace id root execve("/usr/bin/id", ["id", "root"], [/* 40 vars */]) = 0 uname({sys="Linux", node="horton", ...}) = 0 brk(0) = 0x1924000 brk(0x19251c0) = 0x19251c0 arch_prctl(ARCH_SET_FS, 0x1924880) = 0 readlink("/proc/self/exe", "/usr/bin/id", 4096) = 11 brk(0x19461c0) = 0x19461c0 brk(0x1947000) = 0x1947000 open("/usr/lib64/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=2104864, ...}) = 0 mmap(NULL, 2104864, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fba36738000 close(3) = 0 socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(3) = 0 socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(3) = 0 open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3 fcntl(3, F_GETFD) = 0x1 (flags FD_CLOEXEC) fstat(3, {st_mode=S_IFREG|0644, st_size=508, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fba36737000 read(3, "# /etc/nsswitch.conf:\n# $Header:"..., 4096) = 508 read(3, "", 4096) = 0 close(3) = 0 munmap(0x7fba36737000, 4096) = 0 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=104540, ...}) = 0 mmap(NULL, 104540, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fba36718000 close(3) = 0 munmap(0x7fba36718000, 104540) = 0 open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=2492, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fba36737000 read(3, "# Locale name alias data base.\n#"..., 4096) = 2492 read(3, "", 4096) = 0 close(3) = 0 munmap(0x7fba36737000, 4096) = 0 open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, "id: ", 4id: ) = 4 write(2, "root: no such user", 18root: no such user) = 18 write(2, "\n", 1 ) = 1 close(1) = 0 close(2) = 0 exit_group(1) = ? +++ exited with 1 +++ # eselect locale list Available targets for the LANG variable: [1] C [2] de_DE [3] de_DE.iso88591 [4] deutsch [5] en_US [6] en_US.iso88591 [7] en_US.utf8 * [8] es_MX [9] es_MX.iso88591 [10] german [11] italian [12] it_IT [13] it_IT.iso88591 [14] POSIX [ ] (free form) No idea. This is a bug tracker. It's where you go after you have discovered a bug. You ought to know. Rebuilt glibc, checked locales and nscd, revdep-rebuilt 7 packages, and it came up clean. WTF... Note that the nscd socket was there at the end but was not before. I rebooted right after uids/gids disappeared, but not since before the bug was filed. Still no idea wtf... *** Bug 509850 has been marked as a duplicate of this bug. *** you can get a cleaner strace by doing: LC_ALL=C strace id root the readlink(/proc/self/exe) looks weird. no idea where that's coming from as i don't think coreutils does it. you should try installing ltrace and running it: LC_ALL=C ltrace id root i guess you built glibc with USE=nscd ? that's kind of weird if you aren't actually turning nscd on. also attach the output of `ldconfig -p`. Hi this issue as well unfortunately: LC_ALL=C strace id root execve("/usr/bin/id", ["id", "root"], [/* 38 vars */]) = 0 uname({sys="Linux", node="nostromo", ...}) = 0 brk(0) = 0x201d000 brk(0x201e1c0) = 0x201e1c0 arch_prctl(ARCH_SET_FS, 0x201d880) = 0 readlink("/proc/self/exe", "/usr/bin/id", 4096) = 11 brk(0x203f1c0) = 0x203f1c0 brk(0x2040000) = 0x2040000 open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3 fcntl(3, F_GETFD) = 0x1 (flags FD_CLOEXEC) fstat(3, {st_mode=S_IFREG|0644, st_size=508, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f926e04e000 read(3, "# /etc/nsswitch.conf:\n# $Header:"..., 512) = 508 read(3, "", 512) = 0 close(3) = 0 munmap(0x7f926e04e000, 4096) = 0 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=136140, ...}) = 0 mmap(NULL, 136140, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f926e02d000 close(3) = 0 munmap(0x7f926e02d000, 136140) = 0 write(2, "id: ", 4id: ) = 4 write(2, "root: no such user", 18root: no such user) = 18 write(2, "\n", 1 ) = 1 close(1) = 0 close(2) = 0 exit_group(1) = ? +++ exited with 1 +++ glibc flags: [ebuild R ~] sys-libs/glibc-2.19:2.2 USE="gd (multilib) -debug (-hardened) -nscd -profile (-selinux) -suid -systemtap -vanilla" 0 kB LC_ALL=C ltrace id root Couldn't find .dynsym or .dynstr in "/proc/2553/exe" id: root: no such user Any thoughts? Rebuilding coreutils with default flags solved this issue for me: [ebuild R ] sys-apps/coreutils-8.21 USE="acl nls -caps -gmp (-selinux) -static -vanilla -xattr" 0 kB Previously I had caps, static and xattr selected. rebuilt with caps and xattr and still works. I suspect the static flag caused the issue from what I've seen so far. did you guys build coreutils with USE=static, then upgrade glibc ? and then when you rebuilt coreutils, it worked ? or even if you rebuild just coreutils with USE=static, it fails ? Actually, the use=nscd thing was an attempted work-around for the original problem, which seemed to help a little bit (whether or not the init script was enabled, which also seemed to have errors on startup). The problem research pointing to the above was a red herring in this case, as coreutils-8.23 won't build at all with use=static (PIC/non-PIC error linking with a gcc object) but does build/work just fine without static (and no nscd). *** Bug 518650 has been marked as a duplicate of this bug. *** see upstream bug report for example test programs that show the problem *** Bug 523342 has been marked as a duplicate of this bug. *** For reference, debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754813 Debian seems to have a patch: http://anonscm.debian.org/viewvc/pkg-glibc/glibc-package/trunk/debian/patches/any/local-static-dlopen-search-path.diff?view=log this has been fixed upstream for glibc 2.23. i'll backport it to glibc 2.22, but that'll be as far as i take it. pushed in glibc-2.22: http://sources.gentoo.org/gentoo/src/patchsets/glibc/2.22/00_all_0022-BZ-17250-Fix-static-dlopen-default-library-search-pa.patch?rev=1.1 http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44bd56eb152ade9a1389f855cb8e4c9d770afe57 *** Bug 567210 has been marked as a duplicate of this bug. *** |