Bug 10216 – Bad warning in std.process.kill

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2013-05-30T16:35:00Z
Last change time
2013-07-28T15:11:20Z
Assigned to
bugzilla
Creator
yarrluben+dbugs

Comments

Comment #0 by yarrluben+dbugs — 2013-05-30T16:35:06Z
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.
Comment #1 by bugzilla — 2013-07-28T08:25:09Z
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.
Comment #2 by github-bugzilla — 2013-07-28T14:46:02Z
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 Merge pull request #1438 from kyllingstad/kill-warning Fix Issue 10216 - Bad warning in std.process.kill