-
Bug
-
Resolution: Cannot Reproduce
-
P5
-
None
-
2.0
-
x86
-
windows_nt
em.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) +
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();
// try {
// Thread.sleep(3);
// } catch (InterruptedException e) {};
i++;
}
} catch (Throwable e) {
resourcearea001.pln_prim("Final exception: " + e.toString());
}
}
public void run() {
//\\// System.out.println("##########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!");
// ires = 1 / (2*ires - ires - 2) ;
return;
}
if (cntr >= LIMIT*LIMIT) {
resourcearea001.pln_prim("WARNING3:Limit of threads is exceeded!");
// ires = 1 / (2*ires - ires - 2) ;
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) {
//\\// System.out.println("##########INT run");
try {
int i = 0;
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
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();
/// rsa2 = new resourcearea001();
/// rsa2.setPriority(Thread.MAX_PRIORITY);
/// rsa2.start();
// try {
// Thread.sleep(3);
// } catch (InterruptedException e) {};
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: 01/26/2000
/net/sqesvr/vsn/testbase/testbase_nsk/src/nsk/coverage/resourcearea/resourcearea001 test
destroys java_g (java version "1.2.2"
Java HotSpot(TM) Server VM (2.0rc1, mixed mode, debug build I))
on WinNT (Pentium II, 350MHz, 128Mb RAM, Windows NT 4.0 Workstation).
The test provokes concurrent consuming the thread's,
object's, stack's, reference's resources in some aggressive manner.
The analogous result arises for another java_g: java version "1.3.0rc1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-S)
Java HotSpot(TM) Client VM (build 1.3.0rc1-S-debug, mixed mode).
See log and source below.
LOG:
====
[#] f:/ld24/java/hotspot/jdk1.2.2/win32/bin/java_g -version
java version "1.2.2"
Java HotSpot(TM) Server VM (2.0rc1, mixed mode, debug build I)
[#] cd d:/zss/TONGA_WSs/ZSS_workdir/Administrator.NT.x86/resourcearea001
[#] f:/ld24/java/hotspot/jdk1.2.2/win32/bin/java_g resourcearea001
#
# HotSpot Virtual Machine Error, assertion failure
#
# assert((UseStarvationMonitor && thread->is_VM_thread()) || (java_to_os_priority[p] == os_prio), "priority not found (may happen only if thread uses native OS calls to manipulate priority")
#
# Error ID: C:/hotspot\src\share\vm\runtime\os.cpp, 71
#
[#]
[#] f:/ld24/java/hotspot/jdk1.3.0/win32/bin/java_g -version
java version "1.3.0rc1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-S)
Java HotSpot(TM) Client VM (build 1.3.0rc1-S-debug, mixed mode)
[#] f:/ld24/java/hotspot/jdk1.3.0/win32/bin/java_g resourcearea001
#
# HotSpot Virtual Machine Error, assertion failure
#
# assert((UseStarvationMonitor && thread->is_VM_thread()) || (java_to_os_priority[i] == os_prio), "priority not found (may happen only if thread uses native OS calls to manipulate priority")
#
# Error ID: C:/hotspot1.3\src\share\vm\runtime\os.cpp, 64
#
[error occured during error reporting]
SOURCE:
========
// Ident: @(#)resourcearea001.java 1.3 00/01/13
// Copyright 01/13/00 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 ind1;
int ind2 = 0;
int cntra_prev;
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();
cntra_prev = cntra;
while (cntra < resourcearea001.LIMIT*resourcearea001.LIMIT*10) {
for (ind1=0;ind1<=resourcearea001.LIMIT;ind1++) { };
Thread.currentThread().yield();
if (ind2 > resourcearea001.LIMIT/**10*/ && cntra == cntra_prev) {
return;
}
if (cntra != cntra_prev) {
ind2 = 0;
}
ind2++;
cntra_prev = cntra;
}
// 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();
// try {
// Thread.sleep(3);
// } catch (InterruptedException e) {};
}
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!");
// ires = 1 / (2*ires - ires - 2) ;
}
resourcearea001.pln_prim("WARNING: cntr++!");
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) {
// if (i_InternalError == 0) {
/// resourcearea001.pln_prim(" "+e.toString()+" = "+i_InternalError);
// }
InternalError_add();
}
if (e.toString().indexOf("OutOfMemoryError") != -1) {
// if (i_OutOfMemoryError == 0) {
/// resourcearea001.pln_prim(" "+e.toString()+" = "+i_OutOfMemoryError);
// }
OutOfMemoryError_add();
/// if (i_OutOfMemoryError%10 == 0) {
// str = str.concat(strng);
/// }
}
if (e.toString().indexOf("StackOverflowError") != -1) {
// if (i_StackOverflowError == 0) {
/// resourcearea001.pln_prim(" "+e.toString()+" = "+i_StackOverflowError);
// }
StackOverflowError_add();
}
if (e.toString().indexOf("UnknownError") != -1) {
// if (i_UnknownError == 0) {
/// resourcearea001.pln_prim(" "+e.toString()+" = "+i_UnknownError);
// }
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();
}
// try {
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();
// } catch (StackOverflowError e) {
// resourcearea001.pln_prim("## "+e);
// } catch (Throwable e) {
// resourcearea001.pln_prim("## "+e);
// };
}
public void GrowableObject() {
//\\// System.out.println("<<<<<<<<<<GrowableObject");
resourcearea001.pln_prim("#GrowableObject#");
grstr();
//\\////\\// Syst
}
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) +
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();
// try {
// Thread.sleep(3);
// } catch (InterruptedException e) {};
i++;
}
} catch (Throwable e) {
resourcearea001.pln_prim("Final exception: " + e.toString());
}
}
public void run() {
//\\// System.out.println("##########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!");
// ires = 1 / (2*ires - ires - 2) ;
return;
}
if (cntr >= LIMIT*LIMIT) {
resourcearea001.pln_prim("WARNING3:Limit of threads is exceeded!");
// ires = 1 / (2*ires - ires - 2) ;
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) {
//\\// System.out.println("##########INT run");
try {
int i = 0;
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
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();
/// rsa2 = new resourcearea001();
/// rsa2.setPriority(Thread.MAX_PRIORITY);
/// rsa2.start();
// try {
// Thread.sleep(3);
// } catch (InterruptedException e) {};
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: 01/26/2000
/net/sqesvr/vsn/testbase/testbase_nsk/src/nsk/coverage/resourcearea/resourcearea001 test
destroys java_g (java version "1.2.2"
Java HotSpot(TM) Server VM (2.0rc1, mixed mode, debug build I))
on WinNT (Pentium II, 350MHz, 128Mb RAM, Windows NT 4.0 Workstation).
The test provokes concurrent consuming the thread's,
object's, stack's, reference's resources in some aggressive manner.
The analogous result arises for another java_g: java version "1.3.0rc1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-S)
Java HotSpot(TM) Client VM (build 1.3.0rc1-S-debug, mixed mode).
See log and source below.
LOG:
====
[#] f:/ld24/java/hotspot/jdk1.2.2/win32/bin/java_g -version
java version "1.2.2"
Java HotSpot(TM) Server VM (2.0rc1, mixed mode, debug build I)
[#] cd d:/zss/TONGA_WSs/ZSS_workdir/Administrator.NT.x86/resourcearea001
[#] f:/ld24/java/hotspot/jdk1.2.2/win32/bin/java_g resourcearea001
#
# HotSpot Virtual Machine Error, assertion failure
#
# assert((UseStarvationMonitor && thread->is_VM_thread()) || (java_to_os_priority[p] == os_prio), "priority not found (may happen only if thread uses native OS calls to manipulate priority")
#
# Error ID: C:/hotspot\src\share\vm\runtime\os.cpp, 71
#
[#]
[#] f:/ld24/java/hotspot/jdk1.3.0/win32/bin/java_g -version
java version "1.3.0rc1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-S)
Java HotSpot(TM) Client VM (build 1.3.0rc1-S-debug, mixed mode)
[#] f:/ld24/java/hotspot/jdk1.3.0/win32/bin/java_g resourcearea001
#
# HotSpot Virtual Machine Error, assertion failure
#
# assert((UseStarvationMonitor && thread->is_VM_thread()) || (java_to_os_priority[i] == os_prio), "priority not found (may happen only if thread uses native OS calls to manipulate priority")
#
# Error ID: C:/hotspot1.3\src\share\vm\runtime\os.cpp, 64
#
[error occured during error reporting]
SOURCE:
========
// Ident: @(#)resourcearea001.java 1.3 00/01/13
// Copyright 01/13/00 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 ind1;
int ind2 = 0;
int cntra_prev;
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();
cntra_prev = cntra;
while (cntra < resourcearea001.LIMIT*resourcearea001.LIMIT*10) {
for (ind1=0;ind1<=resourcearea001.LIMIT;ind1++) { };
Thread.currentThread().yield();
if (ind2 > resourcearea001.LIMIT/**10*/ && cntra == cntra_prev) {
return;
}
if (cntra != cntra_prev) {
ind2 = 0;
}
ind2++;
cntra_prev = cntra;
}
// 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();
// try {
// Thread.sleep(3);
// } catch (InterruptedException e) {};
}
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!");
// ires = 1 / (2*ires - ires - 2) ;
}
resourcearea001.pln_prim("WARNING: cntr++!");
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) {
// if (i_InternalError == 0) {
/// resourcearea001.pln_prim(" "+e.toString()+" = "+i_InternalError);
// }
InternalError_add();
}
if (e.toString().indexOf("OutOfMemoryError") != -1) {
// if (i_OutOfMemoryError == 0) {
/// resourcearea001.pln_prim(" "+e.toString()+" = "+i_OutOfMemoryError);
// }
OutOfMemoryError_add();
/// if (i_OutOfMemoryError%10 == 0) {
// str = str.concat(strng);
/// }
}
if (e.toString().indexOf("StackOverflowError") != -1) {
// if (i_StackOverflowError == 0) {
/// resourcearea001.pln_prim(" "+e.toString()+" = "+i_StackOverflowError);
// }
StackOverflowError_add();
}
if (e.toString().indexOf("UnknownError") != -1) {
// if (i_UnknownError == 0) {
/// resourcearea001.pln_prim(" "+e.toString()+" = "+i_UnknownError);
// }
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();
}
// try {
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();
// } catch (StackOverflowError e) {
// resourcearea001.pln_prim("## "+e);
// } catch (Throwable e) {
// resourcearea001.pln_prim("## "+e);
// };
}
public void GrowableObject() {
//\\// System.out.println("<<<<<<<<<<GrowableObject");
resourcearea001.pln_prim("#GrowableObject#");
grstr();
//\\////\\// Syst