JDK-4864683 : default CompilerThreadStackSize computation too small in 64bit sparc VM
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2003-05-15
  • Updated: 2004-04-07
  • Resolved: 2003-06-05
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
1.4.2_05 05Fixed
Related Reports
Relates :  
Description
Name: cl74495			Date: 05/15/2003


In a 64 bit VM built from 1.4.1.02 sources, I am running out of thread
stack in PhaseCFG::set_pinned , with a recursion depth of about 2800

In the 1.4.1.02 hotspot sources, in os_solaris.cpp there is this code

    768 #ifdef COMPILER2
    769   // Compiler2 requires a large stack size to handle recursive routines.
    770   else if (thr_type == compiler_thread) {
    771     // stack size in units of Kbytes; 2M total needed as default.
    772     int default_size = (CompilerThreadStackSize > 0) ? CompilerThreadStackSize : 2 * K;
    773     stack_size = MAX2((size_t)(default_size * K), os::Solaris::min_stack_allowed);
    774   }
    775 #endif


I think the default_size computation
needs adjustment for 64 bit VMs, if you intend for a 64 bit compiler2 to
be able to have as many levels of recursion as a 32 bit compiler2 .

Perhaps something like this:
     
#ifdef _LP64
     int default_size = (CompilerThreadStackSize > 0) ? CompilerThreadStackSize : 4 * K;
#else
     int default_size = (CompilerThreadStackSize > 0) ? CompilerThreadStackSize : 2 * K;
endif

The 1.4.2 beta 22 sources appear to have the same code in this area and
would need the same fix.
(Review ID: 185729) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.2_05 generic tiger FIXED IN: 1.4.2_05 tiger INTEGRATED IN: 1.4.2_05 tiger tiger-b08
14-06-2004

EVALUATION ###@###.### 2003-05-15 Stack overflow in PhaseCFG::set_pinned() has been fixed in tiger by using an iterative implementation. However, this bug applies generally to all 64-bit compilation in that the compilation thread's default stack size should be scaled up from the default value for 32-bit execution. Due to scheduling constraints, and the existence of a command-line workaround, this will not be fixed in mantis. -----
11-06-2004

WORK AROUND Name: cl74495 Date: 05/15/2003 Use -XX:CompilerThreadStackSize to adjust the stack size ======================================================================
11-06-2004

SUGGESTED FIX ###@###.### 2004-03-03 The fix diffs: src/os/solaris/vm/os_solaris.cpp *** 858,865 **** #ifdef COMPILER2 // Compiler2 requires a large stack size to handle recursive routines. else if (thr_type == compiler_thread) { ! // stack size in units of Kbytes; 2M total needed as default. ! int default_size = (CompilerThreadStackSize > 0) ? CompilerThreadStackSize : 2 * K; stack_size = MAX2((size_t)(default_size * K), os::Solaris::min_stack_allowed); } #endif --- 858,865 ---- #ifdef COMPILER2 // Compiler2 requires a large stack size to handle recursive routines. else if (thr_type == compiler_thread) { ! // stack size in units of Kbytes; 2M (4M for LP64) total needed as default. ! int default_size = (CompilerThreadStackSize > 0) ? CompilerThreadStackSize : (BytesPerWord >> 1) * K; stack_size = MAX2((size_t)(default_size * K), os::Solaris::min_stack_allowed); } #endif src/os_cpu/linux_ia64/vm/os_linux_ia64.cpp *** 545,552 **** #ifdef COMPILER2 // Compiler2 requires a large stack size to handle recursive routines. else if (thr_type == compiler_thread) { ! // stack size in units of Kbytes; 2M total needed as default. ! int default_size = (CompilerThreadStackSize > 0) ? CompilerThreadStackSize : 2 * K; stack_size = MAX2((size_t)(default_size * K), os::Linux::min_stack_allowed); } #endif --- 545,552 ---- #ifdef COMPILER2 // Compiler2 requires a large stack size to handle recursive routines. else if (thr_type == compiler_thread) { ! // stack size in units of Kbytes; 4M total needed as default for ia64. ! int default_size = (CompilerThreadStackSize > 0) ? CompilerThreadStackSize : 4 * K; stack_size = MAX2((size_t)(default_size * K), os::Linux::min_stack_allowed); } #endif
11-06-2004