[csw-users] Wrong ELF class - ELFCLASS32?
Victor Hooi
victorhooi at yahoo.com
Thu Jul 28 02:12:21 CEST 2011
Hi,
I managed to get it working by setting the LD_LIBRARY_PATH_32/64 variables
as suggested =):
export LD_LIBRARY_PATH_32=/db/pub/eq/csw/opt/csw/lib
export LD_LIBRARY_PATH_64=/db/pub/eq/csw/opt/csw/lib/64
The 64-bit one is the one that seems to have done it. Thanks to Maciej and
Dago for their replies.
For completeness, I've included the truss output from a working and
non-working system (before I set the LD_LIBRARY_PATH_32/64 variables) at the
end of this email.
Bzip2 now works, as does gdb. However, I noticed emacs has issues:
bash$ ./emacs
> Warning: arch-dependent data dir
> (/opt/csw/libexec/emacs/23.1/i386-pc-solaris2.8/) does not exist.
> Warning: arch-independent data dir (/opt/csw/share/emacs/23.1/etc/) does
> not exist.
> Warning: Lisp directory `/opt/csw/share/emacs/23.1/site-lisp' does not
> exist.
> Warning: Lisp directory `/opt/csw/share/emacs/site-lisp' does not exist.
> Warning: Lisp directory `/opt/csw/share/emacs/23.1/lisp' does not exist.
> Warning: Lisp directory `/opt/csw/share/emacs/23.1/leim' does not exist.
> Error: charsets directory (/opt/csw/share/emacs/23.1/etc/charsets) does not
> exist.
> Emacs will not function correctly without the character map files.
> Please check your installation!
> Cannot open load file: warnings
Any suggestions on the cleanest way to solve the above? Assume for not we
can't touch /opt, or create symlinks there.
This whole relocating from /opt to /usr/local is quite painful *sigh*. Ah
well, it's one of the strange requirements we have - we can install things
to /usr/local, but not /opt.
Cheers,
Victor
Working system:
victorh at puppet:/opt/csw/bin$ truss bzip2
> execve("/usr/bin/bzip2", 0x08047D6C, 0x08047D74) argc = 1
> sysinfo(SI_MACHINE, "i86pc", 257) = 6
> mmap(0x00000000, 32, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON,
> -1, 0) = 0xFEFB0000
> mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) =
> 0xFEFA0000
> mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) =
> 0xFEF90000
> mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC,
> MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEF80000
> memcntl(0xFEFB7000, 32064, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
> memcntl(0x08050000, 6636, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
> resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
> resolvepath("/usr/bin/bzip2", "/usr/bin/bzip2", 1023) = 14
> sysconfig(_CONFIG_PAGESIZE) = 4096
> stat64("/usr/bin/bzip2", 0x080479B0) = 0
> open("/var/ld/ld.config", O_RDONLY) Err#2 ENOENT
> stat64("/lib/libbz2.so.1", 0x08047160) Err#2 ENOENT
> stat64("/usr/lib/libbz2.so.1", 0x08047160) = 0
> resolvepath("/usr/lib/libbz2.so.1", "/usr/lib/libbz2.so.1", 1023) = 20
> open("/usr/lib/libbz2.so.1", O_RDONLY) = 3
> mmapobj(3, MMOBJ_INTERPRET, 0xFEF80A58, 0x080471CC, 0x00000000) = 0
> close(3) = 0
> memcntl(0xFEF50000, 6184, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
> mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC,
> MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEF40000
> stat64("/lib/libc.so.1", 0x08047160) = 0
> resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
> open("/lib/libc.so.1", O_RDONLY) = 3
> mmapobj(3, MMOBJ_INTERPRET, 0xFEF40080, 0x080471CC, 0x00000000) = 0
> close(3) = 0
> memcntl(0xFEDF0000, 187200, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
> mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC,
> MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEDE0000
> getcontext(0x08047810)
> getrlimit(RLIMIT_STACK, 0x08047808) = 0
> getpid() = 12236 [12235]
> lwp_private(0, 1, 0xFEDE2A40) = 0x000001C3
> setustack(0xFEDE2AA0)
> sysi86(SI86FPSTART, 0xFEF38CD4, 0x0000133F, 0x00001F80) = 0x00000001
> schedctl() = 0xFEDDA000
> sigaction(SIGSEGV, 0x08047BD0, 0x08047C50) = 0
> sigaction(SIGBUS, 0x08047BD0, 0x08047C50) = 0
> sysconfig(_CONFIG_PAGESIZE) = 4096
> ioctl(1, TCGETA, 0x08047B80) = 0
> fstat64(2, 0x08046C00) = 0
> bzip2write(2, " b z i p 2", 5) = 5
> : I won't write compressed data to a terminal.
> write(2, " : I w o n ' t w r".., 47) = 47
> bzip2write(2, " b z i p 2", 5) = 5
> : For help, type: `write(2, " : F o r h e l p , ".., 19) = 19
> bzip2write(2, " b z i p 2", 5) = 5
> --help'.
> write(2, " - - h e l p ' .\n", 10) = 10
> _exit(1)
Non-working system:
execve("bzip2", 0x080478B4, 0x080478BC) argc = 1
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON,
-1, 0) = 0xFEFF0000
resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
getcwd("/db/pub/eq/csw/opt/csw/bin", 1017) = 0
resolvepath("/db/pub/eq/csw/opt/csw/bin/bzip2",
"/db/pub/eq/csw/opt/csw/bin/bzip2", 1023) = 32
sysconfig(_CONFIG_PAGESIZE) = 4096
stat64("/db/pub/eq/csw/opt/csw/bin/bzip2", 0x08047640) = 0
open("/var/ld/ld.config", O_RDONLY) Err#2 ENOENT
stat64("/db/pub/eq/csw/opt/csw/bdb48/lib/libc.so.1", 0x08046EE0) Err#2
ENOENT
stat64("/db/pub/eq/csw/opt/csw/lib/svn/libc.so.1", 0x08046EE0) Err#2 ENOENT
stat64("/db/pub/eq/csw/opt/csw/lib/libc.so.1", 0x08046EE0) Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/boost/current/lib/libc.so.1", 0x08046EE0) Err#2
ENOENT
stat64("/usr/sfw/lib/libc.so.1", 0x08046EE0) Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/log4cplus/current/lib/libc.so.1", 0x08046EE0)
Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/xerces-c/current/lib/libc.so.1", 0x08046EE0)
Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/omex/current/lib/libc.so.1", 0x08046EE0) Err#2
ENOENT
stat64("./libc.so.1", 0x08046EE0) Err#2 ENOENT
stat64("/data/oracle/product/client/11.2.0.1/lib/libc.so.1", 0x08046EE0)
Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/quickfix/current/lib/libc.so.1", 0x08046EE0)
Err#2 ENOENT
stat64("/db/pub/eq/Marvin//Libs/libc.so.1", 0x08046EE0) Err#2 ENOENT
stat64("./libc.so.1", 0x08046EE0) Err#2 ENOENT
stat64("/lib/libc.so.1", 0x08046EE0) = 0
resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
open("/lib/libc.so.1", O_RDONLY) = 3
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) =
0xFEFB0000
mmap(0x00010000, 1212416, PROT_NONE,
MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEE80000
mmap(0xFEE80000, 1105861, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xFEE80000
mmap(0xFEF9E000, 30311, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 1105920) = 0xFEF9E000
mmap(0xFEFA6000, 4256, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFEFA6000
munmap(0xFEF8E000, 65536) = 0
memcntl(0xFEE80000, 124344, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(3) = 0
mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEF90000
munmap(0xFEFB0000, 32768) = 0
getcontext(0x080474B0)
getrlimit(RLIMIT_STACK, 0x080474A8) = 0
getpid() = 8908 [8907]
lwp_private(0, 1, 0xFEF92A00) = 0x000001C3
setustack(0xFEF92A60)
sysi86(SI86FPSTART, 0xFEFA6750, 0x0000133F, 0x00001F80) = 0x00000001
sysconfig(_CONFIG_PAGESIZE) = 4096
brk(0x080615C0) = 0
brk(0x080635C0) = 0
stat64("/usr/lib/locale/en_AU.ISO8859-1/en_AU.ISO8859-1.so.3", 0x08046880) =
0
resolvepath("/usr/lib/locale/en_AU.ISO8859-1/en_AU.ISO8859-1.so.3",
"/usr/lib/locale/en_AU.ISO8859-1/en_AU.ISO8859-1.so.3", 1023) = 52
open("/usr/lib/locale/en_AU.ISO8859-1/en_AU.ISO8859-1.so.3", O_RDONLY) = 3
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) =
0xFEFB0000
mmap(0x00010000, 86016, PROT_NONE,
MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEE60000
mmap(0xFEE60000, 14986, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT,
3, 0) = 0xFEE60000
mmap(0xFEE73000, 5010, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 12288) = 0xFEE73000
munmap(0xFEE64000, 61440) = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON,
-1, 0) = 0xFEFC0000
memcntl(0xFEE60000, 5500, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(3) = 0
stat64("/db/pub/eq/csw/opt/csw/bdb48/lib/libc.so.1", 0x080467E0) Err#2
ENOENT
stat64("/db/pub/eq/csw/opt/csw/lib/svn/libc.so.1", 0x080467E0) Err#2 ENOENT
stat64("/db/pub/eq/csw/opt/csw/lib/libc.so.1", 0x080467E0) Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/boost/current/lib/libc.so.1", 0x080467E0) Err#2
ENOENT
stat64("/usr/sfw/lib/libc.so.1", 0x080467E0) Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/log4cplus/current/lib/libc.so.1", 0x080467E0)
Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/xerces-c/current/lib/libc.so.1", 0x080467E0)
Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/omex/current/lib/libc.so.1", 0x080467E0) Err#2
ENOENT
stat64("./libc.so.1", 0x080467E0) Err#2 ENOENT
stat64("/data/oracle/product/client/11.2.0.1/lib/libc.so.1", 0x080467E0)
Err#2 ENOENT
stat64("/db/pub/eq/tools/lib/quickfix/current/lib/libc.so.1", 0x080467E0)
Err#2 ENOENT
stat64("/db/pub/eq/Marvin//Libs/libc.so.1", 0x080467E0) Err#2 ENOENT
stat64("./libc.so.1", 0x080467E0) Err#2 ENOENT
munmap(0xFEFB0000, 32768) = 0
open("/proc/self/auxv", O_RDONLY) = 3
fxstat(2, 3, 0x080477D0) = 0
read(3, "D807\0\0EF7F04\bDE07\0\0".., 168) = 168
close(3) = 0
sysinfo(SI_ISALIST, "amd64 pentium_pro+mmx pentium_pro pentium+mmx pentium
i486 i386 i86", 255) = 68
access("amd64/bzip2", X_OK) = 0
execve("amd64/bzip2", 0x080478B4, 0x080478BC) argc = 1
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON,
4294967295, 0) = 0xFFFFFD7FFF3F0000
resolvepath("/usr/lib/amd64/ld.so.1", "/lib/amd64/ld.so.1", 1023) = 18
getcwd("/db/pub/eq/csw/opt/csw/bin", 1011) = 0
resolvepath("/db/pub/eq/csw/opt/csw/bin/amd64/bzip2",
"/db/pub/eq/csw/opt/csw/bin/amd64/bzip2", 1023) = 38
stat("/db/pub/eq/csw/opt/csw/bin/amd64/bzip2", 0xFFFFFD7FFFDFF540) = 0
open("/var/ld/64/ld.config", O_RDONLY) Err#2 ENOENT
stat("/db/pub/eq/csw/opt/csw/bdb48/lib/libbz2.so.1.0", 0xFFFFFD7FFFDFEE60)
Err#2 ENOENT
stat("/db/pub/eq/csw/opt/csw/lib/svn/libbz2.so.1.0", 0xFFFFFD7FFFDFEE60)
Err#2 ENOENT
stat("/db/pub/eq/csw/opt/csw/lib/libbz2.so.1.0", 0xFFFFFD7FFFDFEE60) = 0
resolvepath("/db/pub/eq/csw/opt/csw/lib/libbz2.so.1.0",
"/db/pub/eq/csw/opt/csw/lib/libbz2.so.1.0.6", 1023) = 42
open("/db/pub/eq/csw/opt/csw/lib/libbz2.so.1.0", O_RDONLY) = 3
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) =
0xFFFFFD7FFF3A0000
close(3) = 0
stat("/db/pub/eq/tools/lib/boost/current/lib/libbz2.so.1.0",
0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("/usr/sfw/lib/libbz2.so.1.0", 0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("/db/pub/eq/tools/lib/log4cplus/current/lib/libbz2.so.1.0",
0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("/db/pub/eq/tools/lib/xerces-c/current/lib/libbz2.so.1.0",
0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("/db/pub/eq/tools/lib/omex/current/lib/libbz2.so.1.0",
0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("./libbz2.so.1.0", 0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("/data/oracle/product/client/11.2.0.1/lib/libbz2.so.1.0",
0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("/db/pub/eq/tools/lib/quickfix/current/lib/libbz2.so.1.0",
0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("/db/pub/eq/Marvin//Libs/libbz2.so.1.0", 0xFFFFFD7FFFDFEE60) Err#2
ENOENT
stat("./libbz2.so.1.0", 0xFFFFFD7FFFDFEE60) Err#2 ENOENT
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON,
4294967295, 0) = 0xFFFFFD7FFF390000
stat("/opt/csw/lib/amd64/libbz2.so.1.0", 0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("/lib/64/libbz2.so.1.0", 0xFFFFFD7FFFDFEE60) Err#2 ENOENT
stat("/usr/lib/64/libbz2.so.1.0", 0xFFFFFD7FFFDFEE60) Err#2 ENOENT
ld.so.1: bzip2: fatal: /db/pub/eq/csw/opt/csw/lib/libbz2.so.1.0: wrong ELF
class: ELFCLASS32
write(2, " l d . s o . 1 : b z i".., 93) = 93
munmap(0xFFFFFD7FFF3A0000, 32768) = 0
lwp_self() = 1
On Thu, Jul 28, 2011 at 07:12, Dagobert Michelsen <dam at opencsw.org> wrote:
> Hi,
>
> Am 27.07.2011 um 21:57 schrieb Maciej Bliziński:
> > >> bash$ ./gdb
> > >> ld.so.1: gdb: fatal: /db/pub/eq/csw/opt/csw/lib/libncurses.so.5: wrong
> ELF class: ELFCLASS32
> > >> Killed
> > >
> > >
> > > Uname on the root-access box (on which OpenCSW was installed):
> > >
> > >> SunOS puppet 5.11 snv_151a i86pc i386 i86pc Solaris
> > >
> > >
> > > Uname on the limited-access box (where we are trying to run the
> tranplanted binaries):
> > >
> > >> SunOS eqaegd05 5.10 Generic_144489-06 i86pc i386 i86pc
> > >
> > >
> > > Both bzip2 and libbz2.so appear to be 32-bit (at least from what I can
> tell):
> > >
> > >> bash$ file bzip2
> > >> bzip2: ELF 32-bit LSB executable 80386 Version 1 [FPU],
> dynamically linked, not stripped, no debugging information available
> >
> > Can you look at the inode number of the bzip2 binary and the isaexec
> binary? Is it the same?
> >
> > >> bash$ file ../lib/libbz2.so
> > >> ../lib/libbz2.so: ELF 32-bit LSB dynamic lib 80386 Version 1
> [FPU], dynamically linked, stripped
> > >
> > >
> > > What would be causing this error? And how would I fix it?
> >
> > One guess is that it is the 32 vs 64 bit issue after all. If that's true,
> adding $ISALIST or 64 to the search path could help.
> >
> > LD_LIBRARY_PATH='/db/pub/eq/csw/opt/csw/lib/64'
> >
> > Or
> >
> > LD_LIBRARY_PATH='/db/pub/eq/csw/opt/csw/lib/$ISALIST
>
> I would say isaexec. Try
> LD_LIBRARY_PATH_32=/db/pub/eq/csw/opt/csw/lib
> LD_LIBRARY_PATH_64=/db/pub/eq/csw/opt/csw/lib/64
>
> Please see ld.so.1(1) for details.
>
>
> Best regards
>
> -- Dago
>
> _______________________________________________
> users mailing list
> users at lists.opencsw.org
> https://lists.opencsw.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencsw.org/pipermail/users/attachments/20110728/10863fb5/attachment-0001.html>
More information about the users
mailing list