Why won't my binary run?

5,503

Solution 1

The 64-bit O/S does not have the 32-bit libraries installed.

apt-get update; apt-get upgrade; apt-get install ia32-libs

This will provide the missing /lib/ld-linux.so.2.

Solution 2

You are probably missing the i386 libc, try installing it with apt-get install libc6-i386.

You can also add multiarch support to your system by running:

dpkg --add-architecture i386
apt-get update

Afterwards you can install a package for i386 with apt-get install package-name:i386 if it supports multiarch.

For more information have a look at the multiarch howto

Share:
5,503
user1107906
Author by

user1107906

Updated on September 18, 2022

Comments

  • user1107906
    user1107906 over 1 year

    I have a binary that runs on my Debian Squeeze system, but then it doesn't do anything on my Debian Wheezy (kernel Linux 3.2.0-4-amd64) system. Both systems are 64 bit, while the executable is a 32 bit binary.

    Here's the output of:

    me@myhost:~$ file myApp.run
    myApp.run: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, stripped
    

    How do I go about troubleshooting this? I get no output whatsoever, it just returns immediately.

    Running the binary with strace:

    chadmichael@heraclitus: ~/dir$ sudo strace ./myApp.run 
    execve("./myApp.run", ["./myApp"...], [/* 17 vars */]) = 0
    [ Process PID=24457 runs in 32 bit mode. ]
    old_mmap(0xc6d000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0xc6d000) = 0xc6d000
    readlink("/proc/self/exe", "/dir/myApp.run.run", 4096) = 129
    old_mmap(0x8048000, 1108297, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x8048000
    mprotect(0x8048000, 1108294, PROT_READ|PROT_EXEC) = 0
    old_mmap(0x8157000, 42979, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0x10f000) = 0x8157000
    mprotect(0x8157000, 42976, PROT_READ|PROT_WRITE) = 0
    old_mmap(0x8162000, 15736, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x8162000
    brk(0x8166000)                          = 0x866e000
    open("/lib/ld-linux.so.2", O_RDONLY)    = -1 ENOENT (No such file or directory)
    _exit(127)      
    
                        = ?
    
    • user1107906
      user1107906 over 11 years
      It's a bitrock installer. I build it from their toolkit. It's supposed to run an interactive installer program. I'll check out strace.
    • user1107906
      user1107906 over 11 years
      @Gilles I don't understand removing the UPDATE . . . without it, the question reads a bit funny, like "I don't know anything . . . here's the strace" Know what I mean?
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 11 years
      Writing “UPDATE” in the middle of the question is only meaningful to the few people who saw your question both before and after the update. It's useless in the long run. There's no more need for “UPDATE” in the middle of a Stack Exchange question than in a Wikipedia article.
  • derobert
    derobert over 11 years
    If a library was missing, instead of nothing, he'd get an error. Instead, OP gets "no output whatsoever".
  • sunnysideup
    sunnysideup over 11 years
    @derobert you are right, i'll delete the answer.
  • sunnysideup
    sunnysideup over 11 years
    @chad yeah but based on your original description i was wrong, after i saw your update i undeleted it
  • derobert
    derobert over 11 years
    Really weird there was no error message. But yeah... Seems you're right. (Though I'm not sure Squeeze really has multiarch, I think you need Wheezy for that)
  • sunnysideup
    sunnysideup over 11 years
    @derobert squeeze doesn't have multiarch but the target system is wheezy