perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Garcia-Suarez <raphel.garcia-sua...@hexaflux.com>
Subject Re: [5.8.1] getppid is not maintained if not forked by perl
Date Fri, 17 Oct 2003 07:12:06 GMT
Stas Bekman wrote:
> if any of your programs rely on geppid, they will now be either broken or 
> don't do what you want. I've discovered it while porting Apache::VMonitor, 
> which shows you all the httpd procs and their system's usage, calculating the 
> memory usage and shared memory usage. getppid gives me 1, which completely 
> blows out my algorithm for calculating shared memory usage since it needs to 
> know the memory used by the parent httpd process.

Why 1 ? because it's the ppid of the httpd parent process ?

> Besides it's a bug, no matter how you look at it, because a C call to 
> getppid() from the same process will do the right thing.

That's in fact the whole point of the change : have perl's getppid()
always return the parent process id, and not the parent thread id like
Linux's getppid(2) when threads have been spawned.

Is this going to cause different classes of problems in prefork
and threaded mpms ?

> It had to be fixed locally in mp2 since 5.8.1 has been released already, 
> meaning that anybody who uses 5.8.1 is vulnerable to this problem. Hopefully 
> 5.8.2 will get it fixed in perl.

Hope so.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message