www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10216] New: Bad warning in std.process.kill

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: yarrluben+dbugs googlemail.com



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: -------
May 30 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10216


Lars T. Kyllingstad <bugzilla kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |bugzilla kyllingen.net
         AssignedTo|nobody puremagic.com        |bugzilla kyllingen.net



08:25:09 PDT ---
The "badly specified" part refers to the fact that process termination is done
differently in different versions of Windows, and these differences are not
specified in Microsoft's documentation.

But you're right, we probably don't need that warning.  Consider it gone.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10216




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/690bb868edb82ac30d9a2b5590033230d2fe1388
Fix Issue 10216 - Bad warning in std.process.kill

https://github.com/D-Programming-Language/phobos/commit/46419713a1a219fc03b6d40cb5cf23a4cf404aa8


Fix Issue 10216 - Bad warning in std.process.kill

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10216


Lars T. Kyllingstad <bugzilla kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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