[Hampshire] Executable wierdness (?ubuntu-related?)

Top Page

Reply to this message
Author: Vic
Date:  
To: hampshire
Subject: [Hampshire] Executable wierdness (?ubuntu-related?)
Hi All.

I'm having a quick play with an Ubuntu64 machine. It's not doing quite
what I expected...

I've got an executable. It's currently called foo :-

vic@Foillist:~$ ls -l foo
-rwxr-xr-x 1 vic vic 326465 2007-12-17 11:12 foo

The executable bits are set. But it won't execute:

vic@Foillist:~$ ./foo
bash: ./foo: No such file or directory

Now it's possible that this is an incorrect binary for this system (I
built it on a 32-bit WBEL4 box). But strace seems to think it's the file
that can't be found, rather than it being something invalid :

vic@Foillist:~$ strace ./foo
execve("./foo", ["./foo"], [/* 31 vars */]) = -1 ENOENT (No such file or
directory)
dup(2)                                  = 3
fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b94371d7000
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: No such file or di"..., 40strace: exec: No such
file or directory
) = 40
close(3)                                = 0
munmap(0x2b94371d7000, 4096)            = 0
exit_group(1)                           = ?
Process 4974 detached


And od can see it :

vic@Foillist:~$ od -t x1 foo | head -n 2
0000000 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
0000020 02 00 03 00 01 00 00 00 00 a0 04 08 80 00 00 00

Am I doing something monumentally stupid?

Thanks!

Vic.