JDK-8098550 : Test java/nio/Buffer/LimitDirectMemory.sh fails for JDK 6 security merge PIT build
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2015-06-15
  • Updated: 2017-05-25
  • Resolved: 2017-05-25
Related Reports
Relates :  
Description
Test name(s):java/nio/Buffer/LimitDirectMemory.sh

JDK tested: JDK 6 security merge PIT build(http://spbef18.ru.oracle.com:9501/stt/jdk/6u101/secmeg/20150603/), JDK 6u101b14 , 9b65
OS tested: Linux , Windows 
Reproducible: Always 
Is it platform specific? No 
The is failure reproduced: always 
             
General description: 

----------System.out:(32/1810)----------
Testing: -XX:MaxDirectMemorySize=10 -cp K:/tmp/srini/WinTask3/workDir/classes/java/nio/Buffer LimitDirectMemory true 10 1
java.lang.OutOfMemoryError: Direct buffer memory
	at java.nio.Bits.reserveMemory(Bits.java:632)
	at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:97)
	at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
	at LimitDirectMemory.main(LimitDirectMemory.java:31)
OK - Error thrown as expected 
--- passed as expected
Testing: -XX:MaxDirectMemorySize=1k -cp K:/tmp/srini/WinTask3/workDir/classes/java/nio/Buffer LimitDirectMemory true 1k 100
java.lang.OutOfMemoryError: Direct buffer memory
	at java.nio.Bits.reserveMemory(Bits.java:632)
	at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:97)
	at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
	at LimitDirectMemory.main(LimitDirectMemory.java:31)
OK - Error thrown as expected 
--- passed as expected
Testing: -XX:MaxDirectMemorySize=10m -cp K:/tmp/srini/WinTask3/workDir/classes/java/nio/Buffer LimitDirectMemory true 10m 10m
java.lang.OutOfMemoryError: Direct buffer memory
	at java.nio.Bits.reserveMemory(Bits.java:632)
	at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:97)
	at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
	at LimitDirectMemory.main(LimitDirectMemory.java:31)
OK - Error thrown as expected 
--- passed as expected
Testing: -XX:MaxDirectMemorySize=65M -cp K:/tmp/srini/WinTask3/workDir/classes/java/nio/Buffer LimitDirectMemory false 64M 65M
OK - Error not thrown
--- passed as expected
Testing: -cp K:/tmp/srini/WinTask3/workDir/classes/java/nio/Buffer LimitDirectMemory false 10 1
OK - Error not thrown
--- passed as expected
Testing: -cp K:/tmp/srini/WinTask3/workDir/classes/java/nio/Buffer LimitDirectMemory false 0 DEFAULT
--- failed

----------System.err:(8/458)----------
Exception in thread "main" java.lang.IllegalArgumentException
	at java.nio.Buffer.<init>(Buffer.java:172)
	at java.nio.ByteBuffer.<init>(ByteBuffer.java:259)
	at java.nio.ByteBuffer.<init>(ByteBuffer.java:267)
	at java.nio.MappedByteBuffer.<init>(MappedByteBuffer.java:64)
	at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:96)
	at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
	at LimitDirectMemory.main(LimitDirectMemory.java:25)

result: Failed. Execution failed: exit code 1


test result: Failed. Execution failed: exit code 1
Comments
Closing as this doesn't appear to be reproducible on the latest builds as per last comment.
25-05-2017

Passes as expected on latest build. The PIT build should only have been tested against the PIT repo tests.
19-06-2015

Hi Govindan , Thanks for the points mentioned by you . The machines which I used are Windows 7 ( 64 bit JDK) and OEL 6.4 (64 bit JDK). I am not very sure if its duplicate of JDK-7192872 and as this is windows specific bug , but I also saw it failing on some Linux machines as well . -Pooja
17-06-2015

Some points; This PIT build is special direct branch of 6u101b00. So this PIT (secmerge) build may not have direct association with 6u101b14 , 9b65 issue what you reported here. can you narrow down this issue in terms of configuration? is this not same as JDK-7192872 (ByteBuffer)? If so, this could be a duplicate bug.
16-06-2015

Test passes in JDK 9b65
15-06-2015

Is it a test bug?
15-06-2015

Test fails with JDK 6u101b14 and JDK 6 PIT build in Windows In linux the test fails on some machine with and passes in other
15-06-2015

machine to reproduce :- spb23324.ru.oracle.com, spb23269.ru.oracle.com RULE java/nio/Buffer/LimitDirectMemory.sh Exception java.lang.IllegalArgumentException RULE java/nio/Buffer/LimitDirectMemory.sh Exception java.lang.OutOfMemoryError: Direct buffer memory RULE java/nio/Buffer/LimitDirectMemory.sh ExitCode 1 http://scaaa008.us.oracle.com:9502/runs/00960/960498.ManualSubmit/960498.ManualSubmit-1/workDir/java/nio/Buffer/LimitDirectMemory.jtr
15-06-2015