This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
breakpoints/2538: SIGILL after resuming from a breakpoint within a JVM process
- From: lineonking at gmail dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 20 Oct 2008 01:49:14 -0000
- Subject: breakpoints/2538: SIGILL after resuming from a breakpoint within a JVM process
- Reply-to: lineonking at gmail dot com
>Number: 2538
>Category: breakpoints
>Synopsis: SIGILL after resuming from a breakpoint within a JVM process
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Oct 20 01:58:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: lineonking@gmail.com
>Release: GDB-6.8
>Organization:
>Environment:
powerpc-linux2.6.20-17 + IBM java 1.6
>Description:
Resuming after a breakpoint within a IBM JVM triggers a SIGILL exception. This SIGILL does not happen without the gdb. I guess that some strange thing is going on.
>How-To-Repeat:
0. download PingPong.java and PingPong.c.
1. compile
(bash) gcc -I $JAVA_HOME/include -o libPingPong.so -shared -g PingPong.c
(bash) javac -g PingPong.java
2. check if running well.
(bash) java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pxp3260sr1-20080416_01(SR1))
...
(bash)java PingPong
jPing: 3
cPong: 2
jPing: 1
cPong: 0
3. check if gdb correctly resums after a breakpoint.
(bash) gdb --args java PingPong
GNU gdb 6.8
...
(bash) shell tail PingPong.c
JNIEXPORT jint JNICALL Java_PingPong_cPong(
JNIEnv *env, jclass cls, jint i
) {
printf("cPong: %d\n", i);
if ( i > 0) {
jmethodID mid = (*env)->GetStaticMethodID(env, cls, "jPing", "(I)I");
(*env)->CallStaticIntMethod(env, cls, mid, i-1);
}
return i;
}
(gdb) b Java_PingPong_cPong
...
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (Java_PingPong_cPong) pending.
(gdb) r
...
Breakpoint 1, Java_PingPong_cPong (env=0x100bfe00, cls=0x1042bc60, i=2)
at PingPong.c:19
19 printf("cPong: %d\n", i);
(gdb) disas
Dump of assembler code for function Java_PingPong_cPong:
0x0ed9b94c <Java_PingPong_cPong+0>: stwu r1,-64(r1)
0x0ed9b950 <Java_PingPong_cPong+4>: mflr r0
0x0ed9b954 <Java_PingPong_cPong+8>: stw r31,60(r1)
0x0ed9b958 <Java_PingPong_cPong+12>: stw r0,68(r1)
0x0ed9b95c <Java_PingPong_cPong+16>: mr r31,r1
0x0ed9b960 <Java_PingPong_cPong+20>: stw r3,28(r31)
0x0ed9b964 <Java_PingPong_cPong+24>: stw r4,24(r31)
0x0ed9b968 <Java_PingPong_cPong+28>: stw r5,20(r31)
0x0ed9b96c <Java_PingPong_cPong+32>: .long 0x7d820eda
...
(gdb) continue
Continuing.
Program received signal SIGILL, Illegal instruction.
Java_PingPong_cPong (env=0x100bfe00, cls=0x1042bc60, i=2) at PingPong.c:19
19 printf("cPong: %d\n", i);
(gdb) cont
Continuing.
Unhandled exception
Type=Illegal instruction vmState=0x00000000
J9Generic_Signal_Number=00000010 Signal_Number=00000004 Error_Value=00000000 Signal_Code=00000001
Handler1=0FAF97E0 Handler2=0FA31700
...
(bash)
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: