Bug #65486 [Asn->Fbk]: mysqli_poll() is broken on win x64

From: Date: Tue, 03 Dec 2013 14:33:56 +0000
Subject: Bug #65486 [Asn->Fbk]: mysqli_poll() is broken on win x64
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183105@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65486&edit=1

 ID:                 65486
 Updated by:         andrey@php.net
 Reported by:        ab@php.net
 Summary:            mysqli_poll() is broken on win x64
-Status:             Assigned
+Status:             Feedback
 Type:               Bug
 Package:            MySQLi related
 Operating System:   Windows 64 Bit
 PHP Version:        5.5Git-2013-08-20 (Git)
 Assigned To:        mysql
 Block user comment: N
 Private report:     N

 New Comment:

Anatol,
except for the bug that mysqlnd converts internally the int to uint when passing back through an out
desc_num parameter of _mysqlnd_poll() everything else is more or less copied from another part of
the distribution. The code exists in 2 places : streamfuncs.c and sockets.c (search for
"Solaris + BSD"). Is the code in this places also not correct?

Best,
Andrey


Previous Comments:
------------------------------------------------------------------------
[2013-08-20 09:01:58] ab@php.net

Description:
------------
mysqli_poll() in user space invokes _mysqlnd_poll(). In that function 
php_select()  
is used for polling. The windows implementation works with int for descriptors, 
however php_socket_t data type is used in mysqli. This has two flaws

- generally on windows, php_socket_t is a typedef from SOCKET and is unsigned, 
that means any usual UNIX socket checks want work, say checking if descriptor is 
negative

- on 64 bit windows this is a breach, because SOCKET there is unsigned 64 bit 
integer while php_select() implementation still uses 32 bit integers. 
php_select()  
internally calls select(), which on windows expects an 32 bit integer as 
descriptor as well.

As result mysqli_poll* function family is broken on 64 bit Windows.



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



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


Thread (4 messages)

« previous php.bugs (#183105) next »