ID:               32979
 User updated by:  mjpph at stardust dot fi
 Reported By:      mjpph at stardust dot fi
-Status:           Feedback
+Status:           Open
 Bug Type:         Network related
 Operating System: Linux (Fedora Core 3)
 PHP Version:      5CVS-2005-05-08 (dev)
 Assigned To:      wez
 New Comment:

Sure thing, just tell me what to do. I've never even heard of valgrind
before, but it seems FC3 comes with one.


Previous Comments:
------------------------------------------------------------------------

[2005-05-28 04:39:07] [EMAIL PROTECTED]

That's the missing piece of the puzzle.
openssl replaces the default tcp transport, but passes through to the
default when you don't request ssl.
So, the behaviour should be identical.

Can you run the openssl enabled version under valgrind for me, to see
if something is misbehaving?
It'll give me a headstart when I sit down to solve the problem in the
morning.

Thanks.

------------------------------------------------------------------------

[2005-05-27 22:05:33] mjpph at stardust dot fi

It's too bad that the openssl screws up the stream_select or
stream_socket_client in some weird way as I intended to use
stream_socket_enable_crypto() with the stream_socket_client() and it's
dependant of openssl.

------------------------------------------------------------------------

[2005-05-27 21:52:35] mjpph at stardust dot fi

The strangest thing.. I had time to do some test compiles with the
200505260030 snapshot and I got some working. I took my usual
parameters off from configure one by one, after I removed
--with-openssl the script started suddenly working. Then I did test
compile with ./configure --with-openssl and without any parameters. The
one --with-openssl failed the script and the one without it worked just
fine. It seems that the openssl support does some havoc which causes
the failures. I did proper make clean / make distclean between the
compiles and doublechecked the results. Linux is a Fedora Core 3,
standard install with development support enabled.

The test script is as follows, the host machine has sendmail running as
a test service.

<?
$c = stream_socket_client("tcp://127.0.0.1:25");
while (1)
{
  $streams = array($c);
  if (stream_select($streams, $write=NULL, $except=NULL, 5, 0))
die("Select OK\n");
}
?>

Strace from the working PHP (without any configure parameters):

read(3, "<?\n$c = stream_socket_client(\"tc"..., 8192) = 221
read(3, "", 4096)                       = 0
read(3, "", 8192)                       = 0
close(3)                                = 0
munmap(0x2a97b2c000, 4096)              = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 3
close(3)                                = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
fcntl(3, F_GETFL)                       = 0x2 (flags
O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
connect(3, {sa_family=AF_INET, sin_port=htons(25),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now
in progress)
poll([{fd=3, events=POLLIN|POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}],
1, 60000) = 1
getsockopt(3, SOL_SOCKET, SO_ERROR, "\0\0\0\0", [12884901892]) = 0
fcntl(3, F_SETFL, O_RDWR)               = 0
select(4, [3], [], [], {5, 0})          = 1 (in [3], left {4, 998000})
write(1, "Select OK\n", 10)             = 10
close(3)                                = 0
close(1)                                = 0
close(0)                                = 0

...

Strace from the non-working PHP (only --with-openssl added for
configure):

read(3, "<?\n$c = stream_socket_client(\"tc"..., 8192) = 221
read(3, "", 4096)                       = 0
read(3, "", 8192)                       = 0
close(3)                                = 0
munmap(0x2a97b2f000, 4096)              = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 3
close(3)                                = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
fcntl(3, F_GETFL)                       = 0x2 (flags
O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
connect(3, {sa_family=AF_INET, sin_port=htons(25),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now
in progress)
poll([{fd=3, events=POLLIN|POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}],
1, 60000) = 1
getsockopt(3, SOL_SOCKET, SO_ERROR, "\0\0\0\0", [12884901892]) = 0
fcntl(3, F_SETFL, O_RDWR)               = 0
select(4, [3], [], [], {5, 0})          = 1 (in [3], left {4, 998000})
select(4, [3], [], [], {5, 0})          = 1 (in [3], left {5, 0})
select(4, [3], [], [], {5, 0})          = 1 (in [3], left {5, 0})

.. continues until the script is killed

------------------------------------------------------------------------

[2005-05-27 16:10:58] [EMAIL PROTECTED]

*please* paste the exact script you are using that produced those
straces.


------------------------------------------------------------------------

[2005-05-27 15:21:54] [EMAIL PROTECTED]

Whenever I see FC3-specific problems I always suspect SELinux. 
Although I don't see how that can affect a select()

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/32979

-- 
Edit this bug report at http://bugs.php.net/?id=32979&edit=1

Reply via email to