hi,

On Thu, Dec 6, 2012 at 3:51 PM, Ángel González <keis...@gmail.com> wrote:
> On 06/12/12 13:52, Pierre Joye wrote:
>> hi,
>>
>> On Thu, Dec 6, 2012 at 12:40 PM, Ángel González <keis...@gmail.com> wrote:
>>> On 06/12/12 09:49, Pierre Joye wrote:
>>>> hi!
>>>>
>>>> While looking at the bug #63073, I was wondering if we could simply do
>>>> not pass open handles to the newly created child process.
>>> Looking at proc_open, where there is an explicit CreateProcess (we seem
>>> to be using the library popen for the exec()...)
>> We use CreateProcess too for our windows popen implementation, see:
>>
>> http://lxr.php.net/xref/PHP_5_4/TSRM/tsrm_win32.c#450
> Oh, right. The filename confused me into thinking it was only used in ZTS.
> Yes, the popen called will be that one.
>
>
>>> If $pipes is empty and $descriptorspec doesn't require more than 0,1,2
>>> then it should be safe not to set bInheritHandles.
>>>
>>> However, in other cases inheriting handles *will* be needed.
>> hm, Why?
> How else would you pass the child process the other side of a pipe ?
>
> (It's possible that the handles passed in STARTUPINFO hStdInput,
> hStdOutput and hStdError still get automatically inherited, msdn
> doesn't document that point, but it would still be relevant for higher
> descriptors)

Ah right, I was thinking about other handles.

It seems that I may have found one possible cause, which may also
cause the hang because we do not see the EOF. We should close the
inherited handle after CreateProcess. And we should not always set
inherit to true (as you stated earlier) when all 0-1 are given.

I have to test all that in the coming days :)

--
Pierre

@pierrejoye

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to