[klibc] sample sleep command killed

maximilian attems max at stro.at
Wed Jul 14 09:22:36 PDT 2010


On Wed, Jul 14, 2010 at 07:34:46AM -0400, Phil Howard wrote:
> I re-wrote the compile script to build klibc (cleaning up how I do it,
> and how to find the source tarballs). 

why would there be a need for this. this seems just like a waste of
time.

> It seems to be compiling fine.
> I tried several of the commands in usr/utils/static and most one.
> However, the sleep command fails in a strange way (EINVAL on execve):

why doesn't this surprise me!? works just fine here
./usr/utils/static/sleep 0.1

 
> ================================================================
> faraday/phil /home/phil/klibc-project-0 581> strace -ftt -s 96
> klibc-1.5.18/usr/utils/static/true
> 07:33:08.185542 execve("klibc-1.5.18/usr/utils/static/true",
> ["klibc-1.5.18/usr/utils/static/true"], [/* 38 vars */]) = 0
> 07:33:08.185880 _exit(0)                = ?
> Process 29017 detached
> faraday/phil /home/phil/klibc-project-0 582> strace -ftt -s 96
> klibc-1.5.18/usr/utils/static/sleep 6
> 07:33:10.636524 execve("klibc-1.5.18/usr/utils/static/sleep",
> ["klibc-1.5.18/usr/utils/static/sleep", "6"], [/* 38 vars */]) = -1
> EINVAL (Invalid argument)
> 07:33:10.636930 +++ killed by SIGKILL +++
> Process 29020 detached
> faraday/phil /home/phil/klibc-project-0 583> ldd
> klibc-1.5.18/usr/utils/static/true klibc-1.5.18/usr/utils/static/sleep
> klibc-1.5.18/usr/utils/static/true:
>         not a dynamic executable
> klibc-1.5.18/usr/utils/static/sleep:
>         not a dynamic executable
> faraday/phil /home/phil/klibc-project-0 584> file
> klibc-1.5.18/usr/utils/static/true klibc-1.5.18/usr/utils/static/sleep
> klibc-1.5.18/usr/utils/static/true:  ELF 32-bit LSB executable, Intel
> 80386, version 1 (SYSV), statically linked, stripped
> klibc-1.5.18/usr/utils/static/sleep: ELF 32-bit LSB executable, Intel
> 80386, version 1 (SYSV), statically linked, stripped
> faraday/phil /home/phil/klibc-project-0 585> ls -dl
> klibc-1.5.18/usr/utils/static/true klibc-1.5.18/usr/utils/static/sleep
> -rwxr-xr-x 1 phil phil 4168 2010-07-14 07:17 klibc-1.5.18/usr/utils/static/sleep
> -rwxr-xr-x 1 phil phil  548 2010-07-14 07:17 klibc-1.5.18/usr/utils/static/true
> faraday/phil /home/phil/klibc-project-0 586>
> ================================================================

strace -ftt -s 96 ./usr/utils/static/sleep 0.1
18:30:11.741777 execve("./usr/utils/static/sleep", ["./usr/utils/static/sleep", "0.1"], [/* 45 vars */]) = 0
18:30:11.742627 nanosleep({0, 100000000}, 0x7fff9b1ac720) = 0
18:30:11.842925 _exit(0)                = ?

 
> I'm guessing execve thinks this can't be executed for some reason.
> Even so, SIGKILL seems strange (shouldn't the shell forked child just
> report the execve failure, instead?).  Any ideas where I should look,
> next?

axe your wrong built and do it the recommended way.



More information about the klibc mailing list