From: ghpille at hotmail dot com
Operating system: Linux
PHP version: 5.4Git-2014-05-16 (snap)
Package: SOAP related
Bug Type: Bug
Bug description:SoapClient posts on connection closed by server
Description:
------------
A PHP script instantiates two SoapClients, and makes two succesful
requests using the first. Now and then, the server closes the
connnection after replying to the second request, by sending a FIN
packet, which is ACKnowledged by the client. The client makes two
succesful requests using the second client, and tries to make a third
one using the first client. The server rejects the packets from the
third request (a RST is sent for each packet received), and the client
complains: "Fatal error: Uncaught SoapFault errors fetching http
headers".
The client knows the connection has been closed, since recv returns 0.
In most cases, a new connection will be established, but now and then,
the client disregards the closure.
From a TCP point of view, the client may send data before closing its
side of the connection, but from an application point of view it makes
no sense to post a request and expect an answer.
A tcpdump of the failing post:
https://groups.google.com/forum/#!topic/comp.lang.php/52KxyhoUw_s
When I posted this, I had not yet realized the server had closed the
connection earlier on.
Problem first noticed on a CentOS 6.5 VMWare client, reproducible on
Debian Wheezy physical system, 32+64bit, PHP 5.4 and 5.5.
PHP Version => 5.4.30-dev
System => Linux ghp-debian-vm 3.2.0-4-486 #1 Debian 3.2.54-2 i686
Build Date => May 16 2014 13:34:15
Configure Command => './configure' '--enable-soap'
Expected result:
----------------
SoapClient should establish a new connection, as it does usually.
13:35:18.192641 poll([{fd=3, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1,
0) = 1 ([{fd=3, revents=POLLIN}])
13:35:18.192693 recv(3, "", 1, MSG_PEEK) = 0
13:35:18.192732 close(3) = 0
... resolve host address ...
13:35:18.197776 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
13:35:18.197830 fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR)
13:35:18.197871 fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
13:35:18.197913 connect(3, {sa_family=AF_INET, sin_port=htons(80),
sin_addr=inet_addr("172.16.2.173")}, 16) = -1 EINPROGRESS (Operation now
in progress)
13:35:18.198091 poll([{fd=3, events=POLLIN|POLLOUT|POLLERR|POLLHUP}], 1,
60000) = 1 ([{fd=3, revents=POLLOUT}])
13:35:18.199010 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
13:35:18.199061 fcntl64(3, F_SETFL, O_RDWR) = 0
13:35:18.199129 send(3, "POST /roularta-jobcv-dao/service"..., 8192,
MSG_DONTWAIT) = 8192
13:35:18.199391 send(3, "e7b887b8f813f353/eee99b2a98dfda4"..., 352,
MSG_DONTWAIT) = 352
13:35:18.199446 poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000)
= 1 ([{fd=3, revents=POLLIN}])
13:35:18.223129 recv(3, "HTTP/1.1 200 OK\r\nDate: Fri, 16 M"..., 8192,
MSG_DONTWAIT) = 198
Actual result:
--------------
13:35:16.570135 poll([{fd=3, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1,
0) = 1 ([{fd=3, revents=POLLIN}])
13:35:16.570184 recv(3, "", 1, MSG_PEEK) = 0
13:35:16.570233 send(3, "POST /roularta-jobcv-dao/service"..., 8192,
MSG_DONTWAIT) = 8192
13:35:16.570527 send(3, "e7b887b8f813f353/eee99b2a98dfda4"..., 352,
MSG_DONTWAIT) = 352
13:35:16.570577 poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000)
= 1 ([{fd=3, revents=POLLIN}])
13:35:16.570629 recv(3, "", 8192, MSG_DONTWAIT) = 0
13:35:16.570669 close(3) = 0
13:35:16.571069 write(1, "\nFatal error: Uncaught SoapFault"..., 429) =
429
--
Edit bug report at https://bugs.php.net/bug.php?id=67292&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67292&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67292&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67292&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67292&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67292&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67292&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67292&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67292&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67292&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67292&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67292&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67292&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67292&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67292&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67292&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67292&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67292&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67292&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67292&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67292&r=mysqlcfg