|
From: Nicholas N. <nj...@ca...> - 2004-09-06 11:59:56
|
On Mon, 6 Sep 2004, Leandro Lucarella wrote: > Hi! I wonder if it's possible to run the program to check with valgrind in > a chrooted jail. Here's my problem, I'm writing a program to automatically > check for memory leaks of little programs in an untrusted environment. So > I want to run this programs in a chrooted empty directory (well, not > totally empty, the directory has an static linked copy of the program to > test, static so I don't have to make a 'complete' jail with shared > libraries and so). > > The problem is, if I want to check the program with valgrind I have to put > valgrind in the jail (so I have to make the 'complete' jail with shared > libraries), that's what I want to make a patch (if it's possible) to add > valgrind an option to run programs in a chrooted directory (changing the > uid after the chroot), but I don't know if it's possible to do that. I > don't ever know if it's possible to run valgrind on a statically linked > binary (the test I made don't behave very well). Valgrind can run statically linked binaries. However some of the tools (esp. Memcheck) do not work as well as normal in this case -- in particular, they cannot replace malloc() and friends with their own versions, which means that certain errors are not detected. Unfortunately, memory leaks are among these. So I don't think this is going to be possible, unfortunately. N |