Cannot run 32-bit dynamic executable on 64-bit Ubuntu

0

For the record, I have spent nearly 6 hours today working on this. I've exhausted Google and other similar questions on Stack Overflow/Superuser and other various mailing lists.

I'm trying to run the following application:

# file ./ncsvc
./ncsvc: setuid setgid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped

# ls -la ncsvc
-rws--s--x 1 root root 1931688 Dec 19 20:41 ncsvc

I'm running a 64-bit version of Ubuntu:

# uname -m
x86_64

Now, with that past us, here's some details on the libraries this application needs:

# readelf -a ./ncsvc | grep interpreter
      [Requesting program interpreter: /lib/ld-linux.so.2]

# readelf -a ./ncsvc | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [libz.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

This is where I'm getting stuck:

# ls -la /lib/ld-linux.so.2
lrwxrwxrwx 1 root root 32 Dec 19 23:31 /lib/ld-linux.so.2 -> /lib/x86_64-linux-gnu/ld-2.15.so

# locate libdl.so.2
/lib/i386-linux-gnu/libdl.so.2
/lib/x86_64-linux-gnu/libdl.so.2

# locate libz.so.1
/lib/i386-linux-gnu/libz.so.1
/lib/i386-linux-gnu/libz.so.1.2.3.4
/lib/x86_64-linux-gnu/libz.so.1
/lib/x86_64-linux-gnu/libz.so.1.2.3.4

# locate libpthread.so.0
/lib/i386-linux-gnu/libpthread.so.0
/lib/x86_64-linux-gnu/libpthread.so.0

# locate libm.so.6
/lib/i386-linux-gnu/libm.so.6
/lib/x86_64-linux-gnu/libm.so.6

# locate libc.so.6
/lib/i386-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libc.so.6

As far as I can tell, I have the dynamic linker and all of the shared libraries it needs to run (tl;dr: ia32-libs IS installed). Except when I run it, I get this error.

# ./ncsvc
bash: ./ncsvc: cannot execute binary file

Lastly, I'm not sure if this means anything helpful.

# ldd -v ./ncsvc
        not a dynamic executable

Chris Olin

Posted 2013-12-20T04:54:04.923

Reputation: 167

do you have access to the source code? Just rebuild it... – MattDMo – 2013-12-20T05:07:03.360

If it wasn't clear before, let me spell it out.

I don't have access to the source. It's proprietary and the owner (Juniper) has not released a 64-bit version. Other people seem to have gotten it to work on 64-bit environments without issue however. – Chris Olin – 2013-12-20T05:16:11.877

Answers

0

The kernel was not complied with 32-bit emulation support. Rebooting and choosing a kernel with it complied resolved this issue.

Chris Olin

Posted 2013-12-20T04:54:04.923

Reputation: 167