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
Hi @istvanskeri, thanks for reporting! I'm not sure I follow what you're trying to do and what your issue is, as it's a bit unclear what you're trying to achieve from the description you've posted.
Where does the "Segmentation Fault (core dumped)" come from? Which process are you executing? When does this happen? Is this reproducible / does it happen all the time?
May I ask you provide a simple gist of what you're trying to achieve? Thanks!
I have a ratchet server that waits for a socket message. When a message is received, a child process is created. The child process is a long running php script that sends back percentage completed back to the ratchet server that sends the percentage completed via socket back to the user. The ratchet server crashes with a Segmentation Fault (core dumped) message as soon as i try to do an stdin to the child process to pass variables to the long running php script.
We're thinking about upgrading our production server to php 7. Im hoping that will fix the seg fault issue. Will this library, and also ratchet work on php 7?
@istvanskeri To put it really simple: Yes it runs on PHP 7, been running it in production on 7 for more then a year now maybe two. You also get a free performance gain when upgrading to 7.
Can we pin point this to a certain program and/or PHP versions? What process are you executing and can this be reproduced easily? Ideally, a gist could help to diagnose this further 👍
@clue well, it looks like you have already fixed this problem previously, but limited fix version to PHP 5.3. I can try to create a test gist if you want, but we can rather simply apply this patch, as the only possible downside is IO performance when sending/fetching data while talking with cli script
This check is currently in place because the test suite would otherwise SEGFAULT, see 29aab03 for more details. If we can come up with a similar test case (or a gist which helps us create this test case), we may update the affected versions 👍
Closing this due to a lack of feedback, as we can not reproduce this. Please come back with more details if this problem persists and we can reopen this 👍
I had this same issue on an old version of PHP 5.4.
$ php --version
PHP 5.4.15-1~precise+1 (cli) (built: May 13 2013 16:00:00)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
I could not reproduce the issue on php 5.4.45 (which is the PHP that comes when doing a docker pull php:5.4).
In order to work around the issue, I also needed to do the stream_set_read_buffer fix.
Since it seems unreasonable to determine which versions of PHP 5.4 this does and doesn't work for, and upstream a fix, all for a really old version of PHP, I'll leave what I did to work around it outside of the library here.
@bryanburgers Thank you for reporting back with another affected version! So far, we've been unable to reliable reproduce this issue and/or link this to a specific PHP version.
I've just dug up an old PHP bug report that may be related here: https://bugs.php.net/bug.php?id=61019 (php/php-src@1ec83d4). This indicates this was fixed in 5.4.28+, 5.5.12+ and 5.6+ which seems to support the affected versions reported in this ticket so far.
We've been able to reproduce this issue with PHP < 5.4 only so far via reactphp/stream#80. Unfortunately, Travis does not appear to allow us to test these legacy versions and I've been unable to test this elsewhere.
Activity
WyriHaximus commentedon Jun 28, 2017
Do I assume correctly that
$jsonis or should be a string?istvanskeri commentedon Jun 28, 2017
correct. its a string and it is working for me locally. Not in production
istvanskeri commentedon Jun 28, 2017
$json var_dump is
string(67) "{"command":"subscribe","comp_id":8481,"org_id":575,"user_id":64758}"
clue commentedon Jun 29, 2017
Hi @istvanskeri, thanks for reporting! I'm not sure I follow what you're trying to do and what your issue is, as it's a bit unclear what you're trying to achieve from the description you've posted.
Where does the "Segmentation Fault (core dumped)" come from? Which process are you executing? When does this happen? Is this reproducible / does it happen all the time?
May I ask you provide a simple gist of what you're trying to achieve? Thanks!
istvanskeri commentedon Jun 29, 2017
I have a ratchet server that waits for a socket message. When a message is received, a child process is created. The child process is a long running php script that sends back percentage completed back to the ratchet server that sends the percentage completed via socket back to the user. The ratchet server crashes with a Segmentation Fault (core dumped) message as soon as i try to do an stdin to the child process to pass variables to the long running php script.
$process->stdin->write($json);
https://gist.github.com/istvanskeri/15fd77afc641cd0013ef18cbbf7c7c27
istvanskeri commentedon Jul 7, 2017
We're thinking about upgrading our production server to php 7. Im hoping that will fix the seg fault issue. Will this library, and also ratchet work on php 7?
WyriHaximus commentedon Jul 7, 2017
@istvanskeri To put it really simple: Yes it runs on PHP 7, been running it in production on 7 for more then a year now maybe two. You also get a
freeperformance gain when upgrading to 7.nick4fake commentedon Jul 17, 2017
Hey, we have the same problem on PHP 5.5.10. Simply sending data to input of a process produces segfault.
nick4fake commentedon Jul 17, 2017
@istvanskeri For us PHP7 is working correctly, but we can not update php ATM
nick4fake commentedon Jul 17, 2017
Well, fix was trivial. Actually, it was even in the codebase:
->
clue commentedon Jul 17, 2017
Thanks for reporting back on this!
Can we pin point this to a certain program and/or PHP versions? What process are you executing and can this be reproduced easily? Ideally, a gist could help to diagnose this further 👍
nick4fake commentedon Jul 17, 2017
@clue well, it looks like you have already fixed this problem previously, but limited fix version to PHP 5.3. I can try to create a test gist if you want, but we can rather simply apply this patch, as the only possible downside is IO performance when sending/fetching data while talking with cli script
clue commentedon Jul 17, 2017
This check is currently in place because the test suite would otherwise SEGFAULT, see 29aab03 for more details. If we can come up with a similar test case (or a gist which helps us create this test case), we may update the affected versions 👍
istvanskeri commentedon Jul 20, 2017
What steps can I take to get this working with PHP 5.5.9?
clue commentedon Jul 25, 2017
What steps can we take to reproduce a SEGFAULT on PHP 5.5.9 (or any other version for that matter)?
I'd like to check whether there's an issue here and if/how this can be fixed, but so far we've not been able to reproduce this.
clue commentedon Aug 8, 2017
Closing this due to a lack of feedback, as we can not reproduce this. Please come back with more details if this problem persists and we can reopen this 👍
bryanburgers commentedon Dec 20, 2017
I had this same issue on an old version of PHP 5.4.
I could not reproduce the issue on php 5.4.45 (which is the PHP that comes when doing a
docker pull php:5.4).In order to work around the issue, I also needed to do the
stream_set_read_bufferfix.Since it seems unreasonable to determine which versions of PHP 5.4 this does and doesn't work for, and upstream a fix, all for a really old version of PHP, I'll leave what I did to work around it outside of the library here.
clue commentedon Dec 20, 2017
@bryanburgers Thank you for reporting back with another affected version! So far, we've been unable to reliable reproduce this issue and/or link this to a specific PHP version.
I've just dug up an old PHP bug report that may be related here: https://bugs.php.net/bug.php?id=61019 (php/php-src@1ec83d4). This indicates this was fixed in 5.4.28+, 5.5.12+ and 5.6+ which seems to support the affected versions reported in this ticket so far.
We've been able to reproduce this issue with PHP < 5.4 only so far via reactphp/stream#80. Unfortunately, Travis does not appear to allow us to test these legacy versions and I've been unable to test this elsewhere.
Can anybody else confirm these version ranges?
clue commentedon Dec 20, 2017
Finally managed to reproduce this! 🎉
https://3v4l.org/g0A6U
This confirms that this affects the above version range. I will look into filing a PR for our stream component to work around this issue