[Issue 6846] New: std.concurrency and fork/execv

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 23 14:23:34 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6846

           Summary: std.concurrency and fork/execv
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: jonathansternberg at gmail.com


--- Comment #0 from Jonathan Sternberg <jonathansternberg at gmail.com> 2011-10-23 14:22:30 PDT ---
Created an attachment (id=1042)
example code from description

Attached is a sample program that I believe should work, but doesn't. The
program is a simple command runner.

It runs a maximum of 4 processes at once and each process is just "echo
<number>". The command runner uses "spawn" to create a new thread. This thread
then immediately forks and calls execv in the child. The parent then waits on
the newly created process. When it finishes, it sends it's tid and the exit
status of the command.

When run, sometimes a thread will seem to stall on the execv call. It seems
that the fork happened successfully, but a quick check with "ps" will reveal
that two processes named "test" exist (the forked one should have been
replaced).

The program then has no way to continue by itself. The only way to make it
continue is to call "kill" on the newly created processes.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list