JDK-8164812 : runtime/ReservedStack/ReservedStackTestCompiler.java throws java.lang.LinkageError instead of StackOverflowError
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2016-08-25
  • Updated: 2017-05-04
  • Resolved: 2016-08-26
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Presumably the change the makes j.l.concurrent use VarHandles introduced other failure modes for the infinite recursion this test is trying to do.

java.lang.LinkageError
	at java.lang.invoke.MethodHandleNatives.linkMethodImpl(java.base@9-internal/MethodHandleNatives.java:386)
	at java.lang.invoke.MethodHandleNatives.linkMethod(java.base@9-internal/MethodHandleNatives.java:366)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.compareAndSetState(java.base@9-internal/AbstractQueuedSynchronizer.java:600)
	at java.util.concurrent.locks.ReentrantLock$Sync.nonfairTryAcquire(java.base@9-internal/ReentrantLock.java:130)
	at java.util.concurrent.locks.ReentrantLock$NonfairSync.tryAcquire(java.base@9-internal/ReentrantLock.java:199)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@9-internal/AbstractQueuedSynchronizer.java:1225)
	at java.util.concurrent.locks.ReentrantLock.lock(java.base@9-internal/ReentrantLock.java:267)
	at ReservedStackTest$ReentrantLockTest.lockAndCall(ReservedStackTest.java:168)
	at ReservedStackTest$ReentrantLockTest.lockAndCall(ReservedStackTest.java:169)
	at ReservedStackTest$ReentrantLockTest.lockAndCall(ReservedStackTest.java:169)
	at ReservedStackTest$ReentrantLockTest.lockAndCall(ReservedStackTest.java:169)
	at ReservedStackTest$ReentrantLockTest.lockAndCall(ReservedStackTest.java:169)

Comments
JDK-8164693 covers the spec change.
26-08-2016

The VarHandles code is being modified so that it doesn't wrap Errors (like StackOverflowError) in LinkageErrors. I will close this as a duplicate of JDK-8163553 which I hope will be used to update the runtime behaviour.
26-08-2016