JDK-8175287 : tools/launcher/TooSmallStackSize.java fails with StackOverflowError on linux-arm64
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2017-02-21
  • Updated: 2017-03-18
  • Resolved: 2017-03-18
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 10
10Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Test failed in JDK9 b151, 154 and b155 with product binaries.
Tests was not executed with product binaries earlier on linux-arm64.
See log:
----------configuration:(0/0)----------
----------System.out:(9/344)----------
PASSED: got expected error message with stack size of 16k
PASSED: got expected error message with stack size of 32k
Test output:
*** exitValue = 1
Error occurred during initialization of VM
java.lang.StackOverflowError
	at java.lang.Object.<clinit>(java.base/Object.java:43)

FAILED: VM failed to launch with minimum allowed stack size of 256k
----------System.err:(14/852)----------
java.lang.RuntimeException: test fails
	at TooSmallStackSize.checkMinStackAllowed(TooSmallStackSize.java:141)
	at TooSmallStackSize.main(TooSmallStackSize.java:167)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:543)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.base/java.lang.Thread.run(Thread.java:844)

JavaTest Message: Test threw exception: java.lang.RuntimeException: test fails
JavaTest Message: shutting down test

Comments
I'm closing this as a dup of JDK-8175342. Although JDK-8175342 asserts due to no available stack and this CR describes a StackOverflowError, this CR only reproduced with product builds. An SOE is what I would expect in this case. Note that it also only occurred on the arm64 Thunder devices, just like JDK-8175342.
18-03-2017

JDK-8173474 only applies to the open aarch64 port, not the oracle contributed arm64 port. Likely JDK-8170655 introduced the problem.
07-03-2017

There were a couple of recent fixes that tweaked these sizes on ARM64: JDK-8170655: [posix] Fix minimum stack size computations $ hg diff -r 548cb3b7b713 -r c7a256349729 src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp diff -r 548cb3b7b713 -r c7a256349729 src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp --- a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp Tue Nov 08 16:30:36 2016 +0100 +++ b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp Mon Dec 19 15:48:57 2016 -0800 @@ -473,8 +473,10 @@ //////////////////////////////////////////////////////////////////////////////// // thread stack -size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K; -size_t os::Posix::_java_thread_min_stack_allowed = 64 * K; +// Minimum usable stack sizes required to get to user code. Space for +// HotSpot guard pages is added later. +size_t os::Posix::_compiler_thread_min_stack_allowed = 32 * K; +size_t os::Posix::_java_thread_min_stack_allowed = 32 * K; size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K; // return default stack size for thr_type JDK-8173474: AArch64: fix reported -Xss minimum $ hg diff -r 2503995d745e -r f3b3d77a1751 src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp diff -r 2503995d745e -r f3b3d77a1751 src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp --- a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp Thu Jan 12 16:27:40 2017 +0000 +++ b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp Fri Jan 27 07:56:13 2017 -0500 <snip> @@ -534,9 +475,9 @@ // Minimum usable stack sizes required to get to user code. Space for // HotSpot guard pages is added later. -size_t os::Posix::_compiler_thread_min_stack_allowed = 32 * K; -size_t os::Posix::_java_thread_min_stack_allowed = 32 * K; -size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K; +size_t os::Posix::_compiler_thread_min_stack_allowed = 72 * K; +size_t os::Posix::_java_thread_min_stack_allowed = 72 * K; +size_t os::Posix::_vm_internal_thread_min_stack_allowed = 72 * K; // return default stack size for thr_type size_t os::Posix::default_stack_size(os::ThreadType thr_type) { Update: Since the most recent of these fixes, JDK-8173474, is listed as fixed in JDK9-B155 and this test still fails there, it is likely that these sizes need to be tweaked for product builds.
22-02-2017

Need to verify minimum stack sizes on arm64 Linux, and what test expects.
21-02-2017