|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51958 socket_accept() fails on IPv6 server sockets
Submitted: 2010-05-31 18:04 UTC Modified: 2011-03-17 23:23 UTC
Avg. Score:4.6 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: grawity at gmail dot com Assigned: cataphract (profile)
Status: Closed Package: Sockets related
PHP Version: 5.3.2 OS: Windows XP SP3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: grawity at gmail dot com
New email:
PHP Version: OS:


 [2010-05-31 18:04 UTC] grawity at gmail dot com
When attempting to create an IPv6 server using the socket_*() functions, PHP displays an error when socket_accept() is called:

> [10014]: The system detected an invalid pointer address in attempting to use a pointer argument in a call.

Client IPv6 sockets (socket_connect()) are working.
IPv6 streams, both stream_socket_server() and client(), are working.
Other software (such as Python's socket module) is working.

Problem occurs even with no php.ini is used:
> php -n -d extension="C:\Program Files\PHP\ext\php_sockets.dll" testsock.php

Standard PHP build from is used:
> PHP 5.3.2 (cli) (built: Mar  3 2010 20:47:01)
> Copyright (c) 1997-2010 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Test script:
$listenfd = socket_create(AF_INET6, SOCK_STREAM, SOL_TCP);
socket_bind($listenfd, "::1", 13579);
print "Waiting...\n";
$connfd = socket_accept($listenfd);
if ($connfd) print "Accepted connection.\n";

Expected result:
Accepted connection.

(The script should wait for an IPv6 connection on [::1] (IPv6 localhost) port 13579 and print "Accepted connection." when one is accepted)

Actual result:
Warning: socket_accept(): unable to accept incoming connection [10014]: The system detected an invalid pointer address in attempting to use a pointer argument in a call.
 in H:\pqi\code\testsock.php on line6


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-06 20:47 UTC]
-Assigned To: +Assigned To: cataphract
 [2011-03-14 23:59 UTC]
Automatic comment from SVN on behalf of cataphract
Log: - Fixed bug #51958: socket_accept() fails on IPv6 sockets.
#On hold for 5.3
 [2011-03-15 00:00 UTC]
-Status: Assigned +Status: Suspended
 [2011-03-15 00:00 UTC]
Fixed in trunk; on hold for 5.3, waiting until after 5.3.6 release.
 [2011-03-17 23:23 UTC]
-Status: Suspended +Status: Closed
 [2011-03-17 23:23 UTC]
Fix merged to 5.3.
 [2011-03-20 23:12 UTC]
Automatic comment from SVN on behalf of cataphract
Log: - Fixed SKIPIF section of bug51958.phpt.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 10:03:39 2023 UTC