0

I have successfully installed a piece of 32 bit software on a 64 bit VPS running CentOS 7.1. I had to install the 32 bit library before it would install but now when I try to launch it I am getting this error:

[root@001 bin]# bash ./nre
./nre: ./nre: cannot execute binary file

If I look up the file requirements I I get:

[root@001 bin]# file nre
nre: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked (uses shared libs), stripped

All of my reading points to the error likely being a 32 binary issue but since I already have the library installed I am a little confused as to why I am receiving this error. How do I go about diagnosing if I am indeed missing a library and if I am, which one?

Alright, using the strings -a command I think I was able to produce a list of dependancies. Is there an easy way to determine what I am missing?

/lib/ld-linux.so.2
libnre.so
__gmon_start__
_Jv_RegisterClasses
_init
_ZN11NreLauncher11getInstanceEv
_fini
_ZN11NreLauncher3nreEPKciPPc
libdl.so.2
libstdc++.so.6
__gxx_personality_v0
libm.so.6
libgcc_s.so.1
libpthread.so.0
libc.so.6
_IO_stdin_used
umask
stderr
getuid
fwrite
geteuid
__libc_start_main
_edata
__bss_start
_end
CXXABI_1.3
GLIBC_2.0
PTRh
QVhp
Drew Caplan
  • 21
  • 2
  • 6

3 Answers3

1

It may be that you are trying to use Bash to execute a binary file.

Instead, try simply running the following:

./nre
  • 2
    That probably indicates a problem in the compiled program itself. Some more information about the program you are trying to run might be helpful here, which ldd may be able to provide. – Jack Latrobe Jan 12 '16 at 05:34
  • It is a program called Niagara that is used for data monitoring. It is designed to run on a Red Hat OS but since CentOS is so closely related I am hoping it will. When I run ldd I get `not a dynamic executable`. We are trying to reach the software's support Team to find out what libraries we need but they are slow to respond. Is there a way to determine what libraries it needs? – Drew Caplan Jan 12 '16 at 14:10
1

Try using linux32 nre to run 32-bit.

Additionally, if you're having problems executing a binary file you can install the strace package and run strace nre or strace linux32 nre to get a rather verbose syscall trace, which may give you a better idea of where to look for issues.

doombird
  • 121
  • 6
0

You can get some more info about the file with objdump...

objdump -xRTW nre

There are a few objdump options to play with, including disassembly to look at instructions.

Your original output of the "file" command shows that it is statically linked, i.e., it is not linked dynamically. Static linking means that library code is copied into the executable at link time, which then has everything it needs to run, including system calls (int 0x80 instruction in 32-bit linux). Dynamic linking would mean that the library code is not copied into the executable, thus at runtime library calls actually are a call into code inside shared libraries on the machine the program is running on.

Simply put, if an executable is statically linked, it has no library dependencies (check it out and you should find int 0x80 instructions in it; just look at the proceeding mov eax instruction to find out which system call is being made where).

Your file command output indicated the executable was stripped with the strip command after the executable file was created. strip can remove a lot of information from the executable, including symbols.

Your seg fault has to do with that program running on your CentOS 7.1 machine.

CentOS 7 says it supports 32 bit programs...

https://access.redhat.com/solutions/509373

Interesting to me; either the application is doing something specific that is unsupported, or perhaps the environment needs some configuration changes to enable the application to run. If you have documentation on the application, i.e., what it needs in the way of configuration of itself, that might help. Who knows, there may be something wrong it its own configuration file (presumably it uses one, like a nre.conf, etc.)