harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Popov" <ivan.g.po...@gmail.com>
Subject Re: [JDKTools][JDWP]Let's start JDWP java6 updating
Date Fri, 22 Feb 2008 13:54:07 GMT
On Fri, Feb 22, 2008 at 7:41 PM, Oliver Deakin
<oliver.deakin@googlemail.com> wrote:
> Ivan Popov wrote:
>  > I agree with Gregory, this is very strange and unexpected usage of
>  > JDWP agent. It's not supported by JDWP specification and thus may vary
>  > in different implementation depending on how implementation handles
>  > errors
>  >
>  > The main problem is that technically JDWP protocol is symmetric,
>  > that's why it's possible for JDWP agents to connect to each other and
>  > even perform handshake. After successfull handshake several JDWP
>  > packets are transferred over JDWP connection between the agents.
>  >
>  > There are three kinds of JDWP packets (commands, replies, events)
>  > which have similar structure. JDWP spec defines that commands may only
>  > transfer to agent, while replies and events may only transfer from
>  > agent. In this particular case this rule is broken. Current Harmony's
>  > implementation relies on this order and reports errors if it is broken
>  > (may be not in a very good manner). RI's implementation seems just
>  > silently ignoring unexpected packets and does not print errors.
>  >
>
>  Hi Ivan,
>
>  Yes, I know this is an unusual usage of JDWP - I thought that the
>  "command not implemented EVENT/COMPOSITE[64/100]" error was indicating
>  some missing functionality, but if you believe that this is just caused
>  by handshake failure then I agree that it should be ok to leave it as is
>  (or print a better diagnostic message).
>
>  Thanks,
>  Oliver

Oliver,

Yes, that's intentional behavior. According to JDWP spec command
packet with command EVENT/COMPOSITE is used as an event packet and is
not intended to be handled by agent itself. It may only be generated
by agent and sent to JDWP client.

In this particular case one agent generates VM_INIT event packet
(which is actually a command packet) and sends it to the other agent.
The other agent interprets it as a command, which cannot be handled,
and sends reply message with error code. First agent gets reply packet
and tries to interpret it as a command packet. Failing to do so, it
sends reply packet with error to the other agents and thus both agents
fall into an endless loop, generating error messages.

Thanks.
Ivan

Mime
View raw message