Protection fault with 'time' command.

Denys Vlasenko vda.linux at googlemail.com
Fri Feb 19 17:47:27 UTC 2010


On Friday 19 February 2010 13:39, Steven J. Hill wrote:
> Denys Vlasenko wrote:
> > On Friday 19 February 2010 07:03, Steven J. Hill wrote:
> >> Greetings.
> >>
> >> I am trying to track down an issue with the 'time' command giving me a
> >> general protection fault on my uClinux no-MMU ARM platform. I have
> >> tracked it down to the line in 'run_command' doing the 'execvp' call:
> >>
> >>    BB_EXECVP(cmd[0], cmd);
> >>
> >> If I run 'time' and do not give it any arguments, I get the fault.
> >
> > Which version of busybox do you run?
> >
> I am running version 10.0.1, but I did a diff between 10.0.1 and the latest
> 1.16.0 release and did not see any significant differences in the 'time.c'
> code. Thanks.

The first line in this fragment:

        opt_complementary = "-1"; /* at least one arg */
        /* "+": stop on first non-option */
        opt = getopt32(argv, "+vp");

makes time in 1.16.0 complain if there is no args:

# /bin/time
BusyBox v1.16.0 (2010-01-26 07:47:42 CET) multi-call binary.

Usage: time [OPTIONS] PROG [ARGS]

Run PROG. When it finishes, its resource usage is displayed.

Options:
        -v      Verbose


-- 
vda


More information about the busybox mailing list