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]

Re: PID caching problem


On Tuesday 07 July 2009 10:39:04 Michele Alberti wrote:
> > 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.
>
> I only want that getpid() returns the real PID, the new one. Because
> old, cached PID is useless, for example raise() syscall fail.
> I don't require the original PID, but the right one.

you want it to "just work".  but people implementing these things needs it to 
"always work".  relying on code always calling getpid() isnt going to work.  
what if code caches the result themselves in global data ?
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


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