United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6496524 Setting breakpoint in jdb crashes Hotspot JVM
JDK-6496524 : Setting breakpoint in jdb crashes Hotspot JVM

Details
Type:
Bug
Submit Date:
2006-11-22
Status:
Resolved
Updated Date:
2010-07-29
Project Name:
JDK
Resolved Date:
2007-06-20
Component:
hotspot
OS:
generic,solaris_10
Sub-Component:
compiler
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0u9,7
Fixed Versions:
hs10 (b14)

Related Reports
Backport:
Backport:
Duplicate:

Sub Tasks

Description
Here are the steps to reproduce the issue. Please see the attached testcase:

1. Run the program:
java -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n
BreakpointBugTest

2. Attach a debugger in parallel:
jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000

3. Wait some seconds in the debugger

4. Set a breakpoint in line 21 (the one starting '  int index = ...')
stop at BreakpointBugTest$Runner:21

5. Now the VM chrashes.

cheers,

Matthias

                                    

Comments
EVALUATION

Jdb is setting a breakpoint at an invokestatic bytecode.  The VM safepoints, then deopts at this same bytecode. 

AbstractInterpreter::continuation_for() is confused. It chooses the wrong tos type: vtos based on _breakpoint, instead of itos based on _invokestatic.  The continuation state is wrong, so deopt_entry() returns the wrong entry point and hijinks ensue.
                                     
2006-12-14
SUGGESTED FIX

It seems that continuation_for() should compute "code" like this:

  Bytecodes::Code code   = Bytecodes::java_code(Bytecodes::code_at(bcp));

instead of this:

  Bytecodes::Code code   = Bytecodes::java_code(Bytecodes::cast(*bcp));

More investigation needed.
                                     
2006-12-14
SUGGESTED FIX

See PRT webrev:

http://prt-web.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2007/20070608153504.rasbold.c2_baseline/workspace/webrevs/webrev-2007.06.08/index.html
                                     
2007-06-11



Hardware and Software, Engineered to Work Together