[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-cxx-dev
Subject:    Re: CXX-DEV: Problems in releasing memory allocated in a
From:       Eric Gouriou <eric.gouriou () hp ! com>
Date:       2004-08-12 15:22:42
Message-ID: 411B8B42.4000303 () hp ! com
[Download RAW message or body]

Parikshit N. Samant wrote:
> Thanks a lot for the insight provided. I think we will take the 'dummy 
> fork' way. We cannot possibly use vfork since our child process do not 
> only call exec, and the manpage says:
> 
>       The use of vfork() for any purpose except as a prelude to an immediate
> 
>       exec() or exit() is not supported.  

  Another note on vfork: this man page was subsequently updated to
say "...[only] exec(2) or _exit(2) [are 'legal' calls after a vfork]".

  Calling exit() is not supported, as it invokes a lot of code
that modifies the contents of the address space shared between the parent
and the child. In particular it causes the loader to unload libraries,
which is rarely what the parent desires.

  Trivia: at some point our /usr/bin/sh was a bit nasty and called exit()
if a vfork+exec failed (e.g. if a provided command path did not lead to
a valid executable file). While it wasn't causing trouble for sh,
it led caliper to be a little confused. I haven't checked if the JAG
on sh has been closed, but caliper emits a diagnostic message if it can
detect that problem.

  Eric

-- 
Eric Gouriou                                         eric.gouriou@hp.com
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE cxx-dev
 _________________________________________________________________
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic