You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on react/child-process, I noticed occasional, but reproducible SEGFAULTs for really old PHP versions (< 5.4). I've managed to work around this in reactphp/child-process#29, but this actually boils down to an issue in this component when instantiating a new Stream with a pipe stream. Here's the gist of the broken code:
It looks like the first example might in fact exhibit a race condition, while the second one can be used to reproduce this always when this is an interactive terminal. Also, if you explicitly close the input pipe via php second <&-, it crashed reproducible. Once you start piping stuff into the STDIN such as echo test | php second.php things start to work again, while interactive streams such as cat | php second.php keep crashing.
I've checked for a common denominator between the affected streams with fstat() and stream_get_meta_data(), but couldn't find a reliable source. I have only observed crashs on pipe streams, but while some pipe streams crash, others work just fine.
As such, we MAY want to look into simply enabling the read buffer again for ALL pipes, as I've not observed any side-effects of this. The read buffer was originally disabled via #20, but I've not managed to reproduce the original issue with pipe streams anyway.
Keep in mind that this only affects legacy PHP < 5.4, so it's not exactly the most pressing issue.
While working on react/child-process, I noticed occasional, but reproducible SEGFAULTs for really old PHP versions (< 5.4). I've managed to work around this in reactphp/child-process#29, but this actually boils down to an issue in this component when instantiating a new
Stream
with a pipe stream. Here's the gist of the broken code:Or the same issue when using the STDIN pipe:
Apparently, this reads beyond the resource limits and returns a corrupted string value where
strlen($data) === -1
.The text was updated successfully, but these errors were encountered: