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

Top Page
Author: Hugo Mills
Date:  
To: lug, Hampshire LUG Discussion List
CC: 
Subject: Re: [Hampshire] Executable wierdness (?ubuntu-related?)

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x586cc100.hantslug.org.uk.23493': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Mon Dec 17 12:05:01 2007 GMT
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
On Mon, Dec 17, 2007 at 11:23:31AM -0000, Vic wrote:
> 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?


I suspect that you're missing the 32-bit libc and associated tools
(like the 32-bit runtime linker). You may also be missing the kernel
support needed to run 32-bit binaries, but that's less likely.

On Debian, there's a package called ia32-libs which contains or
depends on most of the basic libraries used by 90% of packages. I
don't know what the equivalent is on Centos, or whether you simply
have to install libc6.i386.

Alternatively, build the binary again on your 64 bit box.

Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
       --- Great oxymorons of the world, no. 1: Family Holiday ---