• [ace-users] Process spawn on Linux

    From santu.lara@gmail.com@21:1/5 to Juan Jose Comellas on Mon Nov 9 02:22:02 2015
    On Friday, 11 April 2003 02:22:19 UTC+5:30, Juan Jose Comellas wrote:
    Under Windows you might have another kind of problem and end up with a leaked
    process handle if you create a process with CreateProcess() and don't call CloseHandle() on the hThread and hProcess members of the returned PROCESS_INFORMATION struct.

    On Thursday 10 April 2003 13:39, Randy Beckwith wrote:
    Thanks, Caleb! I changed the code to not set the
    process name and also set the options flag to inherit
    the environment and everything worked fine.

    I hate that when things don't work the same between
    Linux and Windows.... :-( The orginal code worked
    beautifully on Windows.

    So I need to get the child process exit status to
    avoid zombies.... Hmmm... more code just for Linux.
    Sounds like i'm going to have to start up an extra
    thread on Linux to just sit there and poll for exit
    statuses. Not sure I like that but ....

    Thanks again, Caleb.


    --- Caleb Epstein <cae@bklyn.org> wrote:
    On Thu, Apr 10, 2003 at 06:36:42AM -0700, Randy

    Beckwith wrote:
    My program is attempting to spawn 5 different
    processes using
    the Process_Manager interface. This works

    perfectly > well on

    Windows 2000 but on Linux (RedHat 8.0) I get 5

    (zombied?) >

    copies of the spawning program itself.

    Zombie processes are an indication of spawning
    without "reaping" their exit status. You need to
    ACE_Process_Manager::reap or ::wait to collect the
    exit codes
    of your children.

    Note that if you are going to specify the
    process_name, it
    needs to be a real executable name that can be
    exec()'ed, not
    a symbolic string. Basically, it should match
    argv[0] in your

    You might want too look at the
    Process_Manager_Test.cpp test

    Caleb Epstein | bklyn . org | You can fool some of
    the people all of the
    cae at | Brooklyn Dust | time, and all of the
    people some of the time,
    bklyn dot org | Bunny Mfg. | but you can make a
    fool of yourself anytime.

    Do you Yahoo!?
    Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com


    Even i am facing the similar problem now.
    debuggerProcess = new ACE_Process();
    ACE_Process_Options options;
    // options.avoid_zombies(1);
    pid_t pid = debuggerProcess->spawn(options);

    Above code is working fine in windows, if i give the invalid input(cmdline) to spawn the process. function returns "-1" whereas in Linux, it always returns some positive number(>1). which means process has created. i checked it it is a zombie. if is
    specify avoid_zombies, return value is always 1. i want to know when this call actually fails, please help me.

    Juan Jose Comellas

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)