Bug 169805 - [linux] utime() syscall does not work in linuxulator
Summary: [linux] utime() syscall does not work in linuxulator
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Chagin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-12 14:00 UTC by Richard Yao
Modified: 2016-01-17 15:22 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao 2012-07-12 14:00:10 UTC
Unpacking packages with Gentoo's package manager in Gentoo Linux fails when running in Linux emulation.

[32;01m * [39;49;00mPackage:    sys-process/htop-1.0.1
[32;01m * [39;49;00mRepository: gentoo
[32;01m * [39;49;00mMaintainer: idl0r@gentoo.org
[32;01m * [39;49;00mUSE:        elibc_glibc kernel_linux unicode userland_GNU x86
[32;01m * [39;49;00mFEATURES:   sandbox
 [33;01m*[0m To use lsof features in htop(what processes are accessing
 [33;01m*[0m what files), you must have sys-process/lsof installed.

Fix: 

There is no known fix at this time.
How-To-Repeat: mkdir /mnt/linux
wget -O - http://distfiles.gentoo.org/releases/x86/current-stage3/stage3-i686-20120710.tar.bz2 | tar -x -C /mnt/linux
cp /etc/resolv.conf /mnt/linux/etc/resolv.conf
mount -t linprocfs none /mnt/linux/proc
mount -t linsysfs none /mnt/linux/sys
mount -t devfs none /mnt/linux/dev
mount -t fdescfs none /mnt/linux/dev/fd
chroot /mnt/linux
env-update
source /etc/profile
export PS1="(chroot) $PS1"
cd
emerge-webrsync
emerge htop
Comment 1 Richard Yao 2012-07-12 14:59:08 UTC
Commenting 'assert_sigpipe_ok "$myfail"' in _unpack_tar() in
/usr/lib/portage/bin/phase-helpers.sh will workaround this issue.

It might also be relevant that the chroot is inside a ZFS dataset.

Also, a similar issue occurs involving touch() when building gettext:

 * Package:    dev-perl/Locale-gettext-1.50.0
 * Repository: gentoo
 * Maintainer: perl@gentoo.org
 * USE:        elibc_glibc kernel_linux userland_GNU x86
 * FEATURES:   sandbox
>>> Unpacking source...
>>> Unpacking gettext-1.05.tar.gz to

/var/tmp/portage/dev-perl/Locale-gettext-1.50.0/work
tar: gettext-1.05/Makefile.PL: Cannot utime: Invalid argument
tar: gettext-1.05/README: Cannot utime: Invalid argument
tar: gettext-1.05/gettext.xs: Cannot utime: Invalid argument
tar: gettext-1.05/gettext.pm: Cannot utime: Invalid argument
tar: gettext-1.05/t/use.t: Cannot utime: Invalid argument
tar: gettext-1.05/t/bind.t: Cannot utime: Invalid argument
tar: gettext-1.05/t/raw.t: Cannot utime: Invalid argument
tar: gettext-1.05/t/frconvert.t: Cannot utime: Invalid argument
tar: gettext-1.05/t/jaconvert.t: Cannot utime: Invalid argument
tar: gettext-1.05/config.h: Cannot utime: Invalid argument
tar: gettext-1.05/test_data/jaeuc.po: Cannot utime: Invalid argument
tar: gettext-1.05/test_data/foo.po: Cannot utime: Invalid argument
tar: gettext-1.05/test_data/gen_test_data.pl: Cannot utime: Invalid argument
tar: Exiting with failure status due to previous errors
>>> Source unpacked in /var/tmp/portage/dev-perl/Locale-gettext-1.50.0/work
>>> Preparing source in

/var/tmp/portage/dev-perl/Locale-gettext-1.50.0/work/gettext-1.05 ...
 * Applying compatibility-with-POSIX-module.diff ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in

/var/tmp/portage/dev-perl/Locale-gettext-1.50.0/work/gettext-1.05 ...
 * Using ExtUtils::MakeMaker
 * perl Makefile.PL PREFIX=/usr INSTALLDIRS=vendor INSTALLMAN3DIR=none
DESTDIR=/var/tmp/portage/dev-perl/Locale-gettext-1.50.0/image/
checking for gettext... yes
checking for dgettext... yes
checking for ngettext... yes
checking for bind_textdomain_codeset... yes
Writing Makefile for Locale::gettext
>>> Source configured.
>>> Compiling source in

/var/tmp/portage/dev-perl/Locale-gettext-1.50.0/work/gettext-1.05 ...
 * emake OTHERLDFLAGS=-Wl,-O1 -Wl,--as-needed
make 'OTHERLDFLAGS=-Wl,-O1 -Wl,--as-needed'
touch: setting times of `blib/lib/Locale/.exists': Invalid argument
make: *** [blib/lib/Locale/.exists] Error 1
 * ERROR: dev-perl/Locale-gettext-1.50.0 failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info
'=dev-perl/Locale-gettext-1.50.0'`,
 * the complete build log and the output of `emerge -pqv
'=dev-perl/Locale-gettext-1.50.0'`.
 * The complete build log is located at
'/var/tmp/portage/dev-perl/Locale-gettext-1.50.0/temp/build.log'.
 * The ebuild environment file is located at
'/var/tmp/portage/dev-perl/Locale-gettext-1.50.0/temp/environment'.
 * Working directory:
'/var/tmp/portage/dev-perl/Locale-gettext-1.50.0/work/gettext-1.05'
 * S: '/var/tmp/portage/dev-perl/Locale-gettext-1.50.0/work/gettext-1.05'

This occurs in many other packages as well.
Comment 2 Richard Yao 2012-07-12 18:46:55 UTC
Doing `emerge -1v =app-arch/tar-1.23-r2` will make this issue go away.
Something changed between that and tar 1.26 that caused things to break.

I do not have a workaround for the touch issue, although I guess that
belongs in a separate problem report.
Comment 3 Richard Yao 2012-07-12 20:48:26 UTC
On 07/12/2012 01:46 PM, Richard Yao wrote:
> Doing `emerge -1v =app-arch/tar-1.23-r2` will make this issue go away.
> Something changed between that and tar 1.26 that caused things to break.
> 
> I do not have a workaround for the touch issue, although I guess that
> belongs in a separate problem report.
> 


For what it is worth, I figured out the cause of the touch issue. The
utimensat() syscall is unimplemented.
Comment 4 Richard Yao 2012-07-12 21:55:03 UTC
On 07/12/2012 03:48 PM, Richard Yao wrote:
> On 07/12/2012 01:46 PM, Richard Yao wrote:
>> Doing `emerge -1v =app-arch/tar-1.23-r2` will make this issue go away.
>> Something changed between that and tar 1.26 that caused things to break.
>>
>> I do not have a workaround for the touch issue, although I guess that
>> belongs in a separate problem report.
>>
> 
> For what it is worth, I figured out the cause of the touch issue. The
> utimensat() syscall is unimplemented.
> 


This can be worked around by adding a symlink to busybox:

ln -s /bin/busybox /usr/bin/touch

There is a similar issue involving `rm`. I have not debugged it in
depth, but it also can be fixed with a symlink to busybox:

ln -s /bin/busybox /bin/rm

Lastly, the issue with tar can be fixed with a symlink to busybox too:

ln -s /bin/busybox /bin/tar

We still need the appropriate syscalls implemented to make these
commands happy, but at least we have a workaround now.
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2012-07-16 05:33:51 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-emulation

reclassify
Comment 6 Dmitry Chagin freebsd_committer freebsd_triage 2015-05-24 21:26:36 UTC
grab
Comment 7 Dmitry Chagin freebsd_committer freebsd_triage 2016-01-17 15:22:09 UTC
utimensat merged to the stable/10. there is no plan to merge it to the stable/9, so close PR