-
Bug
-
Resolution: Fixed
-
P2
-
1.3.0
-
kestrel
-
x86
-
windows_nt
ist(7,c);
} catch (ArithmeticException e) {
resourcearea001.pln_prim("From StackOverflowing: " + e.toString());
}
}
public void GrowableReferencesOnObjects() {
System.out.println("<<<<<<<<<<GrowableReferencesOnObjects");
resourcearea001.pln_prim("#GrowableReferencesOnObjects#");
//For GC provoking://
// System.gc();
int ind;
int itmp = cntr;
resourcearea001 ra[];
ra = new resourcearea001[(itmp%10+1)*100*LIMIT + 1];
for(ind = 0; ind < (itmp%10+1)*100*LIMIT; ind++) {
ra[ind] = new resourcearea001();
}
}
public void GrowableThreadsNumber() {
System.out.println("<<<<<<<<<<GrowableThreadsNumber");
resourcearea001.pln_prim("#GrowableThreadsNumber#");
int i = 0;
try {
resourcearea001a raa;
while (resourcearea001a.cntra < LIMIT*LIMIT/**10*/) {
Thread.currentThread().yield();
raa = new resourcearea001a(thg, "resourcearea001a");
raa.setPriority(Thread.MAX_PRIORITY);
raa.start();
i++;
}
} catch (Throwable e) {
resourcearea001.pln_prim("Final exception: " + e.toString());
}
}
public void run() {
resourcearea001.pln("#resourcearea001.run#");
str = str.concat(strng);
int ires = 2;
if (i_InternalError +
i_OutOfMemoryError +
i_StackOverflowError +
i_UnknownError >= LIMIT ) {
resourcearea001.pln_prim("WARNING3:Limit of errors is exceeded!");
return;
}
if (cntr >= LIMIT*LIMIT) {
resourcearea001.pln_prim("WARNING3:Limit of threads is exceeded!");
return;
}
Counter();
resourcearea001 rsa1 = new resourcearea001();
rsa1.setPriority(Thread.MAX_PRIORITY);
Thread.currentThread().yield();
if (cntr < LIMIT*LIMIT) {
try {
rsa1.start();
} catch (VirtualMachineError e) {
prnt(e);
}
} else {
return;
}
Thread.currentThread().yield();
try {
if (cntr % 13 == 0) {
GrowableReferencesOnObjects();
GrowableObject();
GrowableThreadsNumber();
} else if (cntr % 3 == 0) {
GrowableReferencesOnObjects();
} else if (cntr % 5 == 0) {
StackOverflowing();
} else if (cntr % 7 == 0) {
GrowableThreadsNumber();
} else {
GrowableObject();
}
} catch (VirtualMachineError e) {
prnt(e);
}
Thread.currentThread().yield();
}
public static int ist(int iprm, resourcearea001c c) {
resourcearea001.pln("#ist#");
STCK_CNTR(c);
return iprm + ist(-iprm, c);
}
public static void main(String argv[]) {
System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
}
public static int run(String argv[], PrintStream out) {
try {
int i = 0;
resourcearea001 rsa2 = new resourcearea001();
rsa2.setPriority(Thread.MAX_PRIORITY);
rsa2.start();
Thread.currentThread().yield();
while ((i_InternalError +
i_OutOfMemoryError +
i_StackOverflowError +
i_UnknownError < LIMIT) &&
(cntr < LIMIT*LIMIT)) {
Thread.currentThread().yield();
i++;
}
} catch (VirtualMachineError e) {
prnt(e);
} catch (Throwable e) {
resourcearea001.pln_prim("Final exception: " + e.toString());
return 2/*TEST_FAILED*/;
}
resourcearea001.pln_prim("InternalError= " + i_InternalError);
resourcearea001.pln_prim("OutOfMemoryError= " + i_OutOfMemoryError);
resourcearea001.pln_prim("StackOverflowError= " + i_StackOverflowError);
resourcearea001.pln_prim("UnknownError= " + i_UnknownError);
return 0/*TEST_PASSED*/;
}
}
//---------------------
======================================================================
Name: szC45993 Date: 09/24/99
Tonga/testbase_js/src/nsk/coverage/resourcearea/resourcearea001 test
destroys java (java version "1.3beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
Java(TM) HotSpot Client VM (build 1.3beta-O, mixed mode))
on WinNT (Pentium II, 350MHz, 128Mb RAM,
Windows NT 4.0 Workstation) in both -Xcomp or -Xmixed modes.
The test provokes concurrent consuming the thread's,
object's, stack's, reference's resources in some aggressive manner.
See log and source below.
LOG:
====
[#] f:/ld25/java/dest/jdk1.3O/win32/bin/java -version
java version "1.3beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
Java(TM) HotSpot Client VM (build 1.3beta-O, mixed mode)
[#]
f:/ld25/java/dest/jdk1.3O/win32/bin/java -Xcomp -verify resourcearea001
[#] f:/ld25/java/dest/jdk1.3O/win32/bin/java -Xcomp -verify resourcearea001
<<<<<<<<<<GrowableObject
<<<<<<<<<<GrowableReferencesOnObjects
<<<<<<<<<<GrowableObject
<<<<<<<<<<GrowableReferencesOnObjects
<<<<<<<<<<GrowableThreadsNumber
<<<<<<<<<<GrowableObject
<<<<<<<<<<GrowableReferencesOnObjects
<<<<<<<<<<StackOverflowing
<<<<<<<<<<GrowableObject
<<<<<<<<<<GrowableReferencesOnObjects#
#
<<<<<<<<<<GrowableReferencesOnObjectsH
otSpot Virtual Machine Error, EXCEPTION_AC<<<<<<<<<<GrowableThreadsNumberCESS_VIOLATION
#
# Error ID: 4F533F57494E13120E43505002B0
#
abnormal program termination
[#] f:/ld25/java/dest/jdk1.3O/win32/bin/java -verify resourcearea001
<<<<<<<<<<GrowableObject
<<<<<<<<<<grstr
<<<<<<<<<<GrowableReferencesOnObjects
<<<<<<<<<<GrowableReferencesOnObjects
<<<<<<<<<<StackOverflowing
<<<<<<<<<<GrowableReferencesOnObjects
<<<<<<<<<<GrowableThreadsNumber
---------StackOverflowError_add
<<<<<<<<<<GrowableObject
<<<<<<<<<<grstr
<<<<<<<<<<GrowableReferencesOnObjects
<<<<<<<<<<StackOverflowing
#
# HotSp<<<<<<<<<<GrowableObjectot Virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
#
# Error ID: 4F533F57494E13120E43505002B0
#
abnormal program termination
[#]
------------------------- OR WITH COMMENTED PRINTING: -------------------------
[#] f:/ld25/java/dest/jdk1.3O/win32/bin/java -Xcomp -verify resourcearea001
#
# HotSpot Virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
#
# Error ID: 4F533F57494E13120E43505002B0
#
abnormal program termination
[#] f:/ld25/java/dest/jdk1.3O/win32/bin/java -verify resourcearea001
#
# HotSpot Virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
#
# Error ID: 4F533F57494E13120E43505002B0
#
abnormal program termination
SOURCE:
========
//--------------------- resourcearea001.java:
// Ident: %Z%%M% %I% %E%
// Copyright %G% Sun Microsystems, Inc. All Rights Reserved
import java.io.PrintStream;
class resourcearea001c {
public long lc;
}
class resourcearea001b extends ThreadGroup {
resourcearea001b(String name) {
super(name);
resourcearea001.pln("#resourcearea001b#");
}
public void uncaughtException(Thread t, Throwable e) {
resourcearea001.pln("#uncaughtException#");
resourcearea001.pln("uncaughtException: "+e.toString());
resourcearea001.pln("resourcearea001a.cntra= " + resourcearea001a.cntra);
resourcearea001a.cntra = 0;
if (e.toString().indexOf("InternalError") != -1 ||
e.toString().indexOf("OutOfMemoryError") != -1 ||
e.toString().indexOf("StackOverflowError") != -1 ||
e.toString().indexOf("UnknownError") != -1 ) {
resourcearea001.prnt((VirtualMachineError) e);
}
stop();
}
}
class resourcearea001a extends Thread {
resourcearea001a(ThreadGroup thg, String name) {
super(thg, name);
resourcearea001.pln("#resourcearea001a#");
}
volatile static int cntra = 0;
public synchronized void Counter(boolean prm) {
resourcearea001.pln("#resourcearea001a.Counter# "+cntra);
if (prm == true) {
if (cntra >= resourcearea001.LIMIT*resourcearea001.LIMIT/**10*/) {
resourcearea001.pln("WARNING1: resourcearea001a.cntra limit is acheived!");
}
cntra++;
} else {
cntra--;
}
}
public void run() {
resourcearea001.pln("#resourcearea001a.run#");
Counter(true);
int ind;
resourcearea001a rsa1 = new resourcearea001a(resourcearea001.thg,"resourcearea001a");
rsa1.setPriority(Thread.MAX_PRIORITY);
Thread.currentThread().yield();
if (cntra < resourcearea001.LIMIT*resourcearea001.LIMIT/**10*/) {
rsa1.start();
} else {
Counter(false);
return;
}
Thread.currentThread().yield();
while (cntra < resourcearea001.LIMIT*resourcearea001.LIMIT/**10*/) {
for (ind=0;ind<=resourcearea001.LIMIT;ind++) { };
Thread.currentThread().yield();
}
Counter(false);
}
}
public class resourcearea001 extends Thread {
volatile static int i_InternalError = 0;
volatile static int i_OutOfMemoryError = 0;
volatile static int i_StackOverflowError = 0;
volatile static int i_UnknownError = 0;
static int LIMIT = 25; //50; //100; //1000;
volatile static int cntr = 0;
static public resourcearea001b thg = new resourcearea001b("resourcearea001b");
static public boolean flg1 = false;
static public boolean flg2 = false; //true;
String str = "";
String strng = "1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./"+
"1234567890-=esc qwertyuiop[]asdfghjkl; zxcvbnm,./";
public static void pln(String message) {
if (flg1) {
System.out.println(message);
}
}
public static void pln_prim(String message) {
if (flg2) {
System.out.println(message);
}
}
static public void STCK_CNTR(resourcearea001c c) {
resourcearea001.pln("#resourcearea001.Counter#");
int ires = 2;
if (c.lc%(LIMIT*LIMIT) == 0) {
Thread.currentThread().yield();
}
if (c.lc >= LIMIT*LIMIT*LIMIT/**LIMIT*/) {
resourcearea001.pln_prim("WARNING4: Depth of stack is exceeded!");
ires = 1 / (2*ires - ires - 2) ;
}
c.lc++;
}
public synchronized void Counter() {
resourcearea001.pln("#resourcearea001.Counter#");
int ires = 2;
if (cntr >= LIMIT*LIMIT) {
resourcearea001.pln_prim("WARNING2: Limit of threads is exceeded!");
}
cntr++;
}
public static synchronized void InternalError_add() {
System.out.println("---------InternalError_add");
resourcearea001.pln("#InternalError_add#");
i_InternalError++;
}
public static synchronized void OutOfMemoryError_add() {
System.out.println("---------OutOfMemoryError_add");
resourcearea001.pln("#OutOfMemoryError_add#");
i_OutOfMemoryError++;
}
public static synchronized void StackOverflowError_add() {
System.out.println("---------StackOverflowError_add");
resourcearea001.pln("#StackOverflowError_add#");
i_StackOverflowError++;
}
public static synchronized void UnknownError_add() {
System.out.println("---------UnknownError_add");
resourcearea001.pln("#UnknownError_add#");
i_UnknownError++;
}
public static /*synchronized*/ void prnt(VirtualMachineError e) {
resourcearea001.pln("#prnt#");
if (e.toString().indexOf("InternalError") != -1) {
InternalError_add();
}
if (e.toString().indexOf("OutOfMemoryError") != -1) {
OutOfMemoryError_add();
}
if (e.toString().indexOf("StackOverflowError") != -1) {
StackOverflowError_add();
}
if (e.toString().indexOf("UnknownError") != -1) {
UnknownError_add();
}
}
public long str_cntr = 0;
public void grstr() {
System.out.println("<<<<<<<<<<grstr");
resourcearea001.pln("#grstr#");
if (str.length() >= 13579000) return;
str_cntr++;
if (str_cntr%(LIMIT*LIMIT) == 0) {
Thread.currentThread().yield();
}
str = str.concat(
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str+
str+str+str+str+str+str+str+str+str+str
);
grstr();
}
public void GrowableObject() {
System.out.println("<<<<<<<<<<GrowableObject");
resourcearea001.pln_prim("#GrowableObject#");
grstr();
System.out.println("LENGTH= "+str.length());
}
public void StackOverflowing() {
System.out.println("<<<<<<<<<<StackOverflowing");
resourcearea001.pln_prim("#StackOverflowing#");
resourcearea001c c = new resourcearea001c();
try {
int iii = ist(ist(ist(ist(ist(ist(ist(1,c),c),c),c),c),c),c) +
ist(ist(ist(ist(ist(ist(2,c),c),c),c),c),c) +
ist(ist(ist(ist(ist(3,c),c),c),c),c) +
ist(ist(ist(ist(4,c),c),c),c) +
ist(ist(ist(5,c),c),c) +
ist(ist(6,c),c) +