JDK-6704367 : Stack sizes error with 1.5.0_14
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 5.0u14
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2008-05-19
  • Updated: 2012-10-08
  • Resolved: 2008-09-22
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.
Other Other
5.0u16-rev b10Fixed 5.0u17Fixed
Related Reports
Relates :  
Relates :  
Description
Stack size error thrown with 1.5.0_14. Customer experiences the problem after moving to
1.5.0_14

Comments
WORK AROUND unset unused environmental variables.
25-07-2008

EVALUATION when process java launched, system forks a process and put user environment variables on the stack. The size of the stack used depends on the size of environment variables. In the failure case, the size of stack used for user environmental variables exceeds 1 page (8K). The stack size is set to stack limit, for main thread, after this used page(s) add to specified stack size, the total size is bigger than stack limit. One workaround is reduce size of environmental variables. Fix give a warning of "main thread will have %dK less stack" instead of exit.
25-07-2008

EVALUATION The current stack offset which is used to align down stack size to multiple page size is different between success/failure cases: In success case, it is less than 8K and in failed case, it is over 8K. The later led one more page size added to stack size. Since only a few solaris 9 sparc machines can reproduce so there could be libthread difference since the stack offset change over 1 page size for same example code. With 6316197, a separate thread created to launch JVM so -Xss<size> or -XX:ThreadStackSize=<size> will not be applied to main thread. For java thread, that means the failed code which should be exclusively for main thread will not be called and this problem is solved.
22-07-2008

EVALUATION Now, the problem figured out: 1) this problem cannot be produced with 6 2) reproduced with 5.0 the current verison (all versions defacto). In 6, when thr_main() called in os::initialize_thread, it returns 0. in 5, it returns 1. The problem is if the current stack offset is bigger than 1 page (8192 bytes) then call: page_align_size_down(current_stack_offset) will return 1 page size (8K), so next stack_size += page_align_size_down(current_stack_offset) will generate a size which is 1 page size bigger than the one speicified with -Xss8M. It will fail definitely. In 6, thr_main return false, so it never triggers this part. The better solution is that we don't add the current offset to the stack size, just align the specified stack size with page size.
21-07-2008