RE: [PHP-DEV] RE: Patch: Fixing some .phpt's that fail with Wincache
| From: | Anatol Belski | Date: | Wed, 27 Nov 2013 18:54:18 +0000 |
| Subject: | RE: [PHP-DEV] RE: Patch: Fixing some .phpt's that fail with Wincache | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70444@lists.php.net to get a copy of this message | ||
Hi Eric,
On Tue, November 26, 2013 18:35, Eric Stenson wrote:
> From: Tjerk Meesters [mailto:tjerk.meesters@gmail.com]
> Sent: Tuesday, November 26, 2013 1:42 AM
>
>
>> On Tue, Nov 26, 2013 at 5:19 PM, Ferenc Kovacs
>> <tyra3l@gmail.com<mailto:tyra3l@gmail.com>>
>> wrote:
>> 2013.11.26. 7:31, "Nikita Popov"
>>
>> <nikita.ppv@gmail.com<mailto:nikita.ppv@gmail.com>> ezt
>> írta:
>>
>>>
>>> On Mon, Nov 25, 2013 at 8:30 PM, Eric Stenson
>>>
>>> <ericsten@microsoft.com<mailto:ericsten@microsoft.com>
>>> wrote:
>>>
> [...]
>
>>>> $ui1 = uniqid($str);
>>>> +/* Must sleep here to let uniqid generate a different unique ID */
>>>> +usleep( 10 );
>>>> $ui2 = uniqid($str);
>>>>
>>>>
>>>> $len = strncasecmp(PHP_OS, 'CYGWIN', 6) ? 19 : 29;
>>>>
>>>>
>>
>> Internally, uniqid() uses usleep(1) only if 'more entropy' is omitted
>> and not on Windows and Cygwin (must use 'more entropy').
>>
>> So, when 'more entropy' is present, it will skip usleep(1) but pad the
>> result with php_combined_lcg().
>>
>> I'm sure there was a good reason to do so, but it does seem
>> counter-intuitive at best.
>>
>
> Ah! My bad. Please remove the usleep(10) and add the ', true' (more
> entropy) param to the uniqid() call. This test consistently fails on
> Windows.
>
>
> For completeness of coverage, you might consider also testing with the
> usleep(1) and without the ', true' (more entropy) param.
>
> Thx!
> --E.
I'd suggest you to fork the PHP sources on github so you could make a pull
request. Then it'll be more handy to discuss, test and complete the fixes.
Which wincache codebase should I use to test your patch with PHP-5.6
branch? I'd willingly test when your fork is so far.
Regards
Anatol