"cannot execute binary file"

Issues related to applications and software problems
Post Reply
drew_caplan
Posts: 7
Joined: 2016/01/11 23:50:35

"cannot execute binary file"

Post by drew_caplan » 2016/01/12 00:24:42

I am running a 64 bit CentOS 7.1 VPS and I am trying to install a piece of software on it that is 32 bit. I got it installed okay but when I try and run it I am getting the following error

Code: Select all

[root@001 bin]# bash ./nre
./nre: ./nre: cannot execute binary file
I believe this is a library binary issue but everything that I believe is needed to run a 32 bit application is installed but I am not sure how to tell. Here are some details of what the program:
nre: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked (uses shared libs), stripped
[root@001 bin]#

User avatar
avij
Forum Moderator
Posts: 2562
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: "cannot execute binary file"

Post by avij » 2016/01/12 01:25:06

Don't use bash to execute a binary file. For example:

Code: Select all

$ bash /usr/bin/ls
/usr/bin/ls: /usr/bin/ls: cannot execute binary file
Instead, try just plain ./nre

If it complains about permissions, try chmod u+x nre to set the executable bit.

drew_caplan
Posts: 7
Joined: 2016/01/11 23:50:35

Re: "cannot execute binary file"

Post by drew_caplan » 2016/01/12 14:57:18

Thank you for your help! When I try that I get the following message:

Code: Select all

[root@001 bin]# ./nre
Segmentation fault

drew_caplan
Posts: 7
Joined: 2016/01/11 23:50:35

Re: "cannot execute binary file"

Post by drew_caplan » 2016/01/12 15:22:26

I believe in my research that the software I am trying to run has been compiled against a set of 32 bit binary libraries that are no longer current (although I could be wrong here). So I guess my question should be, is it possible to determine what 32 bit library components I do need to install to make this specific piece of software work?

drew_caplan
Posts: 7
Joined: 2016/01/11 23:50:35

Re: "cannot execute binary file"

Post by drew_caplan » 2016/01/12 17:58:47

Okay, so I think this list tells me what dependencies it needs but is there an easy way to determine what I am missing?

Code: Select all

/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
[^_]
WARNING: this application has been launched as root, which may allow for
the creation of files with restrictive permissions, rendering them unreadable
or writeable by the group niagarad. Therefore, it is STRONGLY DISCOURAGED!
Please launch it as a user of the group niagarad to avoid complications.
com/tridium/sys/Nre
GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-54)
GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-54)
GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-54)
GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-54)
GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-54)
GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-54)
.symtab
.strtab
.shstrtab
.interp
.note.ABI-tag
.gnu.hash
.dynsym
.dynstr
.gnu.version
.gnu.version_r
.rel.dyn
.rel.plt
.init
.text
.fini
.rodata
.eh_frame_hdr
.eh_frame
.ctors
.dtors
.jcr
.dynamic
.got
.got.plt
.data
.bss
.comment
call_gmon_start
crtstuff.c
__CTOR_LIST__
__DTOR_LIST__
__JCR_LIST__
dtor_idx.5793
completed.5791
__do_global_dtors_aux
frame_dummy
__CTOR_END__
__FRAME_END__
__JCR_END__
__do_global_ctors_aux
nreExe.cpp
__preinit_array_start
__fini_array_end
_GLOBAL_OFFSET_TABLE_
__preinit_array_end
__fini_array_start
__init_array_end
__init_array_start
_DYNAMIC
data_start
DW.ref.__gxx_personality_v0
__libc_csu_fini
_ZN11NreLauncher11getInstanceEv
_start
__gmon_start__
_Jv_RegisterClasses
_fp_hw
_fini
_ZN11NreLauncher3nreEPKciPPc
__libc_start_main@@GLIBC_2.0
_IO_stdin_used
__data_start
umask@@GLIBC_2.0
stderr@@GLIBC_2.0
__dso_handle
__DTOR_END__
__libc_csu_init
getuid@@GLIBC_2.0
fwrite@@GLIBC_2.0
__bss_start
_end
_edata
__gxx_personality_v0@@CXXABI_1.3
__i686.get_pc_thunk.bx
main
_init
geteuid@@GLIBC_2.0

User avatar
avij
Forum Moderator
Posts: 2562
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: "cannot execute binary file"

Post by avij » 2016/01/12 18:41:30

"GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-54)" suggests something from the CentOS 5 era. You may get some hints if you run the program through strace, ie. strace ./nre. There are some compatibility libraries that may (or may not) help, yum search compat | grep i686.

It would also be a good idea to research if you can get a more recent version of that software from somewhere. One other option worth exploring might be to install that in a 32bit CentOS 5.11 virtual machine.

User avatar
TrevorH
Forum Moderator
Posts: 22984
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: "cannot execute binary file"

Post by TrevorH » 2016/01/12 19:06:43

Also try ldd -v nre
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

drew_caplan
Posts: 7
Joined: 2016/01/11 23:50:35

Re: "cannot execute binary file"

Post by drew_caplan » 2016/01/12 21:16:17

I am going to run this program in a Centos 5.1 environment to see if this solves the issue.

Post Reply