harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Deakin <oliver.dea...@googlemail.com>
Subject Re: [JDKTools][JDWP]Let's start JDWP java6 updating
Date Fri, 22 Feb 2008 14:53:54 GMT
Thanks Ivan, that's clarified things for me! I agree the endless loop 
should be fixed, sounds like it should be fairly straightforward.

Regards,
Oliver

Ivan Popov wrote:
> And the fix is rather easy. If agent received command packet with
> EVENT/COMPOSITE command or reply packet, this means that it was
> connected with some other agent rather than with JDWP client. In this
> case agent should report this problem to user, but do not send reply
> packet with error back to connection in order to avoid endless loop.
>
> Thanks.
> Ivan
>
> On Fri, Feb 22, 2008 at 7:54 PM, Ivan Popov <ivan.g.popov@gmail.com> wrote:
>   
>> 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
>>
>>     
>
>   

-- 
Oliver Deakin
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


Mime
View raw message