#16886 [Fbk->Bgs]: Seg. fault on socket_close if socket died

From: Date: Wed, 11 Sep 2002 16:00:43 +0000
Subject: #16886 [Fbk->Bgs]: Seg. fault on socket_close if socket died
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-19077@lists.php.net to get a copy of this message
ID: 16886 Updated by: sniper@php.net Reported By: tech@kalyweb.com -Status: Feedback +Status: Bogus Bug Type: Sockets related Operating System: Linux RedHat 7.2 PHP Version: 4.0CVS-2002-04-28 New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Previous Comments: ------------------------------------------------------------------------ [2002-04-28 08:57:34] mfischer@php.net To properly diagnose this bug, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". ------------------------------------------------------------------------ [2002-04-28 08:43:06] tech@kalyweb.com I had that issue : I use a non blocking socket to read a data stream. I was assuming that if socket_read($socket) !== false then I should close the socket !! NO ! I must not ! If I close that socket, I have an error : 9975 Segmentation fault /usr/local/php-cgi/bin/php -q ./core.php I checked socket_last_error and I found : 104 : Connexion reset by peer .... It would be nice if the socket is checked before socket_close or socket_shutdown ... I don't know sockets system under Linux . I can't fix that :( To have the same error, create a socket, listen on it, accept accept that connexion. On the remote machine, close the telnet (kill or other :D) and then do socket_close on your socket. Then you have a seg. fault ! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16886&edit=1

« previous php.bugs (#19077) next »