tar xzf does not work anymore on my arm system

Denys Vlasenko vda.linux at googlemail.com
Mon Apr 21 22:03:53 UTC 2008


On Monday 21 April 2008 21:36, Martinb_ARM_NOMMU_KISSDVD wrote:
> After migrating all old busybox programs to a recent version I did found the
> following problem
> 
> On old 1.00(pre-3) I can use tar without problems
> 
> On the current (1.10.1) I have the following output:
> 
> /paste
> 
> /hdd/hasler # ./tar xzf test.tar
> tar: exec failed: No such file or directory
> tar: short read
> /hdd/hasler #
> 
> 
> I can create a tar without any problem
> 
> if I run strace I get the following output
> 
> /hdd/hasler # strace ./tar xzf test.tar

Huh. You really have gzipped tar WITHOUT .gz extension?

> execve("./tar", ["./tar", "xzf", "test.tar"], [/* 4 vars */]) = 0
> ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
> ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
> open("test.tar", O_RDONLY|O_LARGEFILE)  = 3
> pipe([4, 5])                            = 0
> vfork(tar: exec failed: No such file or directory
> )                                 = 189
> --- SIGCHLD (Child exited) @ 0 (0) ---
> close(5)                                = 0
> read(4, "", 512)                        = 0
> write(2, "tar: short read\n", 16tar: short read
> )       = 16
> _exit(1)    > = ? 

It comes from here: archival/libunarchive/open_transformer.c

#if BB_MMU
        pid = fork();
#else
        pid = vfork();
#endif
        if (pid == -1)
                bb_perror_msg_and_die("fork failed");

        if (pid == 0) {
                /* child process */
                close(fd_pipe.rd); /* We don't want to read from the parent */
                // FIXME: error check?
#if BB_MMU
                transformer(src_fd, fd_pipe.wr);
                if (ENABLE_FEATURE_CLEAN_UP) {
                        close(fd_pipe.wr); /* Send EOF */
                        close(src_fd);
                }
                exit(0);
#else
                {
                        char *argv[4];
                        xmove_fd(src_fd, 0);
                        xmove_fd(fd_pipe.wr, 1);
                        argv[0] = (char*)transform_prog;
                        argv[1] = (char*)"-cf";
                        argv[2] = (char*)"-";
                        argv[3] = NULL;
                        BB_EXECVP(transform_prog, argv);
                        bb_perror_msg_and_die("exec failed"); <================ HERE
                }
#endif
                /* notreached */
        }

It tries to execvp "gunzip". (Message needs to be fixed to include
the name of the program being execed).

Works for me (NOMMU build):

$ ./busybox tar -czf a.tar.gz sysklogd
$ rm -rf sysklogd
$ strace -f -o zz ./busybox tar -xvzf a.tar.gz
sysklogd/
sysklogd/.logread.o.cmd
sysklogd/Kbuild
sysklogd/lib.a
sysklogd/klogd.c
sysklogd/klogd.o
sysklogd/syslogd.c
sysklogd/syslogd.o
sysklogd/.built-in.o.cmd
sysklogd/logread.c
sysklogd/logread.o
sysklogd/.klogd.o.cmd
sysklogd/built-in.o
sysklogd/.logger.o.cmd
sysklogd/.syslogd.o.cmd
sysklogd/logger.c
sysklogd/logger.o
sysklogd/Config.in
sysklogd/.lib.a.cmd

and strace says:

16286 execve("./busybox", ["./busybox", "tar", "-xvzf", "a.tar.gz"], [/* 32 vars */]) = 0
16286 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
16286 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
16286 getuid32()                        = 0
16286 brk(0)                            = 0x8114000
16286 brk(0x8115000)                    = 0x8115000
16286 open("a.tar.gz", O_RDONLY|O_LARGEFILE) = 3
16286 pipe([5, 6])                      = 0
16286 vfork()                           = 16287
16286 close(6)                          = 0
16286 read(5,  <unfinished ...>
16287 close(5)                          = 0
16287 dup2(3, 0)                        = 0
16287 close(3)                          = 0
16287 dup2(6, 1)                        = 1
16287 close(6)                          = 0
16287 execve("/proc/self/exe", ["gunzip", "-cf", "-"], [/* 32 vars */]) = 0
16287 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, 0xffc55d38) = -1 ENOTTY (Inappropriate ioctl for device)

That was with PREFER_APPLETS on. Turning it off:

20065 execve("./busybox", ["./busybox", "tar", "-xvzf", "a.tar.gz"], [/* 32 vars */]) = 0
20065 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
20065 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
20065 getuid32()                        = 0
20065 brk(0)                            = 0x8113000
20065 brk(0x8114000)                    = 0x8114000
20065 open("a.tar.gz", O_RDONLY|O_LARGEFILE) = 3
20065 pipe([5, 6])                      = 0
20065 vfork()                           = 20066
20066 close(5)                          = 0
20066 dup2(3, 0)                        = 0
20066 close(3)                          = 0
20066 dup2(6, 1)                        = 1
20066 close(6)                          = 0
20066 execve("/root/bin/gunzip", ["gunzip", "-cf", "-"], [/* 32 vars */]) = -1 ENOENT (No such file or directory)
20066 execve("/bin/gunzip", ["gunzip", "-cf", "-"], [/* 32 vars */] <unfinished ...>
20065 close(6)                          = 0
20065 read(5,  <unfinished ...>
20066 <... execve resumed> )            = 0
20066 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, 0xff99a278) = -1 ENOTTY (Inappropriate ioctl for device)

Still wants to execute gunzip, as expected.

You simply have no gunzip in your $PATH.
--
vda



More information about the busybox mailing list