RFR: JDK-8261601: free memory in early return in Java_sun_nio_ch_sctp_SctpChannelImpl_receive0

2021-02-12 Thread Matthias Baesken
There seems to be an early return in 
Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 that misses freeing memory.

Sonar reports :
https://sonarcloud.io/project/issues?id=shipilev_jdk&languages=c&open=AXck8Cl0BBG2CXpcnjFu&resolved=false&severities=BLOCKER&types=BUG

Potential leak of memory pointed to by 'newBuf'
I adjusted  the early return and added freeing memory .


Btw. while  adjusting  Java_sun_nio_ch_sctp_SctpChannelImpl_receive0  , I 
started  to wonder what happens to the allocated memory in  the same file in 
handleSendFailed  (  if ((addressP = malloc(dataLength)) == NULL)   )   in 
early return cases  incl. the CHECK_NULL , is there some deallocation missing 
there too ?

-

Commit messages:
 - JDK-8261601

Changes: https://git.openjdk.java.net/jdk/pull/2540/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2540&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261601
  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2540.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2540/head:pull/2540

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


Re: RFR: JDK-8261601: free memory in early return in Java_sun_nio_ch_sctp_SctpChannelImpl_receive0

2021-02-12 Thread Christoph Langer
On Fri, 12 Feb 2021 08:50:14 GMT, Matthias Baesken  wrote:

> There seems to be an early return in 
> Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 that misses freeing memory.
> 
> Sonar reports :
> https://sonarcloud.io/project/issues?id=shipilev_jdk&languages=c&open=AXck8Cl0BBG2CXpcnjFu&resolved=false&severities=BLOCKER&types=BUG
> 
> Potential leak of memory pointed to by 'newBuf'
> I adjusted  the early return and added freeing memory .
> 
> 
> Btw. while  adjusting  Java_sun_nio_ch_sctp_SctpChannelImpl_receive0  , I 
> started  to wonder what happens to the allocated memory in  the same file in 
> handleSendFailed  (  if ((addressP = malloc(dataLength)) == NULL)   )   in 
> early return cases  incl. the CHECK_NULL , is there some deallocation missing 
> there too ?

LGTM

-

Marked as reviewed by clanger (Reviewer).

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


Re: RFR: JDK-8261601: free memory in early return in Java_sun_nio_ch_sctp_SctpChannelImpl_receive0

2021-02-12 Thread Daniel Fuchs
On Fri, 12 Feb 2021 08:50:14 GMT, Matthias Baesken  wrote:

> There seems to be an early return in 
> Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 that misses freeing memory.
> 
> Sonar reports :
> https://sonarcloud.io/project/issues?id=shipilev_jdk&languages=c&open=AXck8Cl0BBG2CXpcnjFu&resolved=false&severities=BLOCKER&types=BUG
> 
> Potential leak of memory pointed to by 'newBuf'
> I adjusted  the early return and added freeing memory .
> 
> 
> Btw. while  adjusting  Java_sun_nio_ch_sctp_SctpChannelImpl_receive0  , I 
> started  to wonder what happens to the allocated memory in  the same file in 
> handleSendFailed  (  if ((addressP = malloc(dataLength)) == NULL)   )   in 
> early return cases  incl. the CHECK_NULL , is there some deallocation missing 
> there too ?

LGTM

-

Marked as reviewed by dfuchs (Reviewer).

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


Re: RFR: JDK-8261601: free memory in early return in Java_sun_nio_ch_sctp_SctpChannelImpl_receive0

2021-02-12 Thread Daniel Fuchs
On Fri, 12 Feb 2021 08:50:14 GMT, Matthias Baesken  wrote:

> There seems to be an early return in 
> Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 that misses freeing memory.
> 
> Sonar reports :
> https://sonarcloud.io/project/issues?id=shipilev_jdk&languages=c&open=AXck8Cl0BBG2CXpcnjFu&resolved=false&severities=BLOCKER&types=BUG
> 
> Potential leak of memory pointed to by 'newBuf'
> I adjusted  the early return and added freeing memory .
> 
> 
> Btw. while  adjusting  Java_sun_nio_ch_sctp_SctpChannelImpl_receive0  , I 
> started  to wonder what happens to the allocated memory in  the same file in 
> handleSendFailed  (  if ((addressP = malloc(dataLength)) == NULL)   )   in 
> early return cases  incl. the CHECK_NULL , is there some deallocation missing 
> there too ?

@MBaesken did you run the jdk_sctp tests?

-

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


Re: RFR: JDK-8261601: free memory in early return in Java_sun_nio_ch_sctp_SctpChannelImpl_receive0

2021-02-12 Thread Matthias Baesken
On Fri, 12 Feb 2021 08:50:14 GMT, Matthias Baesken  wrote:

> There seems to be an early return in 
> Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 that misses freeing memory.
> 
> Sonar reports :
> https://sonarcloud.io/project/issues?id=shipilev_jdk&languages=c&open=AXck8Cl0BBG2CXpcnjFu&resolved=false&severities=BLOCKER&types=BUG
> 
> Potential leak of memory pointed to by 'newBuf'
> I adjusted  the early return and added freeing memory .
> 
> 
> Btw. while  adjusting  Java_sun_nio_ch_sctp_SctpChannelImpl_receive0  , I 
> started  to wonder what happens to the allocated memory in  the same file in 
> handleSendFailed  (  if ((addressP = malloc(dataLength)) == NULL)   )   in 
> early return cases  incl. the CHECK_NULL , is there some deallocation missing 
> there too ?

> @MBaesken did you run the jdk_sctp tests?

Hi, the com/sun/nio/sctp   jtreg tests passed on linux x86_64. I'll put it into 
our internal build/test queue to see over night what it does on all the 
platforms.

-

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


Re: RFR: JDK-8261601: free memory in early return in Java_sun_nio_ch_sctp_SctpChannelImpl_receive0

2021-02-12 Thread Matthias Baesken
On Fri, 12 Feb 2021 08:50:14 GMT, Matthias Baesken  wrote:

>Btw. while adjusting Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 , I started 
>to wonder what happens to the allocated >memory in the same file in 
>handleSendFailed ( if ((addressP = malloc(dataLength)) == NULL) ) in early 
>return cases incl. the >CHECK_NULL , is there some deallocation missing there 
>too ?

hi, any comments on this ?   See  SctpChannelImpl.c 
[SctpChannelImpl.c 
](https://github.com/openjdk/jdk/blob/master/src/jdk.sctp/unix/native/libsctp/SctpChannelImpl.c#L222)

the malloc there is followed by a few early returns, where is the memory freed 
is these cases ?

-

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


Re: RFR: JDK-8261601: free memory in early return in Java_sun_nio_ch_sctp_SctpChannelImpl_receive0

2021-02-12 Thread Brian Burkhalter
On Fri, 12 Feb 2021 08:50:14 GMT, Matthias Baesken  wrote:

> There seems to be an early return in 
> Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 that misses freeing memory.
> 
> Sonar reports :
> https://sonarcloud.io/project/issues?id=shipilev_jdk&languages=c&open=AXck8Cl0BBG2CXpcnjFu&resolved=false&severities=BLOCKER&types=BUG
> 
> Potential leak of memory pointed to by 'newBuf'
> I adjusted  the early return and added freeing memory .
> 
> 
> Btw. while  adjusting  Java_sun_nio_ch_sctp_SctpChannelImpl_receive0  , I 
> started  to wonder what happens to the allocated memory in  the same file in 
> handleSendFailed  (  if ((addressP = malloc(dataLength)) == NULL)   )   in 
> early return cases  incl. the CHECK_NULL , is there some deallocation missing 
> there too ?

This change looks fine. I don't know about handleSendFailed().

-

Marked as reviewed by bpb (Reviewer).

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


Re: RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v8]

2021-02-12 Thread Andrey Turbanov
On Fri, 12 Feb 2021 21:04:54 GMT, Andrey Turbanov 
 wrote:

>> I rebased my changes onto master. (commit 
>> 837bd8930d0a010110f1318b947c036609d3aa33)
>> and checked tier2 and tier3.
>> What I got:
>> 
>> ==
>> Test summary
>> ==
>>TEST  TOTAL  PASS  FAIL 
>> ERROR   
>> >> jtreg:test/jdk:tier2   3698  3690 6   
>>   2 <<
>> >> jtreg:test/langtools:tier2   1211 1   
>>   0 <<
>>jtreg:test/jaxp:tier2   450   450 0   
>>   0   
>> ==
>> TEST FAILURE
>> 
>> 
>> 
>> 
>> ==
>> Test summary
>> ==
>>TEST  TOTAL  PASS  FAIL 
>> ERROR   
>> >> jtreg:test/jdk:tier3   1190  1188 2   
>>   0 <<
>>jtreg:test/langtools:tier30 0 0   
>>   0   
>>jtreg:test/jaxp:tier3 0 0 0   
>>   0   
>> ==
>> TEST FAILURE
>> 
>> 
>> Failed tests:
>> 
>>  tier2:
>>  java/io/File/GetXSpace.java 
>> Failed. Execution failed: `main' threw 
>> exception: java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
>>  java/net/MulticastSocket/MulticastAddresses.java
>> Failed. Execution failed: `main' threw 
>> exception: java.lang.Exception: 1 test(s) failed - see log file.
>>  java/net/MulticastSocket/SetLoopbackMode.java   
>> Failed. Execution failed: `main' threw 
>> exception: java.net.NoRouteToHostException: No route to host: no further 
>> information
>>  java/nio/file/Files/CopyAndMove.java
>> Failed. Execution failed: `main' threw 
>> exception: java.lang.RuntimeException: AtomicMoveNotSupportedException 
>> expected
>>  java/security/AccessController/DoPrivAccompliceTest.java
>> Failed. Execution failed: `main' threw 
>> exception: java.lang.RuntimeException: 'user' found in stderr
>>  tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java
>> Failed. Execution failed: `main' threw 
>> exception: jdk.jpackage.test.Functional$ExceptionBox: 
>> java.lang.RuntimeException: 2 FAILED TESTS
>>  
>>  sun/security/tools/jarsigner/TimestampCheck.java
>> Error. Agent error: java.lang.Exception: Agent 
>> 72 timed out with a timeout of 2400 seconds; check console log for any 
>> additional details
>>  sun/security/tools/keytool/DefaultOptions.java  
>> Error. Agent error: java.lang.Exception: Agent 
>> 77 timed out with a timeout of 480 seconds; check console log for any 
>> additional details
>>  
>>  jdk/jshell/ToolBasicTest.java  Failed. 
>> Execution failed: `main' threw exception: java.lang.Exception: failures: 1
>>  
>>  tier3:
>>  sanity/client/SwingSet/src/SwingSet2DemoTest.java   
>>Failed. Execution failed: `main' 
>> threw exception: java.lang.Exception: failures: 1
>>  sanity/client/SwingSet/src/ColorChooserDemoTest.java
>>Failed. Execution failed: `main' 
>> threw exception: java.lang.Exception: failures: 1
>
> Then I tried to run tests separately:
> ## java/io/File/GetXSpace.java
> 
> 
> make test TEST="jtreg:test/jdk/java/io/File/GetXSpace.java"
> 
> STDERR:
> 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:230)
> at java.base/java.io.File.toPath(File.java:2316)
> at GetXSpace.compare(GetXSpace.java:219)
> at GetXSpace.testDF(GetXSpace.java:394)
> at GetXSpace.main(GetXSpace.java:428)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
> at 
> java

Re: RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v8]

2021-02-12 Thread Andrey Turbanov
On Fri, 12 Feb 2021 21:03:04 GMT, Andrey Turbanov 
 wrote:

>> I've updated the issue summary to better reflect the changes, the PR summary 
>> should be renamed accordingly. 
>> As mentioned earlier, have you run the tests for the affected areas? Here's 
>> some information on how to do that: 
>> http://openjdk.java.net/guide/#testing-the-jdk
>
> I rebased my changes onto master. (commit 
> 837bd8930d0a010110f1318b947c036609d3aa33)
> and checked tier2 and tier3.
> What I got:
> 
> ==
> Test summary
> ==
>TEST  TOTAL  PASS  FAIL 
> ERROR   
> >> jtreg:test/jdk:tier2   3698  3690 6
>  2 <<
> >> jtreg:test/langtools:tier2   1211 1
>  0 <<
>jtreg:test/jaxp:tier2   450   450 0
>  0   
> ==
> TEST FAILURE
> 
> 
> 
> 
> ==
> Test summary
> ==
>TEST  TOTAL  PASS  FAIL 
> ERROR   
> >> jtreg:test/jdk:tier3   1190  1188 2
>  0 <<
>jtreg:test/langtools:tier30 0 0
>  0   
>jtreg:test/jaxp:tier3 0 0 0
>  0   
> ==
> TEST FAILURE
> 
> 
> Failed tests:
> 
>  tier2:
>  java/io/File/GetXSpace.java  
>Failed. Execution failed: `main' threw exception: 
> java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
>  java/net/MulticastSocket/MulticastAddresses.java 
>Failed. Execution failed: `main' threw exception: 
> java.lang.Exception: 1 test(s) failed - see log file.
>  java/net/MulticastSocket/SetLoopbackMode.java
>Failed. Execution failed: `main' threw exception: 
> java.net.NoRouteToHostException: No route to host: no further information
>  java/nio/file/Files/CopyAndMove.java 
>Failed. Execution failed: `main' threw exception: 
> java.lang.RuntimeException: AtomicMoveNotSupportedException expected
>  java/security/AccessController/DoPrivAccompliceTest.java 
>Failed. Execution failed: `main' threw exception: 
> java.lang.RuntimeException: 'user' found in stderr
>  tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java 
>Failed. Execution failed: `main' threw exception: 
> jdk.jpackage.test.Functional$ExceptionBox: java.lang.RuntimeException: 2 
> FAILED TESTS
>  
>  sun/security/tools/jarsigner/TimestampCheck.java 
>Error. Agent error: java.lang.Exception: Agent 72 
> timed out with a timeout of 2400 seconds; check console log for any 
> additional details
>  sun/security/tools/keytool/DefaultOptions.java   
>Error. Agent error: java.lang.Exception: Agent 77 
> timed out with a timeout of 480 seconds; check console log for any additional 
> details
>  
>  jdk/jshell/ToolBasicTest.java  Failed. 
> Execution failed: `main' threw exception: java.lang.Exception: failures: 1
>  
>  tier3:
>  sanity/client/SwingSet/src/SwingSet2DemoTest.java
>   Failed. Execution failed: `main' 
> threw exception: java.lang.Exception: failures: 1
>  sanity/client/SwingSet/src/ColorChooserDemoTest.java 
>   Failed. Execution failed: `main' 
> threw exception: java.lang.Exception: failures: 1

Then I tried to run tests separately:
## java/io/File/GetXSpace.java


make test TEST="jtreg:test/jdk/java/io/File/GetXSpace.java"

STDERR:
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:230)
at java.base/java.io.File.toPath(File.java:2316)
at GetXSpace.compare(GetXSpace.java:219)
at GetXSpace.testDF(GetXSpace.java:394)
at GetXSpace.main(GetXSpace.java:428)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Na

Re: RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v8]

2021-02-12 Thread Andrey Turbanov
On Mon, 8 Feb 2021 16:39:55 GMT, Julia Boes  wrote:

>> The other security-related code changes look good to me.
>
> I've updated the issue summary to better reflect the changes, the PR summary 
> should be renamed accordingly. 
> As mentioned earlier, have you run the tests for the affected areas? Here's 
> some information on how to do that: 
> http://openjdk.java.net/guide/#testing-the-jdk

I rebased my changes onto master. (commit 
837bd8930d0a010110f1318b947c036609d3aa33)
and checked tier2 and tier3.
What I got:

==
Test summary
==
   TEST  TOTAL  PASS  FAIL 
ERROR   
>> jtreg:test/jdk:tier2   3698  3690 6 
2 <<
>> jtreg:test/langtools:tier2   1211 1 
0 <<
   jtreg:test/jaxp:tier2   450   450 0 
0   
==
TEST FAILURE




==
Test summary
==
   TEST  TOTAL  PASS  FAIL 
ERROR   
>> jtreg:test/jdk:tier3   1190  1188 2 
0 <<
   jtreg:test/langtools:tier30 0 0 
0   
   jtreg:test/jaxp:tier3 0 0 0 
0   
==
TEST FAILURE


Failed tests:

 tier2:
 java/io/File/GetXSpace.java
 Failed. Execution failed: `main' threw exception: 
java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
 java/net/MulticastSocket/MulticastAddresses.java   
 Failed. Execution failed: `main' threw exception: 
java.lang.Exception: 1 test(s) failed - see log file.
 java/net/MulticastSocket/SetLoopbackMode.java  
 Failed. Execution failed: `main' threw exception: 
java.net.NoRouteToHostException: No route to host: no further information
 java/nio/file/Files/CopyAndMove.java   
 Failed. Execution failed: `main' threw exception: 
java.lang.RuntimeException: AtomicMoveNotSupportedException expected
 java/security/AccessController/DoPrivAccompliceTest.java   
 Failed. Execution failed: `main' threw exception: 
java.lang.RuntimeException: 'user' found in stderr
 tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java   
 Failed. Execution failed: `main' threw exception: 
jdk.jpackage.test.Functional$ExceptionBox: java.lang.RuntimeException: 2 FAILED 
TESTS
 
 sun/security/tools/jarsigner/TimestampCheck.java   
 Error. Agent error: java.lang.Exception: Agent 72 
timed out with a timeout of 2400 seconds; check console log for any additional 
details
 sun/security/tools/keytool/DefaultOptions.java 
 Error. Agent error: java.lang.Exception: Agent 77 
timed out with a timeout of 480 seconds; check console log for any additional 
details
 
 jdk/jshell/ToolBasicTest.java  Failed. 
Execution failed: `main' threw exception: java.lang.Exception: failures: 1
 
 tier3:
 sanity/client/SwingSet/src/SwingSet2DemoTest.java  
Failed. Execution failed: `main' threw 
exception: java.lang.Exception: failures: 1
 sanity/client/SwingSet/src/ColorChooserDemoTest.java   
Failed. Execution failed: `main' threw 
exception: java.lang.Exception: failures: 1

-

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


Re: RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v8]

2021-02-12 Thread Andrey Turbanov
On Fri, 12 Feb 2021 21:06:24 GMT, Andrey Turbanov 
 wrote:

>> Then I tried to run tests separately:
>> ## java/io/File/GetXSpace.java
>> 
>> 
>> make test TEST="jtreg:test/jdk/java/io/File/GetXSpace.java"
>> 
>> STDERR:
>> 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:230)
>> at java.base/java.io.File.toPath(File.java:2316)
>> at GetXSpace.compare(GetXSpace.java:219)
>> at GetXSpace.testDF(GetXSpace.java:394)
>> at GetXSpace.main(GetXSpace.java:428)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
>> Method)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
>> at 
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>> at 
>> com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
>> at java.base/java.lang.Thread.run(Thread.java:831)
>> 
>> JavaTest Message: Test threw exception: 
>> java.nio.file.InvalidPathException
>> JavaTest Message: shutting down test
>> 
>> STDOUT:
>> --- Testing df
>> C:/Programs/cygwin64   350809332  172573816 178235516  50% /
>> D:3702215676 2812548988 88988  76% 
>> /cygdrive/d
>> E:3906885628 3544182676 362702952  91% 
>> /cygdrive/e
>> F: 250057724  240917056   9140668  97% 
>> /cygdrive/f
>> 
>> 
>> SecurityManager = null
>> C:/Programs/cygwin64:
>>   df   total= 359228755968 free =0 usable = 182513168384
>>   getX total= 359228755968 free = 182513168384 usable = 182513168384
>> ::
>>   df   total= 3791068852224 free =0 usable = 911018688512
>>   getX total=0 free =0 usable =0
>> 
>> TEST RESULT: Failed. Execution failed: `main' threw exception: 
>> java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
>> --
>> 
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8251466 looks like there is already 
>> known bug for similar cygwin output.
>
> ## java/net/MulticastSocket/MulticastAddresses.java
> 
> make test 
> TEST="jtreg:test/jdk/java/net/MulticastSocket/MulticastAddresses.java"
> 
> STDOUT:
> Test: /224.80.80.80  ni: name:eth1 (PANGP Virtual Ethernet Adapter)
> joinGroup(InetAddress) Passed.
> joinGroup(InetAddress,NetworkInterface) Passed.
> Test: /129.1.1.1
> joinGroup(InetAddress)
> Passed: Not a multicast address
> Test: /ff01:0:0:0:0:0:0:1  ni: name:eth10 (VirtualBox Host-Only Ethernet 
> Adapter)
> joinGroup(InetAddress) Failed: No route to host: no further 
> information
> Test: /ff02:0:0:0:0:0:0:1234  ni: name:eth10 (VirtualBox Host-Only 
> Ethernet Adapter)
> joinGroup(InetAddress) Passed.
> joinGroup(InetAddress,NetworkInterface) Passed.
> Test: /ff05:0:0:0:0:0:0:a  ni: name:eth10 (VirtualBox Host-Only Ethernet 
> Adapter)
> joinGroup(InetAddress) Passed.
> joinGroup(InetAddress,NetworkInterface) Passed.
> Test: /ff0e:0:0:0:0:0:1234:a  ni: name:eth10 (VirtualBox Host-Only 
> Ethernet Adapter)
> joinGroup(InetAddress) Passed.
> joinGroup(InetAddress,NetworkInterface) Passed.
> Test: /0:0:0:0:0:0:0:1
> joinGroup(InetAddress)
> Passed: Not a multicast address
> Test: /0:0:0:0:0:0:8101:101
> joinGroup(InetAddress)
> Passed: Not a multicast address
> Test: /fe80:0:0:0:a00:20ff:fee5:bc02
> joinGroup(InetAddress)
> Passed: Not a multicast address
> STDERR:
> java.lang.Exception: 1 test(s) failed - see log file.
> at MulticastAddresses.runTest(MulticastAddresses.java:93)
> at MulticastAddresses.main(MulticastAddresses.java:138)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
> at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java

Re: RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v8]

2021-02-12 Thread Andrey Turbanov
On Fri, 12 Feb 2021 21:12:14 GMT, Andrey Turbanov 
 wrote:

>> ## java/net/MulticastSocket/MulticastAddresses.java
>> 
>> make test 
>> TEST="jtreg:test/jdk/java/net/MulticastSocket/MulticastAddresses.java"
>> 
>> STDOUT:
>> Test: /224.80.80.80  ni: name:eth1 (PANGP Virtual Ethernet Adapter)
>> joinGroup(InetAddress) Passed.
>> joinGroup(InetAddress,NetworkInterface) Passed.
>> Test: /129.1.1.1
>> joinGroup(InetAddress)
>> Passed: Not a multicast address
>> Test: /ff01:0:0:0:0:0:0:1  ni: name:eth10 (VirtualBox Host-Only Ethernet 
>> Adapter)
>> joinGroup(InetAddress) Failed: No route to host: no further 
>> information
>> Test: /ff02:0:0:0:0:0:0:1234  ni: name:eth10 (VirtualBox Host-Only 
>> Ethernet Adapter)
>> joinGroup(InetAddress) Passed.
>> joinGroup(InetAddress,NetworkInterface) Passed.
>> Test: /ff05:0:0:0:0:0:0:a  ni: name:eth10 (VirtualBox Host-Only Ethernet 
>> Adapter)
>> joinGroup(InetAddress) Passed.
>> joinGroup(InetAddress,NetworkInterface) Passed.
>> Test: /ff0e:0:0:0:0:0:1234:a  ni: name:eth10 (VirtualBox Host-Only 
>> Ethernet Adapter)
>> joinGroup(InetAddress) Passed.
>> joinGroup(InetAddress,NetworkInterface) Passed.
>> Test: /0:0:0:0:0:0:0:1
>> joinGroup(InetAddress)
>> Passed: Not a multicast address
>> Test: /0:0:0:0:0:0:8101:101
>> joinGroup(InetAddress)
>> Passed: Not a multicast address
>> Test: /fe80:0:0:0:a00:20ff:fee5:bc02
>> joinGroup(InetAddress)
>> Passed: Not a multicast address
>> STDERR:
>> java.lang.Exception: 1 test(s) failed - see log file.
>> at MulticastAddresses.runTest(MulticastAddresses.java:93)
>> at MulticastAddresses.main(MulticastAddresses.java:138)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
>> Method)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
>> at 
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>> at 
>> com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
>> at java.base/java.lang.Thread.run(Thread.java:831)
>> 
>> JavaTest Message: Test threw exception: java.lang.Exception
>> JavaTest Message: shutting down test
>> 
>> 
>> TEST RESULT: Failed. Execution failed: `main' threw exception: 
>> java.lang.Exception: 1 test(s) failed - see log file.
>> 
>> 
>> I connected debbuger and got this stack trace:
>> 
>> java.net.NoRouteToHostException: No route to host: no further information
>> at java.base/sun.nio.ch.Net.joinOrDrop6(Native Method)
>> at java.base/sun.nio.ch.Net.join6(Net.java:734)
>> at 
>> java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1515)
>> at 
>> java.base/sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:1551)
>> at 
>> java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:532)
>> at 
>> java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:479)
>> at 
>> java.base/java.net.MulticastSocket.joinGroup(MulticastSocket.java:318)
>> at MulticastAddresses.runTest(MulticastAddresses.java:56)
>> at MulticastAddresses.main(MulticastAddresses.java:138)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
>> Method)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
>> at 
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>> at 
>> com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
>> at java.base/java.lang.Thread.run(Thread.java:831)
>> 
>> Not sure what actual cause. Will investigate further.
>
> ## java/net/MulticastSocket/SetLoopbackMode.java
> 
> make test 
> TEST="jtreg:test/jdk/java/net/MulticastSocket/SetLoopbackMode.java"
> 
> 
> STDOUT:
> IPv6 can be used
> Default network interface: null
> 
> Test will use multicast group: /ff01:0:0:0:0:0:0:1
> NetworkInterface.getByInetAddress(grp): null
> STDERR:
> java.net.NoRouteToHostException: No route to host: no further information
> at java.base/sun.nio.ch.Net.joinOrDrop6(Native Method)
> at java.base/sun.nio.ch.Net.join6(Net.java:734)
> at 
> java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1515)
> at 
> java.base/sun.nio.ch.DatagramC

Re: RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v8]

2021-02-12 Thread Andrey Turbanov
On Fri, 12 Feb 2021 21:32:04 GMT, Andrey Turbanov 
 wrote:

>> ## java/net/MulticastSocket/SetLoopbackMode.java
>> 
>> make test 
>> TEST="jtreg:test/jdk/java/net/MulticastSocket/SetLoopbackMode.java"
>> 
>> 
>> STDOUT:
>> IPv6 can be used
>> Default network interface: null
>> 
>> Test will use multicast group: /ff01:0:0:0:0:0:0:1
>> NetworkInterface.getByInetAddress(grp): null
>> STDERR:
>> java.net.NoRouteToHostException: No route to host: no further information
>> at java.base/sun.nio.ch.Net.joinOrDrop6(Native Method)
>> at java.base/sun.nio.ch.Net.join6(Net.java:734)
>> at 
>> java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1515)
>> at 
>> java.base/sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:1551)
>> at 
>> java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:532)
>> at 
>> java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:479)
>> at 
>> java.base/java.net.MulticastSocket.joinGroup(MulticastSocket.java:318)
>> at SetLoopbackMode.main(SetLoopbackMode.java:132)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
>> Method)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
>> at 
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>> at 
>> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
>> at java.base/java.lang.Thread.run(Thread.java:831)
>> 
>> JavaTest Message: Test threw exception: java.net.NoRouteToHostException: 
>> No route to host: no further information
>> JavaTest Message: shutting down test
>> 
>> STATUS:Failed.`main' threw exception: java.net.NoRouteToHostException: 
>> No route to host: no further information
>> 
>> Cause looks similar to `MulticastAddresses`: virtualbox network interface:
>> Test: /ff01:0:0:0:0:0:0:1  ni: name:eth10 (VirtualBox Host-Only Ethernet 
>> Adapter)
>> joinGroup(InetAddress) Failed: No route to host: no further information
>> Will investigate futher.
>
> ## java/nio/file/Files/CopyAndMove.java
> 
> make test TEST="jtreg:java/nio/file/Files/CopyAndMove.java"
> 
> STDOUT:
> Seed from RandomFactory = 704532001916725417L
> STDERR:
> dir1: 
> f:\projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_nio_file_Files_CopyAndMove_java\tmp\name9678927043623070601
>  (NTFS)
> dir2: .\name1900089232270637553 (NTFS)
> java.lang.RuntimeException: AtomicMoveNotSupportedException expected
> at CopyAndMove.testMove(CopyAndMove.java:369)
> at CopyAndMove.main(CopyAndMove.java:74)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
> at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at 
> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
> at java.base/java.lang.Thread.run(Thread.java:831)
> 
> JavaTest Message: Test threw exception: java.lang.RuntimeException: 
> AtomicMoveNotSupportedException expected
> JavaTest Message: shutting down test
> 
> STATUS:Failed.`main' threw exception: java.lang.RuntimeException: 
> AtomicMoveNotSupportedException expected
> 
> Checked in debugger:
> 
> Files.getFileStore(dir1) = {WindowsFileStore@1211} "ssd (f:)"
> Files.getFileStore(dir2) = {WindowsFileStore@1213} "ssd (F:)"
> sameDevice = false
> 
> https://bugs.openjdk.java.net/browse/JDK-8219644 looks like there is already 
> known bug this test.

## java/security/AccessController/DoPrivAccompliceTest.java

make test 
TEST="jtreg:java/security/AccessController/DoPrivAccompliceTest.java"

STDOUT:
Adding DoPrivAccomplice.class to 
F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar

Created jar file 
F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar
Adding DoPrivTest.class to 
F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivTest.jar

Created jar file 
F

Re: RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v8]

2021-02-12 Thread Andrey Turbanov
On Fri, 12 Feb 2021 21:53:13 GMT, Andrey Turbanov 
 wrote:

>> ## java/nio/file/Files/CopyAndMove.java
>> 
>> make test TEST="jtreg:java/nio/file/Files/CopyAndMove.java"
>> 
>> STDOUT:
>> Seed from RandomFactory = 704532001916725417L
>> STDERR:
>> dir1: 
>> f:\projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_nio_file_Files_CopyAndMove_java\tmp\name9678927043623070601
>>  (NTFS)
>> dir2: .\name1900089232270637553 (NTFS)
>> java.lang.RuntimeException: AtomicMoveNotSupportedException expected
>> at CopyAndMove.testMove(CopyAndMove.java:369)
>> at CopyAndMove.main(CopyAndMove.java:74)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
>> Method)
>> at 
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
>> at 
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>> at 
>> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
>> at java.base/java.lang.Thread.run(Thread.java:831)
>> 
>> JavaTest Message: Test threw exception: java.lang.RuntimeException: 
>> AtomicMoveNotSupportedException expected
>> JavaTest Message: shutting down test
>> 
>> STATUS:Failed.`main' threw exception: java.lang.RuntimeException: 
>> AtomicMoveNotSupportedException expected
>> 
>> Checked in debugger:
>> 
>> Files.getFileStore(dir1) = {WindowsFileStore@1211} "ssd (f:)"
>> Files.getFileStore(dir2) = {WindowsFileStore@1213} "ssd (F:)"
>> sameDevice = false
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8219644 looks like there is already 
>> known bug this test.
>
> ## java/security/AccessController/DoPrivAccompliceTest.java
> 
> make test 
> TEST="jtreg:java/security/AccessController/DoPrivAccompliceTest.java"
> 
> STDOUT:
> Adding DoPrivAccomplice.class to 
> F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar
> 
> Created jar file 
> F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar
> Adding DoPrivTest.class to 
> F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivTest.jar
> 
> Created jar file 
> F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivTest.jar
> Created policy for 
> F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar
> Command line: 
> [f:\projects\official_openjdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe
>  -cp 
> F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\classes\0\java\security\AccessController\DoPrivAccompliceTest.d;F:\Projects\official_openjdk\test\jdk\java\security\AccessController;F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\classes\0\test\lib;F:\Projects\official_openjdk\test\lib;C:\Programs\jtreg-4.2.0-tip\jtreg\lib\javatest.jar;C:\Programs\jtreg-4.2.0-tip\jtreg\lib\jtreg.jar
>  -Xmx512m -XX:MaxRAMPercentage=6 
> -Djava.io.tmpdir=f:\projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\tmp
>  -ea -esa -Djava.security.manager 
> -Djava.security.policy=F:\Projects\official_openjdk\build\w
 
indows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\java.policy
 -classpath 
F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar;F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivTest.jar
 DoPrivTest ]
> [2021-02-12T21:42:29.297091800Z] Gathering output for process 12712
> [2021-02-12T21:42:29.544092Z] Waiting for completion for process 12712
> [2021-02-12T21:42:29.544092Z] Waiting for completion finished for process 
> 12712
> Output and diagnostic info for process 12712 was saved into 
> 'pid-12712-output.log'