https://bugs.documentfoundation.org/show_bug.cgi?id=106489
Bug ID: 106489
Summary: Win32 version of osl_terminateProcess not "safe"
Product: LibreOffice
Version: Inherited From OOo
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: framework
Assignee: [email protected]
Reporter: [email protected]
The current Win32 implementation of osl_terminateProcess calls directly upon
the Win32 TerminateProcess() API function. When I looked up this function on
MSDN I was a bit surprised to note that this is an asynchronous function that
returns immediately before the process actually fully terminates, and does not
necessarily succeed cleanly.
As we are not checking that the process actually fully terminates, this is a
bit of a problem, albeit one I think may well be somewhat obscure and
non-obvious. In fact, it is better that we call on TerminateProcess and use
WaitForSingleObject until the process actually fully terminates. If the
termination ends abnormally, then we should pass I more appropriate exit
status.
Dr Dobbs magazine, bless its ancient archive, details a "safe" version of
TerminateProcess, which has been implemented it seems in dozens of projects
already so it's basically at this point a pattern. The article can be found
here:
http://www.drdobbs.com/a-safer-alternative-to-terminateprocess/184416547
Thankfully, the flaws they point out are only valid due to the age of the
article as the Windows 9x line of operating systems was still a thing way hack
then :-)
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs