[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RFH - fakeroot-ng and ptrace, not Debian specific

Hi all,

I'm sending this request for help in the hope that it randomly hit one of the smart people on this list, but it is, as far as I can tell, not Debian specific.

Fakeroot-ng is a clean re-implementation of the fakeroot principle, based on ptrace rather than LD_PRELOAD. As a result it can go where fakeroot cannot (no problem with statically compiled binaries, can do almost full chroot with full chroot planned) on the one hand, but has some drawbacks as well (no hope of being as quick as fakeroot, has some highly platform specific code, fairly complex). You can read more about it at http://fakeroot-ng.lingnu.com

The version currently in trunk has an attempt to remove some Linux specific hacks when attaching to a newly created process. It does so by changing a "fork" into "clone", and adding the "CLONE_PTRACE" whether the original specified it or not. This is the exact same thing strace does.

Unlike strace, however, fakeroot-ng is failing to attach itself to newly created threads. I'd say I was passing the wrong flags to the kernel, but if I watch all system calls performed by the debugger (yes, using strace), I seem to see that strace and fakeroot-ng do exactly the same thing. The only difference is that for strace it works.

I need someone who is either a ptrace expert, or who has a fresh set of eyes and some patience, to help me look at it and figure out what I'm doing wrong.


Shachar Shemesh
Lingnu Open Source Consulting Ltd.

Reply to: