On 4 Mar 2014, at 03:25, Ivan Gerasimov <ivan.gerasi...@oracle.com> wrote:
> Yes, you're right. > strtok() is thread-safe in Windows unlike its Unix counterpart. > > Thus using strtok_s() only adds some boundary checking in this case. Ivan, Are you now withdrawing this request for review? Or are you suggesting that strtok_s should be used anyway? -Chris. > > Sincerely yours, > Ivan > > On 04.03.2014 0:26, Salter, Thomas A wrote: >> strtok is thread-safe in MS C/C++. It uses thread-local store to hold its >> state. strtok_s can be called recursively to parse different strings, though >> it's named like the MS extensions that check for buffer overruns. >> >> http://msdn.microsoft.com/en-us/library/2c8d19sb(v=vs.100).aspx >> >> ------------------------------ >> >> Message: 5 >> Date: Mon, 03 Mar 2014 21:01:15 +0400 >> From: Ivan Gerasimov <ivan.gerasi...@oracle.com> >> Subject: Re: RFR: [8036088] - Thread-unsafe strtok() is used to parse >> the list of overrides >> To: Christos Zoulas <chris...@zoulas.com>, OpenJDK Network Dev list >> <net-dev@openjdk.java.net> >> Message-ID: <5314b55b.9070...@oracle.com> >> Content-Type: text/plain; charset=UTF-8; format=flowed >> >> Hi Christos! >> >> On 03.03.2014 20:52, chris...@zoulas.com wrote: >>> On Mar 3, 8:32pm, ivan.gerasi...@oracle.com (Ivan Gerasimov) wrote: >>> -- Subject: RFR: [8036088] - Thread-unsafe strtok() is used to parse the >>> list >>> >>> | Hello! >>> | >>> | The strtok() function is used in >>> | ./windows/native/sun/net/spi/DefaultProxySelector.c. >>> | This function is not thread safe, so it may potentially cause a problem. >>> | >>> | The failure in this particular place would be very unlikely, because >>> | this code should be executed only once during initialization. >>> | Therefore, no regtest provided. >>> | >>> | The fix would be to use a thread-safe equivalent, which is strtok_s() >>> | under Windows. >>> | >>> | Would you please help review this simple fix? >>> | >>> | BUGURL: https://bugs.openjdk.java.net/browse/JDK-8036088 >>> | WEBREV: http://cr.openjdk.java.net/~igerasim/8036088/0/webrev/ >>> >>> Doesn't windows have strtok_r() IEEE Std 1003.1c-1995 (``POSIX.1''). >> MSDN does not refer to strtok_r(). >> Grepping the JDK code shows that strtok_s() is used in the >> windows-specific code. >> >> Sincerely yours, >> Ivan >> >>> christos >>> >>> >> >> >> End of net-dev Digest, Vol 81, Issue 3 >> ************************************** >> >> >