This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PID caching problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]