Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 126036 - glibc 2.4 and GCC 4.1: touch function not implemented because /proc gets unmounted
Summary: glibc 2.4 and GCC 4.1: touch function not implemented because /proc gets unmo...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 126096 133131 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-13 02:51 UTC by Bob
Modified: 2006-05-12 19:17 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bob 2006-03-13 02:51:32 UTC
upgrading from glibc 2.3.6-r3 to glibc 2.4.  i have completed one emerge -e system successfully, but the second one fails on package # 1:

# emerge -e system
Calculating system dependencies... done!
>>> Emerging (1 of 100) sys-devel/patch-2.5.9 to /
>>> checksums files   ;-) patch-2.5.9.ebuild
>>> checksums files   ;-) patch-2.5.9-r1.ebuild
>>> checksums files   ;-) files/digest-patch-2.5.9
>>> checksums files   ;-) files/patch-2.5.9-cr-stripping.patch
>>> checksums files   ;-) files/digest-patch-2.5.9-r1
>>> checksums src_uri ;-) patch-2.5.9.tar.gz
>>> Unpacking source...
>>> Unpacking patch-2.5.9.tar.gz to /var/tmp/portage/patch-2.5.9/work
touch: setting times of `/var/tmp/portage/patch-2.5.9/.unpacked': Function not implemented

!!! ERROR: sys-devel/patch-2.5.9 failed.
Call stack:
  ebuild.sh, line 1557:   Called dyn_unpack

!!! IO Failure -- Failed 'touch .unpacked' in /var/tmp/portage/patch-2.5.9
!!! If you need support, post the topmost build error, and the call stack if relevant.



todland etc # emerge --info | more
Gentoo Base System version 1.6.14
Portage 2.1_pre6 (default-linux/x86/2006.0, gcc-4.1.0, glibc-2.4-r0, 2.6.15-gentoo-r1 i686)
=================================================================
System uname: 2.6.15-gentoo-r1 i686 unknown
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qma
il/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict userpriv usersan
dbox"
GENTOO_MIRRORS="http://192.168.1.102"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://192.168.1.102/gentoo-portage"
USE="x86 X alsa apache2 apm arts avi berkdb bitmap-fonts crypt cups dri eds emboss encode esd f
oomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 imlib ipv6 jpeg kde libg++ libwww mad m
ikmod motif mp3 mpeg ncurses nls nptl nptlonly ogg opengl oss pam pdflib perl png python qt quicktime readline sdl spell ssl tcpd truetype truetype-fonts type1-fonts udev unicode vorbis xml
xmms xv zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LINGUAS
Comment 1 Bob 2006-03-13 02:53:09 UTC
same result with 2.5.9-r1.  :-/
Comment 2 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-03-13 09:34:40 UTC
emerge -d patch
Comment 3 Zac Medico gentoo-dev 2006-03-13 09:51:23 UTC
The problem is that something causes the `touch .unpacked` command to fail (portage behaves correctly).
Comment 4 SpanKY gentoo-dev 2006-03-13 10:39:34 UTC
uhh, are you sure you're using linux 2.6.15 ?  only time ive seen this issue is when people built the libc for a 2.6 kernel but then used the program on a 2.4 kernel
Comment 5 Jörg Gollnick 2006-03-13 13:38:01 UTC
Root cause is coreutils:
/bin/touch does not work
glibc-2.4 / gcc 3.4.5
It is only in a chroot if there is no /proc in chroot. Do this in chroot:
mount -t proc proc /proc
Comment 6 Bob 2006-03-13 14:37:44 UTC
(In reply to comment #4)
> uhh, are you sure you're using linux 2.6.15 ?  only time ive seen this issue is
> when people built the libc for a 2.6 kernel but then used the program on a 2.4
> kernel

no, i didn't forge the output of "emerge --info", so i guess the answer is yes, i'm sure that i'm using a 2.6.15 kernel. :) 

Comment 7 SpanKY gentoo-dev 2006-03-13 17:14:36 UTC
*** Bug 126096 has been marked as a duplicate of this bug. ***
Comment 8 SpanKY gentoo-dev 2006-03-13 21:03:10 UTC
> no, i didn't forge the output of "emerge --info", so i guess the answer is yes,
> i'm sure that i'm using a 2.6.15 kernel. :) 

if you read bugzilla as much as i do, you'd know it isnt uncommon for users to accidently run `emerge info` from a chroot or the wrong terminal that is ssh-ed to a remote host

post the output as an attachment of:
strace -o log touch ~/unpacked
strace -o log touch /var/tmp/portage/unpacked
Comment 9 Bob 2006-03-13 21:35:31 UTC
just so there's no concern about getting the output of emerge info from the wrong box, i'll confirm the information.  the total post is pretty brief, so i'll post the relevant info here:

todland / # emerge --info
Portage 2.1_pre6 (default-linux/x86/2006.0, gcc-4.1.0, glibc-2.4-r0, 2.6.15-gentoo-r1 i686)
=================================================================
System uname: 2.6.15-gentoo-r1 i686 unknown
Gentoo Base System version 1.6.14
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://*************"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://**************/gentoo-portage"
USE="x86 X alsa apache2 apm arts avi berkdb bitmap-fonts cli crypt ctype cups dba dri eds emboss encode esd expat fastbuild foomaticdb force-cgi-redirect fortran ftp gd gdbm gif gnome gpm gstreamer gtk gtk2 imlib ipv6 jpeg kde libg++ libwww mad memlimit mikmod motif mp3 mpeg ncurses nls nptl nptlonly ogg opengl oss pam pcre pdflib perl png posix python qt quicktime readline sdl session simplexml soap sockets spell spl ssl tcpd tokenizer truetype truetype-fonts type1-fonts udev unicode vorbis xml xmms xsl xv zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LINGUAS

todland / # emerge -e system
Calculating system dependencies... done!
>>> Emerging (1 of 100) sys-devel/patch-2.5.9-r1 to /
>>> checksums files   ;-) patch-2.5.9.ebuild
>>> checksums files   ;-) patch-2.5.9-r1.ebuild
>>> checksums files   ;-) files/digest-patch-2.5.9
>>> checksums files   ;-) files/patch-2.5.9-cr-stripping.patch
>>> checksums files   ;-) files/digest-patch-2.5.9-r1
>>> checksums src_uri ;-) patch-2.5.9.tar.gz
>>> Unpacking source...
>>> Unpacking patch-2.5.9.tar.gz to /var/tmp/portage/patch-2.5.9-r1/work
 * Applying patch-2.5.9-cr-stripping.patch ...                                                                                                                                                [ ok ]
touch: setting times of `/var/tmp/portage/patch-2.5.9-r1/.unpacked': Function not implemented

!!! ERROR: sys-devel/patch-2.5.9-r1 failed.
Call stack:
  ebuild.sh, line 1557:   Called dyn_unpack

!!! IO Failure -- Failed 'touch .unpacked' in /var/tmp/portage/patch-2.5.9-r1
!!! If you need support, post the topmost build error, and the call stack if relevant.

todland / # strace -o log touch ~/unpacked
bash: strace: command not found

todland / # > strace -o log touch /var/tmp/portage/unpacked
bash: -o: command not found
Comment 10 SpanKY gentoo-dev 2006-03-13 21:42:42 UTC
> todland / # strace -o log touch ~/unpacked
> bash: strace: command not found

so build strace statically somewhere and copy it over
Comment 11 Jörg Gollnick 2006-03-13 22:11:15 UTC
You should make sure that you have proc inside your chroot:
#mount -t proc proc /mnt/gentoo/proc
(chroot)#ps -efa
(chroot)#mount -t proc proc /proc
If this not helps:
(chroot)#mv /bin/touch /bin/touch.coreutils
(chroot)#ln -s /bin/busybox /bin/touch
(chroot)#touch somefile
(chroot)#emerge strace
(chroot)#rm /bin/touch
(chroot)#mv /bin/touch.coreutils /bin/touch

Background: busybox touch use other calls to touch a file. 

utime("somefile", NULL)                 = 0

The coreutils touch program uses a fd from /proc.

open("somefile", O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY|O_LARGEFILE, 0666) = 0
utimes("/proc/self/fd/0", NULL)         = 0

coreutils need /proc.
Comment 12 Bob 2006-03-14 02:11:21 UTC
(In reply to comment #11)
> You should make sure that you have proc inside your chroot:

thanks for the tip.  since two people have recommended the same tip, i guess i should clarify that i think i covered that base prior to chrooting:

# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev
# cp /proc/mounts /mnt/gentoo/etc/mtab
# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile

i haven't had an opportunity to transfer the exexutables for debugging yet.
Comment 13 Bob 2006-03-15 23:11:07 UTC
I have repeated an installation on multiple boxes, paying strict attention to mounting proc before stepping into the chroot.  Upon entering the chroot, I've issued the following command:

emerge -e system && emerge -e system

The first emerge -e system completes successfully.  The second emerge -e system fails on the first package, patch, with the following error:

<snip>
Calculating system dependencies... done!
>>> Emerging (1 of 100) sys-devel/patch-2.5.9 to /
>>> checksums files   ;-) patch-2.5.9.ebuild
>>> checksums files   ;-) patch-2.5.9-r1.ebuild
>>> checksums files   ;-) files/digest-patch-2.5.9
>>> checksums files   ;-) files/patch-2.5.9-cr-stripping.patch
>>> checksums files   ;-) files/digest-patch-2.5.9-r1
>>> checksums src_uri ;-) patch-2.5.9.tar.gz
>>> Unpacking source...
>>> Unpacking patch-2.5.9.tar.gz to /var/tmp/portage/patch-2.5.9/work
touch: setting times of `/var/tmp/portage/patch-2.5.9/.unpacked': Function not implemented

!!! ERROR: sys-devel/patch-2.5.9 failed.
Call stack:
  ebuild.sh, line 1557:   Called dyn_unpack

!!! IO Failure -- Failed 'touch .unpacked' in /var/tmp/portage/patch-2.5.9
!!! If you need support, post the topmost build error, and the call stack if relevant.
</snip>

It is interesting that the first emerge -e system completes without an error, but the second one fails.

Upon repeating the commands to mount proc within the chroot, a subsequent emerge -e system will complete successfully.  Specifically, if I remount proc using the following command:

mount -t proc proc /proc

then the emerge -e system will complete.  But a subsequent emerge -e system will always fail.

It appears that proc is being dismounted somewhere during the system rebuild, as a manual mount fixes the problem and a subsequent emerge -e system always reintroduces it.

I have been building identical toolkits with Glibc-2.3.6 in parallel chroots on the same boxes that are having the problem with Glibc 2.4.  Reverting to glibc-2.3.6-r3 eliminates the problem on all of the boxes.  The chroots are otherwise identical.
Comment 14 SpanKY gentoo-dev 2006-03-15 23:36:30 UTC
so run a bg job that constantly checks /proc to see when it gets unmounted
Comment 15 Bob 2006-03-16 21:01:44 UTC
sorry.  i'm not the developer.  i'm happy to fall back to glibc 2.3.6 and leave the problem unsolved.
Comment 16 SpanKY gentoo-dev 2006-03-16 21:15:20 UTC
k
Comment 17 Stefan de Konink 2006-03-28 16:25:40 UTC
(In reply to comment #14)
> so run a bg job that constantly checks /proc to see when it gets unmounted

Coreutils or Baselayout

It breaks in Baselayout.
Comment 18 Bob 2006-03-29 03:30:21 UTC
i'm reopening because somebody else is interested.
Comment 19 SpanKY gentoo-dev 2006-03-29 10:43:49 UTC
you still need to figure it out

ive rebuilt both coreutils and baselayout in chroots and never had a problem with my /proc being unmounted

there is also the fact that neither coreutils nor baselayout nor portage call `umount` in the ebuilds
Comment 20 SpanKY gentoo-dev 2006-05-12 19:17:16 UTC
*** Bug 133131 has been marked as a duplicate of this bug. ***