Review request for 6432567: PIT : com/sun/jdi/BadHandshakeTest.java fails due to java.net.ConnectException

Kelly O'Hair Kelly.Ohair at Sun.COM
Thu Aug 27 15:02:25 PDT 2009


This:
    expected = strlen(hello);
Should probably be:
    expected = (int)strlen(hello);

And I would almost think that this:
    char msg[100];
should be:
    char msg[80+expected*2];
and snprintf() used rather than sprintf? But not a big deal.

Looks good otherwise.  Thanks for doing this.

-kto


Alan Bateman wrote:
> Tim - do you mind reviewing this one? It's the BadHankshakeTest failure 
> on windows-x64 that we've discussed in the past but didn't manage to get 
> to the finish line. Another bug (and patch)[1] was submitted by Kees 
> Cook on exactly the same issue, but on Ubunutu with OpenJDK compiled 
> with an option to detect bugs like this. The issue as you know, arises 
> when the debuggee is connected to something that isn't a debugger and 
> the handshake fails. The transport code writes the error message into a 
> buffer on the stack that isn't sized correctly and so can trash the 
> stack. In the proposed change I have over-sized the buffer in case the 
> error message is tweaked in the future. I've also fixed a typo in the 
> error message and some local clean-up (more could be done). The webrev 
> is here:
>    http://cr.openjdk.java.net/~alanb/6432567/webrev.00/
> 
> Once we agree the changes, then this is something we can push to 6open 
> aswell.
> 
> Thanks,
> Alan.
> 
> [1] https://bugs.openjdk.java.net/show_bug.cgi?id=100103


More information about the serviceability-dev mailing list