JDK-8072777 : java/lang/ref/ReferenceEnqueuePending.java: some references aren't queued
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8u60,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-02-09
  • Updated: 2016-02-25
  • Resolved: 2016-02-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b107Fixed
Related Reports
Relates :  
Description
java/lang/ref/ReferenceEnqueuePending.java
----------System.out:(5/269)----------
I must write 999 to prevent compiler optimizations.
The following numbers were not found in the reference queue: 
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38  
40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78  
80 82 84 86 88 90 92 94 96 98 
----------System.err:(14/968)----------
java.lang.RuntimeException: TEST FAILED: only 949 reference objects have been queued out of 999
	at ReferenceEnqueuePending.checkResult(ReferenceEnqueuePending.java:148)
	at ReferenceEnqueuePending.main(ReferenceEnqueuePending.java:103)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:745)

Comments
After looking more carefully, I no longer think this is similar to JDK-8147865 or JDK-8144727. Rather, this is a bug in the test. The test assumes the pending list processor will stay ahead of the test thread, so that the test's polling of the reference queue won't find it empty while there are still references on the internal pending list. That might not always happen though, possibly in part because the test raises the priority of its own thread to better compete with the pending list processor. I'm developing a fix for the test.
31-01-2016

Reopening and reassigning to me; this looks very similar to JDK-8147865 and JDK-8144727.
29-01-2016

Can not reproduce. The test failed only 4 times and last time it happened more than 6 month ago (2015-06-28). Reopen the bug if it happens again.
11-01-2016

ILW=Test fail, mem leak, first time, none=H/MLH=P3 + nightly = P1
16-02-2015