php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64340 sockets tests failed
Submitted: 2013-03-02 18:05 UTC Modified: 2013-10-02 14:32 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: reeze@php.net Assigned: laruence (profile)
Status: Closed Package: Sockets related
PHP Version: 5.5.0alpha5 OS: Mac OSX 10.8
Private report: No CVE-ID: None
 [2013-03-02 18:05 UTC] reeze@php.net
Description:
------------
Failed tests:

Multicast support: IPv6 send options [ext/sockets/tests/mcast_ipv6_send.phpt]
recvmsg(): receive SCM_CREDENTIALS messages 
[ext/sockets/tests/socket_cmsg_rights.phpt]
recvmsg(): basic test [ext/sockets/tests/socket_recvmsg.phpt]
sendmsg()/recvmsg(): test ability to receive multiple messages 
[ext/sockets/tests/socket_sendrecvmsg_multi_msg.phpt]
Test if socket_recvfrom() receives data sent by socket_sendto() via IPv4 UDP 
[ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt]
socket_set_option() with IPV6_PKTINFO 
[ext/sockets/tests/socket_set_option_in6_pktinfo.phpt]\

diff:

==> ext/sockets/tests/mcast_ipv6_send.diff <==
013+ 
014+ Warning: socket_set_option(): unable to set socket option [49]: Can't 
assign requested address in 
/Users/reeze/Opensource/php-test/php-src-
master/ext/sockets/tests/mcast_ipv6_send.php on line 26
015+ bool(false)
013- bool(true)
==> ext/sockets/tests/socket_cmsg_rights.diff <==
014+   int(24)
014-   int(32)
018+     [name] => Array
019+         (
020+             [family] => 1
021+             [path] => 
022+         )
023+ 
018-     [name] => 
==> ext/sockets/tests/socket_recvmsg.diff <==
007+ 
008+ Notice: Use of undefined constant IPV6_RECVPKTINFO - assumed 
'IPV6_RECVPKTINFO' in /Users/reeze/Opensource/php-
test/php-src-master/ext/sockets/tests/socket_recvmsg.php on line 18
009+ 
010+ Warning: socket_set_option() expects parameter 3 to be long, string given 
in /Users/reeze/Opensource/php-
test/php-src-master/ext/sockets/tests/socket_recvmsg.php on line 18
011+ err
007- int(14)
008- Array
009- (
010-     [name] => Array
011-         (
012-             [family] => %d
013-             [addr] => ::1
014-             [port] => 7001
015-             [flowinfo] => 0
016-             [scope_id] => 0
017-         )
018- 
019-     [control] => Array
020-         (
021-             [0] => Array
022-                 (
023-                     [level] => %d
024-                     [type] => %d
025-                     [data] => Array
026-                         (
027-                             [addr] => ::1
028-                             [ifindex] => %d
029-                         )
030- 
031-                 )
032- 
033-         )
034- 
035-     [iov] => Array
036-         (
037-             [0] => testing packet
038-         )
039- 
040-     [flags] => 0
041- )
==> ext/sockets/tests/socket_sendrecvmsg_multi_msg.diff <==
007+ 
008+ Notice: Use of undefined constant IPV6_RECVPKTINFO - assumed 
'IPV6_RECVPKTINFO' in /Users/reeze/Opensource/php-
test/php-src-master/ext/sockets/tests/socket_sendrecvmsg_multi_msg.php on line 
18
009+ 
010+ Warning: socket_set_option() expects parameter 3 to be long, string given 
in /Users/reeze/Opensource/php-
test/php-src-master/ext/sockets/tests/socket_sendrecvmsg_multi_msg.php on line 
18
011+ err
007- int(11)
008- Array
009- (
010-     [name] => Array
011-         (
012-             [family] => %d
013-             [addr] => ::1
014-             [port] => 7001
015-             [flowinfo] => 0
016-             [scope_id] => 0
017-         )
018- 
019-     [control] => Array
020-         (
021-             [0] => Array
022-                 (
023-                     [level] => %d
024-                     [type] => %d
025-                     [data] => Array
026-                         (
027-                             [addr] => ::1
028-                             [ifindex] => %d
029-                         )
030- 
031-                 )
032- 
033-             [1] => Array
034-                 (
035-                     [level] => %d
036-                     [type] => %d
037-                     [data] => 40
038-                 )
039- 
040-         )
041- 
042-     [iov] => Array
043-         (
044-             [0] => test thing
045- 
046-         )
047- 
048-     [flags] => 0
049- )
==> ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.diff <==
007+  bytes have been received instead of the 5 bytes expected
007- Received Ping! from remote address 127.0.0.1 and remote port 1223
==> ext/sockets/tests/socket_set_option_in6_pktinfo.diff <==
001+ Notice: Use of undefined constant IPV6_PKTINFO - assumed 'IPV6_PKTINFO' in 
/Users/reeze/Opensource/php-test/php-
src-master/ext/sockets/tests/socket_set_option_in6_pktinfo.php on line 4
002+ 
003+ Warning: socket_set_option() expects parameter 3 to be long, string given 
in /Users/reeze/Opensource/php-
test/php-src-master/ext/sockets/tests/socket_set_option_in6_pktinfo.php on line 
4
001- Warning: socket_set_option(): error converting user data (path: 
in6_pktinfo): The key 'addr' is required in %s on 
line %d
002- bool(false)
003- bool(true)
004+ NULL
005+ 
006+ Notice: Use of undefined constant IPV6_PKTINFO - assumed 'IPV6_PKTINFO' in 
/Users/reeze/Opensource/php-test/php-
src-master/ext/sockets/tests/socket_set_option_in6_pktinfo.php on line 5
007+ 
008+ Warning: socket_set_option() expects parameter 3 to be long, string given 
in /Users/reeze/Opensource/php-
test/php-src-master/ext/sockets/tests/socket_set_option_in6_pktinfo.php on line 
8
009+ NULL

Test script:
---------------
For your reference, The attached patch enabled ipv6_pktinfo on os x

Expected result:
----------------
No failure

Actual result:
--------------
failed

Patches

ipv6-pktinfo-and-tiny-test-fix (last revision 2013-03-02 18:05 UTC by reeze@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-02 18:05 UTC] reeze@php.net
The following patch has been added/updated:

Patch Name: ipv6-pktinfo-and-tiny-test-fix
Revision:   1362247530
URL:        https://bugs.php.net/patch-display.php?bug=64340&patch=ipv6-pktinfo-and-tiny-test-fix&revision=1362247530
 [2013-03-02 18:08 UTC] reeze@php.net
-Assigned To: +Assigned To: cataphract
 [2013-03-02 19:19 UTC] cataphract@php.net
What's the deal with having changed the header includes order? I don't really like having headers that must be included in a specific order, that usually means one header depends on another, but fails to include it; if there's something that requires the headers to be in a specific order that should be fixed instead.

As to rest (the skip and the define for __APPLE_USE_RFC_3542), I see no problem with it; you can commit it yourself.
 [2013-03-03 02:53 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f2246f352fc01295c370728d68a9bcd2bb546652
Log: Fixed Bug #64340  (sockets tests failed) Patch by Reeze
 [2013-03-03 02:53 UTC] laruence@php.net
-Status: Assigned +Status: Closed
 [2013-03-03 02:53 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f2246f352fc01295c370728d68a9bcd2bb546652
Log: Fixed Bug #64340  (sockets tests failed) Patch by Reeze
 [2013-03-03 02:55 UTC] laruence@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

I commmitted, since reeze doesn't has PHP karma.

please verify the fix.
 [2013-03-03 02:55 UTC] laruence@php.net
-Status: Closed +Status: Assigned -Assigned To: cataphract +Assigned To: laruence
 [2013-03-03 02:57 UTC] laruence@php.net
-Status: Assigned +Status: Feedback
 [2013-03-04 18:21 UTC] reeze@php.net
Hi, cataphract
   The macro __APPLE_USE_RFC_3542 must be defined before including netinet/in.h,
but not all of the our c files include php_sockets.h in the topmost, but by indirectly
include other header files.

eg: 
$ head -n 1 conversions.c
sockaddr_conv.h

$ header -n 5 sockaddr_conv.h
...
#include <php_network.h>
#include "php_sockets.h" /* php_socket */

php_network.h wil be included <netinet/in.h> before the macro defined. and php_network.h has to been included
before php_sockets.h, so I have to  move conversion.h up instead.

in the mean time, in convesion.h  <netinet/in.h> was included before php_sockets.h too, so I have to move it 
up to meet the requirement of the macro. 



The current partial patch breaks the build because of missing the left part:

Undefined symbols for architecture x86_64:
  "_from_zval_write_in6_pktinfo", referenced from:
      _init_ancillary_registry in sendrecvmsg.o
      _php_do_setsockopt_ipv6_rfc3542 in sendrecvmsg.o
  "_to_zval_read_in6_pktinfo", referenced from:
      _init_ancillary_registry in sendrecvmsg.o
      _php_do_getsockopt_ipv6_rfc3542 in sendrecvmsg.o
ld: symbol(s) not found for architecture x86_64
 [2013-03-05 05:58 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3f67d5ae434236be1db2ee54baf85725ac7b6a56
Log: Revert &quot;Fixed Bug #64340  (sockets tests failed) Patch by Reeze&quot;
 [2013-03-05 05:58 UTC] laruence@php.net
-Status: Feedback +Status: Closed
 [2013-03-05 06:04 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3f67d5ae434236be1db2ee54baf85725ac7b6a56
Log: Revert &quot;Fixed Bug #64340  (sockets tests failed) Patch by Reeze&quot;
 [2013-03-05 06:05 UTC] laruence@php.net
I revert the previous fix, since the build broken.

I am wondering, if don't fix that, what's the problem is?

thanks
 [2013-03-05 10:47 UTC] reeze@php.net
Hi, 
the attached patch is intend to fix IPV6_PKTINFO failure, the commit didn't 
contain all of the fix. but only the macro define.

The patch isn't break build. but the partially applied patch. 
only define __APPLE_USE_RFCxxxx is not enough. the rest of the changes 
should be applied too.

I couldn't figure out a better solution which didn't require header 
inclusion order, since the macro itself required to be defined first.
 [2013-03-05 10:47 UTC] reeze@php.net
-Status: Closed +Status: Re-Opened
 [2013-03-05 11:34 UTC] laruence@php.net
there is one workaround:

#ifdef  __APPLE__
#define IPV6_PKTINFO        IPV6_2292PKTINFO
#define IPV6_HOPLIMIT       IPV6_2292HOPLIMIT
#define IPV6_NEXTHOP        IPV6_2292NEXTHOP
#define IPV6_HOPOPTS        IPV6_2292HOPOPTS
#define IPV6_DSTOPTS        IPV6_2292DSTOPTS
#define IPV6_RTHDR          IPV6_2292RTHDR
#define IPV6_PKTOPTIONS     IPV6_2292PKTOPTIONS
#endif 

will keep finding more better solution
 [2013-10-02 14:32 UTC] mike@php.net
Any update on this?
 [2013-11-17 09:31 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3f67d5ae434236be1db2ee54baf85725ac7b6a56
Log: Revert &quot;Fixed Bug #64340  (sockets tests failed) Patch by Reeze&quot;
 [2013-11-17 09:31 UTC] laruence@php.net
-Status: Re-Opened +Status: Closed
 [2013-11-17 09:31 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f2246f352fc01295c370728d68a9bcd2bb546652
Log: Fixed Bug #64340  (sockets tests failed) Patch by Reeze
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 06:01:30 2024 UTC