When the user types the 'suspend' command in jdb, the cached image of the stack held by the client is not cleared, so if 'up' commands are given, they are based on an out of date image of the stack.
TEST CASE #1 - Up off the end of the stack
To use this test case, type:
jdb UpOffEnd
stop in UpOffEnd.stop
run
cont
suspend
up
up
up
up
up
...
---
If the bug is present, you should be able to go up to about main[7].
If you then type 'down' several times to get you back to main[1], and then type 'where', however, you'll be in the while loop, so the stack will only have two levels.
This does not crash on Solaris, but it can crash horribly on Win32.
--- Here is the test case code:
public class UpOffEnd
{
public static void main(String argv[])
{
test1();
int j = 0;
while (true) {
j++;
}
}
static void test1() {test2();}
static void test2() {test3();}
static void test3() {test4();}
static void test4() {stop();}
static void stop() {}
}
TEST CASE #1 - Up off the end of the stack
To use this test case, type:
jdb UpOffEnd
stop in UpOffEnd.stop
run
cont
suspend
up
up
up
up
up
...
---
If the bug is present, you should be able to go up to about main[7].
If you then type 'down' several times to get you back to main[1], and then type 'where', however, you'll be in the while loop, so the stack will only have two levels.
This does not crash on Solaris, but it can crash horribly on Win32.
--- Here is the test case code:
public class UpOffEnd
{
public static void main(String argv[])
{
test1();
int j = 0;
while (true) {
j++;
}
}
static void test1() {test2();}
static void test2() {test3();}
static void test3() {test4();}
static void test4() {stop();}
static void stop() {}
}