ldd retorna “não um executável dinâmico” para um ELF de 64 bits, embora objdump e readelf discordem

3

(Esta questão é uma continuação indireta do meu pergunta anterior que foi resolvida.)

Pequeno resumo do que estou tentando fazer

Eu tenho um arquivo .so chamado pin_sim.so para o simulador de arquitetura snipersim ( link ). Esta biblioteca basicamente implementa um wrapper em torno da biblioteca de instrumentação PIN da Intel usada pela simulação.

Este arquivo é carregado dinamicamente antes do início da simulação pelo aplicativo principal. Como o executável de destino de simulação deve ser carregado com as mesmas versões de biblioteca que pin_sim.so e pin_sim.so empacota algumas versões das bibliotecas, antes de uma simulação ser iniciada, ele verifica qual versão de bibliotecas é carregada por pin_sim.so usando ldd .

Problema

Na minha área de trabalho em casa (executando o Linux Mint 17.2), isso funciona corretamente. ldd pin_sim.so retorna:

linux-vdso.so.1 =>  (0x00007ffcd75a3000)
libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007fdd19d08000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fdd19b00000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fdd198e6000)
libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007fdd1962d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdd19429000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdd19124000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdd18e1e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdd18c08000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdd18842000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdd1ae55000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fdd18624000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fdd18421000)

No entanto, em um cluster de computação em que tenho acesso para executar o OpenSUSE 13.1, esse comando retorna (não importa se eu copio o arquivo ou o re-compile):

not a dynamic executable

Além disso, não consigo executar o sniper corretamente (a simulação nunca é executada, o que, presumo, tem a ver com pin_sim.so não carregando corretamente).

Se eu compilar o arquivo no cluster e, em seguida, copiar para minha máquina doméstica, o ldd funcionará corretamente como antes. Todos os outros arquivos que eu tentei ldd (mesmo o principal binário sniper) funcionam corretamente, apenas pin_sim.so falha.

Mais informações

file pin_sim.so na minha máquina doméstica (mesmo no cluster, se não for recompilado):

pin_sim.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=4ac6397fefb655c475b5a941cef726183d3e3710, not stripped

file pin_sim.so no cluster (re-compilado):

pin_sim.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped

objdump -p pin_sim.so | grep NEEDED em ambas as máquinas (mesmo se recompilado no cluster):

NEEDED               libpython2.7.so.1.0
NEEDED               librt.so.1
NEEDED               libz.so.1
NEEDED               libsqlite3.so.0
NEEDED               libdl.so.2
NEEDED               libstdc++.so.6
NEEDED               libm.so.6
NEEDED               libgcc_s.so.1
NEEDED               libc.so.6
NEEDED               ld-linux-x86-64.so.2

readelf -d pin_sim.so | grep NEEDED em ambas as máquinas (mesmo se recompilado no cluster):

0x0000000000000001 (NEEDED)             Shared library: [libpython2.7.so.1.0]
0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
0x0000000000000001 (NEEDED)             Shared library: [libsqlite3.so.0]
0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]

ldd --version na minha máquina doméstica:

ldd (Ubuntu EGLIBC 2.19-0ubuntu6.6) 2.19

ldd --version no cluster:

ldd (Gentoo 2.20-r2 p4) 2.20

O que eu tentei / Meus pensamentos

Eu não estou muito familiarizado com o processo de vinculação dinâmica do Linux, então não tentei muito.

Eu procurei na web e só encontrei referências ao ldd sendo confundido com binários muito antigos (compilado antes do suporte do ldd ser adicionado ao formato ELF), ou ao executar o ldd em binários de 32 bits sob um binário de 64 bits sistema sem as bibliotecas do sistema de 32 bits instaladas. Como esse binário foi compilado por mim e é de 64 bits, não tenho idéia do porque o ldd pode estar falhando.

Estou pensando em mudar o verificador de versão do sniper de usar o ldd para o readelf / objdump, mas ainda estou surpreso que o ldd falhe assim.

Alguma ideia? Eu não tenho acesso root no cluster.

Editar 1: Strace

Eu fiz dois rastreios syscall nas máquinas do cluster. Um no binário sniper (onde o ldd é bem-sucedido) e outro no binário pin_sim.so (onde o ldd falha).

Eu cortei o começo, até a parte interessante onde eles começaram a divergir.

EDIT 2: Agora strace -f

strace -f ldd sniper :

faccessat(AT_FDCWD, "./sniper", R_OK)   = 0
faccessat(AT_FDCWD, "./sniper", X_OK)   = 0
faccessat(AT_FDCWD, "/lib/ld-linux.so.2", X_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/lib64/ld-linux-x86-64.so.2", X_OK) = 0
pipe([3, 4])                            = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
lseek(255, -52, SEEK_CUR)               = 5706
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x359287389d0) = 21112
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGCHLD, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, 8) = 0
close(4)                                = 0
read(3, Process 21112 attached
 <unfinished ...>
[pid 21112] close(255)                  = 0
[pid 21112] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 21112] rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21112] rt_sigaction(SIGTTIN, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21112] rt_sigaction(SIGTTOU, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21112] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_IGN, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGCHLD, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGINT, {0x6f679ce1a0, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] dup2(4, 1)                  = 1
[pid 21112] close(4)                    = 0
[pid 21112] close(3)                    = 0
[pid 21112] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 21112] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {0x6f679ce1a0, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, 8) = 0
[pid 21112] execve("/lib64/ld-linux-x86-64.so.2", ["/lib64/ld-linux-x86-64.so.2", "--verify", "./sniper"], [/* 51 vars */]) = 0
[pid 21112] brk(0)                      = 0x2d9db43c910
[pid 21112] open("./sniper", O_RDONLY|O_CLOEXEC) = 3
[pid 21112] read(3, "7ELF
faccessat(AT_FDCWD, "./pin_sim.so", R_OK) = 0
faccessat(AT_FDCWD, "./pin_sim.so", X_OK) = 0
faccessat(AT_FDCWD, "/lib/ld-linux.so.2", X_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/lib64/ld-linux-x86-64.so.2", X_OK) = 0
pipe([3, 4])                            = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
lseek(255, -52, SEEK_CUR)               = 5706
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x36aaed959d0) = 21099
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGCHLD, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, 8) = 0
close(4)                                = 0
read(3, Process 21099 attached
 <unfinished ...>
[pid 21099] close(255)                  = 0
[pid 21099] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 21099] rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21099] rt_sigaction(SIGTTIN, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21099] rt_sigaction(SIGTTOU, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21099] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_IGN, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGCHLD, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGINT, {0x798dd551a0, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] dup2(4, 1)                  = 1
[pid 21099] close(4)                    = 0
[pid 21099] close(3)                    = 0
[pid 21099] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 21099] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {0x798dd551a0, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, 8) = 0
[pid 21099] execve("/lib64/ld-linux-x86-64.so.2", ["/lib64/ld-linux-x86-64.so.2", "--verify", "./pin_sim.so"], [/* 51 vars */]) = 0
[pid 21099] brk(0)                      = 0x2b0b251b090
[pid 21099] open("./pin_sim.so", O_RDONLY|O_CLOEXEC) = 3
[pid 21099] read(3, "7ELF
Elf file type is DYN (Shared object file)
Entry point 0x1440a0
There are 7 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x913415 0x913415 R E 0x200000
  LOAD           0x913990 0x0000000000b13990 0x0000000000b13990 0x0ae648 0x0d1d18 RW  0x200000
  DYNAMIC        0x9bf0f8 0x0000000000bbf0f8 0x0000000000bbf0f8 0x0002a0 0x0002a0 RW  0x8
  GNU_EH_FRAME   0x7fbee0 0x00000000007fbee0 0x00000000007fbee0 0x036cfc 0x036cfc R   0x4
  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10
  GNU_RELRO      0x913990 0x0000000000b13990 0x0000000000b13990 0x0ac670 0x0ac670 R   0x1
  PAX_FLAGS      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000     0x8

 Section to Segment mapping:
  Segment Sections...
   00     .hash .dynsym .dynstr .gnu.version .gnu.version_d .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata .charmversion .eh_frame_hdr .eh_frame .gcc_except_table 
   01     .init_array .fini_array .jcr .data.rel.ro .dynamic .got .data .pinclientint .bss 
   02     .dynamic 
   03     .eh_frame_hdr 
   04     
   05     .init_array .fini_array .jcr .data.rel.ro .dynamic .got 
   06
linux-vdso.so.1 =>  (0x00007ffcd75a3000)
libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007fdd19d08000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fdd19b00000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fdd198e6000)
libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007fdd1962d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdd19429000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdd19124000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdd18e1e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdd18c08000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdd18842000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdd1ae55000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fdd18624000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fdd18421000)
not a dynamic executable
pin_sim.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=4ac6397fefb655c475b5a941cef726183d3e3710, not stripped
pin_sim.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
NEEDED               libpython2.7.so.1.0
NEEDED               librt.so.1
NEEDED               libz.so.1
NEEDED               libsqlite3.so.0
NEEDED               libdl.so.2
NEEDED               libstdc++.so.6
NEEDED               libm.so.6
NEEDED               libgcc_s.so.1
NEEDED               libc.so.6
NEEDED               ld-linux-x86-64.so.2
0x0000000000000001 (NEEDED)             Shared library: [libpython2.7.so.1.0]
0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
0x0000000000000001 (NEEDED)             Shared library: [libsqlite3.so.0]
0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
ldd (Ubuntu EGLIBC 2.19-0ubuntu6.6) 2.19
ldd (Gentoo 2.20-r2 p4) 2.20
>
faccessat(AT_FDCWD, "./sniper", R_OK)   = 0
faccessat(AT_FDCWD, "./sniper", X_OK)   = 0
faccessat(AT_FDCWD, "/lib/ld-linux.so.2", X_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/lib64/ld-linux-x86-64.so.2", X_OK) = 0
pipe([3, 4])                            = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
lseek(255, -52, SEEK_CUR)               = 5706
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x359287389d0) = 21112
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGCHLD, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, 8) = 0
close(4)                                = 0
read(3, Process 21112 attached
 <unfinished ...>
[pid 21112] close(255)                  = 0
[pid 21112] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 21112] rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21112] rt_sigaction(SIGTTIN, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21112] rt_sigaction(SIGTTOU, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21112] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_IGN, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGCHLD, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGINT, {0x6f679ce1a0, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] dup2(4, 1)                  = 1
[pid 21112] close(4)                    = 0
[pid 21112] close(3)                    = 0
[pid 21112] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 21112] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {0x6f679ce1a0, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, {SIG_DFL, [], SA_RESTORER, 0x35927cffc20}, 8) = 0
[pid 21112] rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, {0x6f679b3710, [], SA_RESTORER|SA_RESTART, 0x35927cffc20}, 8) = 0
[pid 21112] execve("/lib64/ld-linux-x86-64.so.2", ["/lib64/ld-linux-x86-64.so.2", "--verify", "./sniper"], [/* 51 vars */]) = 0
[pid 21112] brk(0)                      = 0x2d9db43c910
[pid 21112] open("./sniper", O_RDONLY|O_CLOEXEC) = 3
[pid 21112] read(3, "7ELF
faccessat(AT_FDCWD, "./pin_sim.so", R_OK) = 0
faccessat(AT_FDCWD, "./pin_sim.so", X_OK) = 0
faccessat(AT_FDCWD, "/lib/ld-linux.so.2", X_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/lib64/ld-linux-x86-64.so.2", X_OK) = 0
pipe([3, 4])                            = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
lseek(255, -52, SEEK_CUR)               = 5706
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x36aaed959d0) = 21099
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGCHLD, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, 8) = 0
close(4)                                = 0
read(3, Process 21099 attached
 <unfinished ...>
[pid 21099] close(255)                  = 0
[pid 21099] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 21099] rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21099] rt_sigaction(SIGTTIN, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21099] rt_sigaction(SIGTTOU, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], 0}, 8) = 0
[pid 21099] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_IGN, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGCHLD, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGINT, {0x798dd551a0, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] dup2(4, 1)                  = 1
[pid 21099] close(4)                    = 0
[pid 21099] close(3)                    = 0
[pid 21099] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 21099] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {0x798dd551a0, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0
[pid 21099] rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, {0x798dd3a710, [], SA_RESTORER|SA_RESTART, 0x36aae35cc20}, 8) = 0
[pid 21099] execve("/lib64/ld-linux-x86-64.so.2", ["/lib64/ld-linux-x86-64.so.2", "--verify", "./pin_sim.so"], [/* 51 vars */]) = 0
[pid 21099] brk(0)                      = 0x2b0b251b090
[pid 21099] open("./pin_sim.so", O_RDONLY|O_CLOEXEC) = 3
[pid 21099] read(3, "7ELF
Elf file type is DYN (Shared object file)
Entry point 0x1440a0
There are 7 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x913415 0x913415 R E 0x200000
  LOAD           0x913990 0x0000000000b13990 0x0000000000b13990 0x0ae648 0x0d1d18 RW  0x200000
  DYNAMIC        0x9bf0f8 0x0000000000bbf0f8 0x0000000000bbf0f8 0x0002a0 0x0002a0 RW  0x8
  GNU_EH_FRAME   0x7fbee0 0x00000000007fbee0 0x00000000007fbee0 0x036cfc 0x036cfc R   0x4
  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10
  GNU_RELRO      0x913990 0x0000000000b13990 0x0000000000b13990 0x0ac670 0x0ac670 R   0x1
  PAX_FLAGS      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000     0x8

 Section to Segment mapping:
  Segment Sections...
   00     .hash .dynsym .dynstr .gnu.version .gnu.version_d .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata .charmversion .eh_frame_hdr .eh_frame .gcc_except_table 
   01     .init_array .fini_array .jcr .data.rel.ro .dynamic .got .data .pinclientint .bss 
   02     .dynamic 
   03     .eh_frame_hdr 
   04     
   05     .init_array .fini_array .jcr .data.rel.ro .dynamic .got 
   06
%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%>%pre%%pre%%pre%%pre%0@%pre%%pre%%pre%%pre%%pre%"..., 832) = 832 [pid 21099] fstat(3, {st_mode=S_IFREG|0775, st_size=55707995, ...}) = 0 [pid 21099] getcwd("/path/to/sniper/lib", 128) = 52 [pid 21099] mmap(NULL, 12474024, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b0af187000 [pid 21099] mprotect(0x2b0afa9b000, 2093056, PROT_NONE) = 0 [pid 21099] mmap(0x2b0afc9a000, 716800, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x913000) = 0x2b0afc9a000 [pid 21099] mmap(0x2b0afd49000, 145064, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b0afd49000 [pid 21099] mprotect(0x3a0fbff6000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) = -1 EACCES (Permission denied) [pid 21099] close(3) = 0 [pid 21099] exit_group(1) = ? [pid 21099] +++ exited with 1 +++ <... read resumed> "", 128) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=21099, si_uid=169971, si_status=1, si_utime=0, si_stime=1} --- wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG, NULL) = 21099 wait4(-1, 0x3de445c7ac0, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 0 close(3) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x798dd36e90, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0 rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {0x798dd36e90, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 faccessat(AT_FDCWD, "/libx32/ld-linux-x32.so.2", X_OK) = -1 ENOENT (No such file or directory) fstat(1, {st_mode=S_IFCHR|0622, st_rdev=makedev(136, 0), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x36aaed99000 write(1, "\tnot a dynamic executable\n", 26 not a dynamic executable ) = 26 read(255, "\nexit $result\n# Local Variables:"..., 5758) = 52 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 exit_group(1) = ? +++ exited with 1 +++
%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%>%pre%%pre%%pre%%pre%17@%pre%%pre%%pre%%pre%%pre%"..., 832) = 832 [pid 21112] fstat(3, {st_mode=S_IFREG|0775, st_size=46853390, ...}) = 0 [pid 21112] getcwd("/path/to/sniper/lib", 128) = 52 [pid 21112] mmap(0x400000, 3837952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x400000 [pid 21112] mmap(0x9a8000, 626688, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3a8000) = 0x9a8000 [pid 21112] mmap(0xa41000, 32872, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xa41000 [pid 21112] close(3) = 0 [pid 21112] exit_group(0) = ? [pid 21111] <... read resumed> "", 128) = 0 [pid 21112] +++ exited with 0 +++ --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=21112, si_uid=169971, si_status=0, si_utime=0, si_stime=0} --- wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 21112 wait4(-1, 0x3e3bd435d80, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 0 close(3) = 0 *** TRACE CONTINUES, no longer important because the other one has already errored out by this point ***
%pre%%pre%%pre%0@%pre%%pre%%pre%%pre%%pre%"..., 832) = 832 [pid 21099] fstat(3, {st_mode=S_IFREG|0775, st_size=55707995, ...}) = 0 [pid 21099] getcwd("/path/to/sniper/lib", 128) = 52 [pid 21099] mmap(NULL, 12474024, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b0af187000 [pid 21099] mprotect(0x2b0afa9b000, 2093056, PROT_NONE) = 0 [pid 21099] mmap(0x2b0afc9a000, 716800, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x913000) = 0x2b0afc9a000 [pid 21099] mmap(0x2b0afd49000, 145064, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b0afd49000 [pid 21099] mprotect(0x3a0fbff6000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) = -1 EACCES (Permission denied) [pid 21099] close(3) = 0 [pid 21099] exit_group(1) = ? [pid 21099] +++ exited with 1 +++ <... read resumed> "", 128) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=21099, si_uid=169971, si_status=1, si_utime=0, si_stime=1} --- wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG, NULL) = 21099 wait4(-1, 0x3de445c7ac0, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 0 close(3) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x798dd36e90, [], SA_RESTORER, 0x36aae35cc20}, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0 rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x36aae35cc20}, {0x798dd36e90, [], SA_RESTORER, 0x36aae35cc20}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 faccessat(AT_FDCWD, "/libx32/ld-linux-x32.so.2", X_OK) = -1 ENOENT (No such file or directory) fstat(1, {st_mode=S_IFCHR|0622, st_rdev=makedev(136, 0), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x36aaed99000 write(1, "\tnot a dynamic executable\n", 26 not a dynamic executable ) = 26 read(255, "\nexit $result\n# Local Variables:"..., 5758) = 52 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 exit_group(1) = ? +++ exited with 1 +++
%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%>%pre%%pre%%pre%%pre%17@%pre%%pre%%pre%%pre%%pre%"..., 832) = 832 [pid 21112] fstat(3, {st_mode=S_IFREG|0775, st_size=46853390, ...}) = 0 [pid 21112] getcwd("/path/to/sniper/lib", 128) = 52 [pid 21112] mmap(0x400000, 3837952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x400000 [pid 21112] mmap(0x9a8000, 626688, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3a8000) = 0x9a8000 [pid 21112] mmap(0xa41000, 32872, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xa41000 [pid 21112] close(3) = 0 [pid 21112] exit_group(0) = ? [pid 21111] <... read resumed> "", 128) = 0 [pid 21112] +++ exited with 0 +++ --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=21112, si_uid=169971, si_status=0, si_utime=0, si_stime=0} --- wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 21112 wait4(-1, 0x3e3bd435d80, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 0 close(3) = 0 *** TRACE CONTINUES, no longer important because the other one has already errored out by this point ***

strace ldd -f pin_sim.so :

%pre%

Editar 3

readelf -Wl pin_sim.so :

%pre%     
por rpinheiro 13.11.2015 / 19:34

1 resposta

2

Na segunda parte strace que informa sobre binários x32 é estranho, mas improvável:

faccessat(AT_FDCWD, "/libx32/ld-linux-x32.so.2", X_OK) = -1 ENOENT (No such file or directory)

Talvez o /lib64/ld-linux-x86-64.so.2 do cluster não goste do seu pin_sim.so de alguma forma.

Para solucionar ainda mais o problema, tente executar /lib64/ld-linux-x86-64.so.2 --list /path/to/your/pin_sim.so em seu cluster.

Na próxima vez, não se esqueça de adicionar -f aos seus argumentos strace, ele ativará o rastreamento completo da árvore de processos.

    
por 14.11.2015 / 11:31