Bug #16886: Seg. fault on socket_close if socket died
| From: | tech at kalyweb dot com | Date: | Sun, 28 Apr 2002 12:43:06 +0000 |
| Subject: | Bug #16886: Seg. fault on socket_close if socket died | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-6346@lists.php.net to get a copy of this message | ||
From: tech@kalyweb.com
Operating system: Linux RedHat 7.2
PHP version: 4.0CVS-2002-04-28
PHP Bug Type: Sockets related
Bug description: Seg. fault on socket_close if socket died
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 bug report at http://bugs.php.net/?id=16886&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16886&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16886&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16886&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16886&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16886&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16886&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16886&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16886&r=submittedtwice