[Issue 10216] New: Bad warning in std.process.kill

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 30 16:35:08 PDT 2013


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

           Summary: Bad warning in std.process.kill
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: yarrluben+dbugs at googlemail.com


--- Comment #0 from Pierre LeMoine <yarrluben+dbugs at googlemail.com> 2013-05-30 16:35:06 PDT ---
The description for std.process.kill includes a windows-specific warning about
process termination.
The warning includes a link to
http://blogs.msdn.com/b/oldnewthing/archive/2007/05/03/2383346.aspx , where the
function ExitProcess is explained to kill all but the calling thread before
issuing detach-messages to the loaded dll's. Because the other threads have
been murdered, the state of the process can cause the last thread to hang. The
warning states that 'The mechanisms for process termination are [incredibly
badly specified] in the Windows API', but any google search for ExitProcess
brings you to a pretty detailed explanation of the process (
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682658%28v=vs.85%29.aspx
), which even warns about the case in the blog post.

Anyway, std.process.kill is implemented with TerminateProcess which forcibly
kills _all_ the threads in a target process and no detach-messages are issued
to the loaded dll's. (This is mentioned in
http://msdn.microsoft.com/en-us/library/windows/desktop/ms686722%28v=vs.85%29.aspx
)

Thus the warning is about something irrelevant(ExitProcess) and ought not be
there.

-- 
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