bug in libgendep? syscall fork

Protasio Ramirez, Joan joan.protasio-ramirez at hp.com
Fri Feb 13 18:26:20 CET 2009


Dear Michael,

Thanks so much for your answer. I wish we could solve the problem together. You are right Michael. Libgendep also searches for child processes but I still don't find some important calls to open for me (as calls to open for "project", I've marked below).


Fragment (writeSingleFile.c is a simple file with a fopen In write mode) :  strace -f gcc writeSingleFile.c -o project


execve("/usr/bin/gcc", ["gcc", "writeSingleFile.c", "-o", "project"], [/* 54 vars */]) = 0
uname({sys="Linux", node="npdl436.bpo.hp.com", ...}) = 0
brk(0)                                  = 0x8b2e000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("tls/i686/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/i686/libc.so.6", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("tls/sse2/libc.so.6", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("tls/libc.so.6", O_RDONLY)         = -1 ENOENT (No such file or directory)
open("i686/sse2/libc.so.6", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("i686/libc.so.6", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("sse2/libc.so.6", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("libc.so.6", O_RDONLY)             = -1 ENOENT (No such file or directory)
open("/usr/local/lib/tls/i686/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/tls/i686/sse2", 0xbfe3a43c) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/tls/i686/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/tls/i686", 0xbfe3a43c) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/tls/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No
.
.
.
close(3)                                = 0
open("/tmp/ccNZSFqK.s", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
close(3)                                = 0
stat64("/usr/libexec/gcc/i386-redhat-linux/3.4.5/cc1", {st_mode=S_IFREG|0755, st_size=3435232, ...}) = 0
access("/usr/libexec/gcc/i386-redhat-linux/3.4.5/cc1", X_OK) = 0
fork(Process 14951 attached
)                                  = 14951
[pid 14950] waitpid(14951, Process 14950 suspended
 <unfinished ...>
[pid 14951] execve("/usr/libexec/gcc/i386-redhat-linux/3.4.5/cc1", ["/usr/libexec/gcc/i386-redhat-lin"..., "-quiet", "writeSingleFile.c", "-quiet", "-dumpbase", "writeSingleFile.c", "-auxbase", "writeSingleFile", "-o", "/tmp/ccNZSFqK.s"], [/* 56 vars */]) = 0
[pid 14951] uname({sys="Linux", node="npdl436.bpo.hp.com", ...}) = 0
[pid 14951] brk(0)                      = 0x84fc000
[pid 14951] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such
.
.
.
[pid 14965] open("/tmp/ccNZSCCqK.s", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
[pid 14965] unlink("project")           = 0                     <-------NOT FOUND !!!!
[pid 14965] open("project", O_RDWR|O_CREAT|O_TRUNC, 0666) = 6   <-------NOT FOUND !!!!
[pid 14965] open("/usr/lib/gcc/i386-redhat-linux/3.4.5/../../../crt1.o", O_RDONLY) = 7
[pid 14965] fstat64(7, {st_mode=S_IFREG|0644, st_size=1172, ...}) = 0
[pid 14965] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4024e000
[pid 14965] _llseek(7, 0, [0], SEEK_SET) = 0
[pid 14965] read(7, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\1\0\3\0\1\0\0\0\0\0\0\0"..., 4096) = 1172
[pid 14965] _llseek(7, 1172, [1172], SEEK_SET) = 0
.
.
.
[pid 14965] brk(0x97b1000)              = 0x97b1000
[pid 14965] close(14)                   = 0
[pid 14965] munmap(0x40255000, 4096)    = 0
[pid 14965] open("project", O_RDWR)     = 14                     <-------NOT FOUND !!!!



I don't understand why. I have put one printf inside the function ___open like :

If (rv > 0 ).
.
.
Printf("the current file is %s",fn);
.
.
.


But it doesn't appears!. I also have added to the wrapper one alias to unlink (it also makes mentions to project) but it also don't detect them. It is strange because files in the same child process are detected as [pid 14965] open("/tmp/ccNZSCCqK.s", O_RDWR|O_CREAT|O_EXCL, 0600) = 3 ...

Thankss!!!











More information about the l4-hackers mailing list