Re: RFR: 8251466: test/java/io/File/GetXSpace.java fails on Windows with mapped network drives.

2022-01-27 Thread Andrey Turbanov
On Thu, 20 Jan 2022 21:10:39 GMT, Andrey Turbanov  wrote:

> Test `test/java/io/File/GetXSpace.java` always failed on my machine with this 
> output:
> 
> --System.out:(12/489)--
> --- Testing df
> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
> D: 59672 59672 0 100% /cygdrive/d
> 
> 
> SecurityManager = null
> C:/Programs/cygwin64:
>   df total= 299877003264 free = 0 usable = 248988995584
>   getX total= 299877003264 free = 248988995584 usable = 248988995584
> ::
>   df total= 61104128 free = 0 usable = 0
>   getX total= 0 free = 0 usable = 0
> --System.err:(23/1617)--
> java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
> at 
> java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
> at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
> at java.base/java.io.File.toPath(File.java:2396)
> at GetXSpace.compare(GetXSpace.java:223)
> at GetXSpace.testDF(GetXSpace.java:403)
> at GetXSpace.main(GetXSpace.java:437)
> at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> at java.base/java.lang.reflect.Method.invoke(Method.java:577)
> at 
> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
> at java.base/java.lang.Thread.run(Thread.java:833) 
> 
> Parsing of df output is incorrect. It skips first symbols after matching of 
> line.
> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L160
> 
> It means that after matching first line:
> 
> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
> 
> 
> It skips first symbols of next line - symbol `D` and then proceeds to match 
> _corrupted_ line:
> 
> : 59672 59672 0 100% /cygdrive/d
> 
> 
> Problems affects only Windows, because only in Windows case first group of 
> matcher is used:
> 
> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L155-L156
> 
> 
> Testing:
> * Windows x64 - always failed before. No errors after fix
> * Linux x64

Thank you for review!

-

PR: https://git.openjdk.java.net/jdk/pull/7170


Re: RFR: 8251466: test/java/io/File/GetXSpace.java fails on Windows with mapped network drives.

2022-01-26 Thread Arno Zeller
On Mon, 24 Jan 2022 12:02:10 GMT, Andrey Turbanov  wrote:

>> Test `test/java/io/File/GetXSpace.java` always failed on my machine with 
>> this output:
>> 
>> --System.out:(12/489)--
>> --- Testing df
>> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
>> D: 59672 59672 0 100% /cygdrive/d
>> 
>> 
>> SecurityManager = null
>> C:/Programs/cygwin64:
>>   df total= 299877003264 free = 0 usable = 248988995584
>>   getX total= 299877003264 free = 248988995584 usable = 248988995584
>> ::
>>   df total= 61104128 free = 0 usable = 0
>>   getX total= 0 free = 0 usable = 0
>> --System.err:(23/1617)--
>> java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
>> at 
>> java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
>> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
>> at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
>> at java.base/java.io.File.toPath(File.java:2396)
>> at GetXSpace.compare(GetXSpace.java:223)
>> at GetXSpace.testDF(GetXSpace.java:403)
>> at GetXSpace.main(GetXSpace.java:437)
>> at 
>> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:577)
>> at 
>> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
>> at java.base/java.lang.Thread.run(Thread.java:833) 
>> 
>> Parsing of df output is incorrect. It skips first symbols after matching of 
>> line.
>> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L160
>> 
>> It means that after matching first line:
>> 
>> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
>> 
>> 
>> It skips first symbols of next line - symbol `D` and then proceeds to match 
>> _corrupted_ line:
>> 
>> : 59672 59672 0 100% /cygdrive/d
>> 
>> 
>> Problems affects only Windows, because only in Windows case first group of 
>> matcher is used:
>> 
>> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L155-L156
>> 
>> 
>> Testing:
>> * Windows x64 - always failed before. No errors after fix
>> * Linux x64
>
> @ArnoZeller can you please check if proposed changes fix the test in your 
> environment?
> @bplb can you please have a look at this pr?

@turbanoff The results look good - the failure is fixed with your patch!. 
Thanks for taking care of the issue.

-

PR: https://git.openjdk.java.net/jdk/pull/7170


Re: RFR: 8251466: test/java/io/File/GetXSpace.java fails on Windows with mapped network drives.

2022-01-26 Thread Arno Zeller
On Mon, 24 Jan 2022 12:02:10 GMT, Andrey Turbanov  wrote:

>> Test `test/java/io/File/GetXSpace.java` always failed on my machine with 
>> this output:
>> 
>> --System.out:(12/489)--
>> --- Testing df
>> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
>> D: 59672 59672 0 100% /cygdrive/d
>> 
>> 
>> SecurityManager = null
>> C:/Programs/cygwin64:
>>   df total= 299877003264 free = 0 usable = 248988995584
>>   getX total= 299877003264 free = 248988995584 usable = 248988995584
>> ::
>>   df total= 61104128 free = 0 usable = 0
>>   getX total= 0 free = 0 usable = 0
>> --System.err:(23/1617)--
>> java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
>> at 
>> java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
>> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
>> at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
>> at java.base/java.io.File.toPath(File.java:2396)
>> at GetXSpace.compare(GetXSpace.java:223)
>> at GetXSpace.testDF(GetXSpace.java:403)
>> at GetXSpace.main(GetXSpace.java:437)
>> at 
>> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:577)
>> at 
>> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
>> at java.base/java.lang.Thread.run(Thread.java:833) 
>> 
>> Parsing of df output is incorrect. It skips first symbols after matching of 
>> line.
>> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L160
>> 
>> It means that after matching first line:
>> 
>> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
>> 
>> 
>> It skips first symbols of next line - symbol `D` and then proceeds to match 
>> _corrupted_ line:
>> 
>> : 59672 59672 0 100% /cygdrive/d
>> 
>> 
>> Problems affects only Windows, because only in Windows case first group of 
>> matcher is used:
>> 
>> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L155-L156
>> 
>> 
>> Testing:
>> * Windows x64 - always failed before. No errors after fix
>> * Linux x64
>
> @ArnoZeller can you please check if proposed changes fix the test in your 
> environment?
> @bplb can you please have a look at this pr?

@turbanoff I put your change in our nightly test queue. I will check tomorrow 
for the results.

-

PR: https://git.openjdk.java.net/jdk/pull/7170


Re: RFR: 8251466: test/java/io/File/GetXSpace.java fails on Windows with mapped network drives.

2022-01-24 Thread Brian Burkhalter
On Thu, 20 Jan 2022 21:10:39 GMT, Andrey Turbanov  wrote:

> Test `test/java/io/File/GetXSpace.java` always failed on my machine with this 
> output:
> 
> --System.out:(12/489)--
> --- Testing df
> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
> D: 59672 59672 0 100% /cygdrive/d
> 
> 
> SecurityManager = null
> C:/Programs/cygwin64:
>   df total= 299877003264 free = 0 usable = 248988995584
>   getX total= 299877003264 free = 248988995584 usable = 248988995584
> ::
>   df total= 61104128 free = 0 usable = 0
>   getX total= 0 free = 0 usable = 0
> --System.err:(23/1617)--
> java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
> at 
> java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
> at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
> at java.base/java.io.File.toPath(File.java:2396)
> at GetXSpace.compare(GetXSpace.java:223)
> at GetXSpace.testDF(GetXSpace.java:403)
> at GetXSpace.main(GetXSpace.java:437)
> at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> at java.base/java.lang.reflect.Method.invoke(Method.java:577)
> at 
> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
> at java.base/java.lang.Thread.run(Thread.java:833) 
> 
> Parsing of df output is incorrect. It skips first symbols after matching of 
> line.
> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L160
> 
> It means that after matching first line:
> 
> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
> 
> 
> It skips first symbols of next line - symbol `D` and then proceeds to match 
> _corrupted_ line:
> 
> : 59672 59672 0 100% /cygdrive/d
> 
> 
> Problems affects only Windows, because only in Windows case first group of 
> matcher is used:
> 
> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L155-L156
> 
> 
> Testing:
> * Windows x64 - always failed before. No errors after fix
> * Linux x64

Marked as reviewed by bpb (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/7170


Re: RFR: 8251466: test/java/io/File/GetXSpace.java fails on Windows with mapped network drives.

2022-01-24 Thread Andrey Turbanov
On Thu, 20 Jan 2022 21:10:39 GMT, Andrey Turbanov  wrote:

> Test `test/java/io/File/GetXSpace.java` always failed on my machine with this 
> output:
> 
> --System.out:(12/489)--
> --- Testing df
> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
> D: 59672 59672 0 100% /cygdrive/d
> 
> 
> SecurityManager = null
> C:/Programs/cygwin64:
>   df total= 299877003264 free = 0 usable = 248988995584
>   getX total= 299877003264 free = 248988995584 usable = 248988995584
> ::
>   df total= 61104128 free = 0 usable = 0
>   getX total= 0 free = 0 usable = 0
> --System.err:(23/1617)--
> java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
> at 
> java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
> at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
> at java.base/java.io.File.toPath(File.java:2396)
> at GetXSpace.compare(GetXSpace.java:223)
> at GetXSpace.testDF(GetXSpace.java:403)
> at GetXSpace.main(GetXSpace.java:437)
> at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> at java.base/java.lang.reflect.Method.invoke(Method.java:577)
> at 
> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
> at java.base/java.lang.Thread.run(Thread.java:833) 
> 
> Parsing of df output is incorrect. It skips first symbols after matching of 
> line.
> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L160
> 
> It means that after matching first line:
> 
> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
> 
> 
> It skips first symbols of next line - symbol `D` and then proceeds to match 
> _corrupted_ line:
> 
> : 59672 59672 0 100% /cygdrive/d
> 
> 
> Problems affects only Windows, because only in Windows case first group of 
> matcher is used:
> 
> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L155-L156
> 
> 
> Testing:
> * Windows x64 - always failed before. No errors after fix
> * Linux x64

@ArnoZeller can you please check if proposed changes fix the test in your 
environment?
@bplb can you please have a look at this pr?

-

PR: https://git.openjdk.java.net/jdk/pull/7170


RFR: 8251466: test/java/io/File/GetXSpace.java fails on Windows with mapped network drives.

2022-01-20 Thread Andrey Turbanov
Test `test/java/io/File/GetXSpace.java` always failed on my machine with this 
output:

--System.out:(12/489)--
--- Testing df
C:/Programs/cygwin64 292848636 49695320 243153316 17% /
D: 59672 59672 0 100% /cygdrive/d


SecurityManager = null
C:/Programs/cygwin64:
  df total= 299877003264 free = 0 usable = 248988995584
  getX total= 299877003264 free = 248988995584 usable = 248988995584
::
  df total= 61104128 free = 0 usable = 0
  getX total= 0 free = 0 usable = 0
--System.err:(23/1617)--
java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
at java.base/java.io.File.toPath(File.java:2396)
at GetXSpace.compare(GetXSpace.java:223)
at GetXSpace.testDF(GetXSpace.java:403)
at GetXSpace.main(GetXSpace.java:437)
at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at 
com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
at java.base/java.lang.Thread.run(Thread.java:833) 

Parsing of df output is incorrect. It skips first symbols after matching of 
line.
https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L160

It means that after matching first line:

C:/Programs/cygwin64 292848636 49695320 243153316 17% /


It skips first symbols of next line - symbol `D` and then proceeds to match 
_corrupted_ line:

: 59672 59672 0 100% /cygdrive/d


Problems affects only Windows, because only in Windows case first group of 
matcher is used:

https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L155-L156


Testing:
* Windows x64 - always failed before. No errors after fix
* Linux x64

-

Commit messages:
 - 8251466: test/java/io/File/GetXSpace.java fails on Windows with mapped 
network drives.

Changes: https://git.openjdk.java.net/jdk/pull/7170/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=7170=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8251466
  Stats: 6 lines in 1 file changed: 0 ins; 1 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7170.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7170/head:pull/7170

PR: https://git.openjdk.java.net/jdk/pull/7170