JDK-5109621 : REGRESSION:specifying both -XX:-UseParallelGC and -XX:+UseParNewGC crashes JVM
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_8
  • CPU: generic,sparc
  • Submitted: 2004-09-30
  • Updated: 2015-02-23
  • Resolved: 2005-03-17
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 6
6 b28Fixed
Related Reports
Relates :  
Description
Name: rmT116609			Date: 09/30/2004


FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
SunOS xxx 5.8 Generic_108528-24 sun4u sparc SUNW,Ultra-80

A DESCRIPTION OF THE PROBLEM :
I wanted to run with the serial gc but still use the parallel new generation collector so tried the option combination above. The JVM core dumped immediately.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
type something like  "java -XX:-UseParallelGC -XX:+UseParNewGC -version".

it crashes.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Either it works as I hoped it or tells me that the combination is not permitted. It shouldn't crash.
ACTUAL -
Abort (core dumped)

ERROR MESSAGES/STACK TRACES THAT OCCUR :
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xfe63b41c, pid=29252, tid=1
#
# Java VM: Java HotSpot(TM) Server VM (1.5.0-b64 mixed mode)
# Problematic frame:
# V  [libjvm.so+0x63b41c]
#
# An error report file with more information is saved as hs_err_pid29252.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#


#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xfe63b41c, pid=29252, tid=1
#
# Java VM: Java HotSpot(TM) Server VM (1.5.0-b64 mixed mode)
# Problematic frame:
# V  [libjvm.so+0x63b41c]
#

---------------  T H R E A D  ---------------

Current thread (0x00037190):  JavaThread  [_thread_in_vm, id=1]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x0000000c

Registers:
 O0=0x0011c4b8 O1=0xfe6ba399 O2=0x00000002 O3=0x01000000
 O4=0x04000000 O5=0x00000001 O6=0xffbeedf8 O7=0xfe741aa4
 G1=0xfe5aec88 G2=0x00000004 G3=0x00000001 G4=0x00000000
 G5=0x0011c4d0 G6=0x00000000 G7=0x000326f8 Y=0x00000000
 PC=0xfe63b41c nPC=0xfe63b420


  Top of Stack: (sp=0xffbeedf8)
0xffbeedf8:   fe741a84 00000001 fe6f2000 fe741aa4
0xffbeee08:   00005dac 00005c00 00006bec 00006800
0xffbeee18:   00000000 ffbeef18 00000000 fe738a94
0xffbeee28:   fe5aec88 002c1e4c ffbeee58 fe4301e4
0xffbeee38:   00000000 00000000 00000000 000b106c
0xffbeee48:   fe6f2000 00000000 000b106c 00000001
0xffbeee58:   fe3e61ac 0011c4b8 00000010 000b63b0
0xffbeee68:   fe6f2000 00035ad8 00000010 00000001

Instructions: (pc=0xfe63b41c)
0xfe63b40c:   ea 06 20 14 81 c7 e0 08 81 e8 00 00 9d e3 bf a0
0xfe63b41c:   f8 06 20 0c 80 a7 20 00 08 40 00 0d ac 10 20 00

Stack: [0xffb70000,0xffbf0000),  sp=0xffbeedf8,  free space=507k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x63b41c]
V  [libjvm.so+0x4301ec]
V  [libjvm.so+0x356070]
V  [libjvm.so+0x35cedc]
V  [libjvm.so+0x3418dc]
V  [libjvm.so+0x384554]
V  [libjvm.so+0x356540]
C  [java+0x1800]  main+0x760


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )

Other Threads:

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 2112K, used 40K [0xf0400000, 0xf0620000, 0xf1950000)
  eden space 2048K,   2% used [0xf0400000, 0xf040a3e8, 0xf0600000)
  from space 64K,   0% used [0xf0600000, 0xf0600000, 0xf0610000)
  to   space 64K,   0% used [0xf0610000, 0xf0610000, 0xf0620000)
 tenured generation   total 1408K, used 0K [0xf1950000, 0xf1ab0000, 0xf4400000)
   the space 1408K,   0% used [0xf1950000, 0xf1950000, 0xf1950200, 0xf1ab0000)
 compacting perm gen  total 16384K, used 443K [0xf4400000, 0xf5400000, 0xf840000
0)
   the space 16384K,   2% used [0xf4400000, 0xf446efc0, 0xf446f000, 0xf5400000)
No shared spaces configured.

Dynamic libraries:
0x00010000      /home/murrap/jdk1.5.0/bin/java
0xff350000      /usr/lib/libthread.so.1
0xff390000      /usr/lib/libdl.so.1
0xff200000      /usr/lib/libc.so.1
0xff330000      /usr/platform/SUNW,Ultra-80/lib/libc_psr.so.1
0xfe000000      /home/murrap/jdk1.5.0/jre/lib/sparc/server/libjvm.so
0xff2e0000      /usr/lib/libsocket.so.1
0xff1e0000      /usr/lib/libsched.so.1
0xff1b0000      /usr/lib/libCrun.so.1
0xff180000      /usr/lib/libm.so.1
0xff080000      /usr/lib/libnsl.so.1
0xff300000      /usr/lib/libw.so.1
0xff150000      /usr/lib/libmp.so.2
0xff050000      /home/murrap/jdk1.5.0/jre/lib/sparc/native_threads/libhpi.so
0xfe7d0000      /home/murrap/jdk1.5.0/jre/lib/sparc/libverify.so
0xfe790000      /home/murrap/jdk1.5.0/jre/lib/sparc/libjava.so
0xfe770000      /home/murrap/jdk1.5.0/jre/lib/sparc/libzip.so

VM Arguments:
jvm_args: -XX:-UseParallelGC -XX:+UseParNewGC
java_command: <unknown>

Environment Variables:
JAVA_HOME=/home/murrap/j2sdk1_3_0
PATH=/home/murrap/jtest/bin:/home/murrap/j2sdk1_3_0/bin:/usr/bin:/export/opt1/EM
Cpower/bin:/etc
LD_LIBRARY_PATH=/home/murrap/jdk1.5.0/jre/lib/sparc/server:/home/murrap/jdk1.5.0
/jre/lib/sparc:/home/murrap/jdk1.5.0/jre/../lib/sparc
SHELL=/bin/ksh
HOSTTYPE=sparc
OSTYPE=solaris
MACHTYPE=sparc-sun-solaris


---------------  S Y S T E M  ---------------

OS:                       Solaris 8 10/00 s28s_u2wos_11b SPARC
           Copyright 2000 Sun Microsystems, Inc.  All Rights Reserved.
                            Assembled 31 August 2000

uname:SunOS 5.8 Generic_108528-24 sun4u  (T1 libthread)
rlimit: STACK 8192k, CORE infinity, NOFILE 1024, AS infinity
load average:0.26 1.32 2.54

CPU:total 4 has_v8, has_v9, has_vis1

Memory: 8k page, physical 4194304k(2815784k free)

vm_info: Java HotSpot(TM) Server VM (1.5.0-b64) for solaris-sparc, built on Sep
15 2004 03:36:05 by unknown with unknown Workshop:0x550


The problem was not reproducible with J2SE 1.4.2_05:

java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

java -XX:-UseParallelGC -XX:+UseParNewGC -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)





REPRODUCIBILITY :This bug can be reproduced always.
(Incident Review ID: 315976) 
======================================================================
###@###.### 2004-09-30

Comments
SUGGESTED FIX ------- genCollectedHeap.cpp ------- 1184c1184 < if (UseParNewGC) { --- > if (workers() != NULL) { ------- arguments.cpp ------- 1850c1850 < FLAG_SET(uintx, ParallelGCThreads, nof_parallel_gc_threads()); --- > FLAG_SET_DEFAULT(ParallelGCThreads, nof_parallel_gc_threads()); 1871,1874d1870 < } else if (match_option(option, "-XX:-UseParallelGC", &tail)) { < // We need to make sure the parallel thread count is reset to zero < FLAG_SET(bool, UseParallelGC, false); < FLAG_SET(uintx, ParallelGCThreads, 0); ###@###.### 2005-2-28 20:09:54 GMT Event: putback-to Parent workspace: /net/jano.sfbay/export/disk05/hotspot/ws/main/gc_baseline (jano.sfbay:/export/disk05/hotspot/ws/main/gc_baseline) Child workspace: /net/prt-web.sfbay/prt-workspaces/20050302183215.ysr.bugs/workspace (prt-web:/net/prt-web.sfbay/prt-workspaces/20050302183215.ysr.bugs/workspace) User: ysr Comment: --------------------------------------------------------- Original workspace: neeraja:/net/spot/scratch/ysr/bugs Submitter: ysr Archived data: /net/prt-archiver.sfbay/data/archived_workspaces/main/gc_baseline/2005/20050302183215.ysr.bugs/ Webrev: http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/gc_baseline/2005/20050302183215.ysr.bugs/workspace/webrevs/webrev-2005.03.03/index.html Fixed 5109621: REGRESSION:specifying both -XX:-UseParallelGC and -XX:+UseParNewGC crashes JVM http://analemma.sfbay/net/spot/scratch/ysr/bugs/webrev There were two issues: (1) -UseParallelGC was forcibly resetting ParallelGCThreads=0, code that's now obsolete. (2) GenCollecteHeap::gc_threads_do() was using UseParNewGC as an indicator of whether there are parallel worker threads. This was incorrect, because UseParNewGC may be set with no worker threads (where the work is done in the context of a single vm thread, for example). Reviewed by: Jon Masamitsu Fix Verified: yes Verification Test: as in bug report of 5109621 plus a variety of combinations of ParallelGCThreads and postive and negative settings for the collector flags. Other testing: PRT [ Note added in proof: I had also somewhat prematurely yanked out UseTrainGC flag completely, in line with the initial CCC decision ccc.sfbay/6184896; since that might change, i have restored that code, pending final resolution of the issue. The extra deltas in arguments.cpp and globals.hpp were for undoing that somewhat premature change. ] Files: update: src/share/vm/memory/genCollectedHeap.cpp update: src/share/vm/runtime/arguments.cpp update: src/share/vm/runtime/globals.hpp Examined files: 3217 Contents Summary: 3 update 3214 no action (unchanged) ###@###.### 2005-03-04 22:35:30 GMT
28-02-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
02-10-2004

WORK AROUND Do not use any boolean combination of GC collector choice flags on the command-line. The GC collector choice flags are: Use{Parallel,Serial,ConcMarkSweep,*}GC -X{no,}{conc,inc}gc In other words, never use a combination of any of the above flags, only one at a time. Note that the semantics are unspecified if you mix these flags in random combination. In the future, and perhaps as a fix for this bug report, we might want to outlaw all boolean combinations above, allowing only a singleton choice from the above set.
02-10-2004

EVALUATION I was able to reproduce this using my slightly out of date copy of JDK-1.5.0: analemma ... $Deployed/JDK-1.5.0/bin/java -XX:-UseParallelGC -XX:+UseParNewGC -version # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0xfe434e24, pid=9910, tid=1 # # Java VM: Java HotSpot(TM) Client VM (1.5.0-rc-b63 mixed mode) # Problematic frame: # V [libjvm.so+0x434e24] # # An error report file with more information is saved as hs_err_pid9910.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Abort (core dumped) I was able to reproduce it using a debug build I have lying around: analemma ... dbx $Deployed/gc_baseline/bin/java_g For information about new features see `help changes' To remove this message, put `dbxenv suppress_startup_message 7.1' in your .dbxrc Reading java_g Reading ld.so.1 Reading libthread.so.1 Reading libdl.so.1 Reading libc.so.1 Reading libc_psr.so.1 detected a multithreaded program dbx: warning: can't find file "/BUILD_AREA/jdk1.5.0/control/build/solaris-sparc/tmp/java/java/obj_g/java.o" dbx: warning: see `help finding-files' t@null l@null <1> runargs -XX:-UseParallelGC -XX:+UseParNewGC -version t@null l@null <2> run Running: java_g -XX:-UseParallelGC -XX:+UseParNewGC -version (process id 9924) dbx: process 9924 about to exec("/net/analemma.SFBay/disk0/export/pbk/deployed/solaris-sparc/gc_baseline/bin/java_g") dbx: program "/net/analemma.SFBay/disk0/export/pbk/deployed/solaris-sparc/gc_baseline/bin/java_g" just exec'ed dbx: to go back to the original program use "debug $oprog" dbx: warning: can't find file "/BUILD_AREA/jdk1.5.0/control/build/solaris-sparc/tmp/java/java/obj_g/java.o" dbx: warning: 'main' has no debugger info -- will trigger on first instruction t@1 (l@1) stopped in main at 0x000110b8 0x000110b8: main : save %sp, -0x8c8, %sp t@1 l@1 <3> cont Reading libjvm_g.so Reading libsocket.so.1 Reading libsched.so.1 Reading libCrun.so.1 Reading libm.so.1 Reading libnsl.so.1 Reading libmp.so.2 VM option '+UseParNewGC' Reading libhpi_g.so Reading libverify_g.so Reading libjava_g.so Reading libzip_g.so t@1 (l@1) signal SEGV (no mapping at the fault address) in WorkGang::total_workers at line 92 in file "workgroup.hpp" 92 return _total_workers; t@1 l@1 <4> where current thread: t@1 =>[1] WorkGang::total_workers(this = (nil)), line 92 in "workgroup.hpp" [2] WorkGang::threads_do(this = (nil), tc = 0xffbedec0), line 186 in "workgroup.cpp" [3] GenCollectedHeap::gc_threads_do(this = 0xcca60, tc = 0xffbedec0), line 1069 in "genCollectedHeap.cpp" [4] MemoryService::set_universe_heap(heap = 0xcca60), line 51 in "memoryService.cpp" [5] universe_post_init(), line 744 in "universe.cpp" [6] init_globals(), line 128 in "init.cpp" [7] Threads::create_vm(args = 0xffbee344), line 2715 in "thread.cpp" [8] JNI_CreateJavaVM(vm = 0xffbeec18, penv = 0xffbeec14, args = 0xffbee344), line 2571 in "jni.cpp" [9] InitializeJVM(0xffbeec18, 0xffbeec14, 0xffbeebe8, 0x37e2c, 0xffbeebf0, 0x400), at 0x13c4c [10] main(0x4, 0xffbeec84, 0xffbeec98, 0x36000, 0x0, 0x0), at 0x114b0 ###@###.### 2004-09-30 ---------------------------------------------------------------- Ramki sent this evaluation: The problem appears to be the ParallelGCThreads=0 thing, which in and of itself would not be a problem, as far as crashing goes. To wit it's an intended mode of operation for GC to say: % /java/re/jdk/1.4.2_05/latest/binaries/solaris-sparc/bin/java -XX:+UseParNewGC -XX:ParallelGCThreads=0 -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04) Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode) That would just give you the DefNew (UseSerialGC) collector, and it does in Mantis. But when you do that with Tiger: % java -XX:+UseParNewGC -XX:+PrintCommandLineFlags -XX:ParallelGCThreads=0 -version -XX:ParallelGCThreads=0 -XX:+PrintCommandLineFlags -XX:+UseParNewGC # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0xfee3b41c, pid=46010, tid=1 # # Java VM: Java HotSpot(TM) Server VM (1.5.0-b64 mixed mode) # Problematic frame: # V [libjvm.so+0x63b41c] # # An error report file with more information is saved as hs_err_pid46010.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Abort So there are two problems here: (1) that -UseParallelGC forcibly sets ParallelGCThreads=0. That seems to be the wrong thing to do. (2) that ParallelGCThreads=0 +UseParNewGC causes a crash. That should not happen, and did not in Mantis. I suspect some gotcha when the M&M changes were made. ###@###.### 2004-09-30 ----------------------------------------------------------------
30-09-2004