对应用程序运行跟踪可能会提供一些线索(见清单 6)。
清单 6. 运行跟踪
$ truss ./errnoacc
execve("errnoacc", 0x08047B20, 0x08047B28) argc = 1
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0)
= 0xFEFB0000
resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
getcwd("/export/home/mc", 1014) = 0
resolvepath("/export/home/mc/errnoacc", "/export/home/mc/errnoacc", 1023) = 24
xstat(2, "/export/home/mc/errnoacc", 0x080477E4) = 0
open("/var/ld/ld.config", O_RDONLY) = 3
fxstat(2, 3, 0x080476C4) = 0
mmap(0x00000000, 144, PROT_READ, MAP_SHARED, 3, 0) = 0xFEFA0000
close(3) = 0
sysconfig(_CONFIG_PAGESIZE) = 4096
xstat(2, "/usr/lib/libc.so.1", 0x08046F04) = 0
resolvepath("/usr/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
open("/usr/lib/libc.so.1", O_RDONLY) = 3
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFEF90000
mmap(0x00010000, 1413120, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN,
-1, 0) = 0xFEE30000
mmap(0xFEE30000, 1302809, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0)
= 0xFEE30000
mmap(0xFEF7F000, 30862, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|
MAP_INITDATA, 3, 1306624) = 0xFEF7F000
mmap(0xFEF87000, 4776, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON,
-1, 0) = 0xFEF87000
munmap(0xFEF6F000, 65536) = 0
memcntl(0xFEE30000, 187632, 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) = 0xFEE20000
munmap(0xFEF90000, 32768) = 0
getcontext(0x08047534)
getrlimit(RLIMIT_STACK, 0x0804752C) = 0
getpid() = 15727 [15726]
lwp_private(0, 1, 0xFEE22A00) = 0x000001C3
setustack(0xFEE22A60)
sysi86(SI86FPSTART, 0xFEF879BC, 0x0000133F, 0x00001F80) = 0x00000001
open("/etc/shadow", O_RDONLY) Err#13 EACCES [file_dac_read]
ioctl(1, TCGETA, 0x08046BB0) = 0
fstat64(1, 0x08046B10) = 0
ERROR: Application failed to initialize
write(1, " E R R O R : A p p l i".., 40) = 40
_exit(0)
标签: