PID caching problem

michele alberti mic.alberti@gmail.com
Tue Jul 7 13:24:00 GMT 2009


Hi all,
I'm working on a project whose goal is to capture the state of a
running process in GNU/Linux and save it to a file. This file can then
be used to resume the process later on, even after a reboot. The url
to the prject page: http://sharesource.org/project/cryopid/
The save file stores all needed information: registers, file
descriptors, signal handler, TLS (Thread Local Storage), VMA etc.
Here comes a problem with PID caching. If the process to capture calls
a getpid (the glibc wrapper),the PID is cached.
The "frozen" process stores everything, even the cached PID value.
When the frozen process tries to resume, it uses the previous (old,
cached) PID, which is incorrect. The call to getpid() still returns
the original PID even though the restored process has gotten a new
one.
Can anyone tell me where TLS is stored? Is TLS the problem?
How can I refresh the PID cache? Better yet, how can I avoid caching
the PID in the first place?

Thanks,
Michele



More information about the Libc-help mailing list