6649594: Intermittent IOExceptions during dynamic attach on linux and solaris
Daniel D. Daugherty
daniel.daugherty at oracle.com
Wed Jul 14 17:29:41 PDT 2010
On 7/14/2010 8:38 AM, Alan Bateman wrote:
>
> This is a long standing bug in the attach mechanism on Solaris and
> Linux that causes intermittent failures for some tests. The bug is
> that, on first attempt to attach, the client can observe the file to
> which the door descriptor is attached or the socket file before
> initialization is complete. The proposed fix removes the timing issue
> by renaming the file into place after initialization. Some minor
> clean-up while I was in the area. The webrev is here:
> http://cr.openjdk.java.net/~alanb/6649594/webrev/
>
> Dan or Karen - one thing I wasn't sure about is whether to emit a
> warning when the attach listener can't start or should warnings be
> debug_only?
>
> -Alan.
src/os/linux/vm/attachListener_linux.cpp
The addition of UNIX_PATH_MAX means that the size of the buffer
on line 61: static char _path[PATH_MAX+1]
is now or can be potentially out of sync with the size of the
buffer on line 170 char path[UNIX_PATH_MAX]
If UNIX_PATH_MAX happens to be greater than PATH_MAX, and the
path to the socket is actually longer than PATH_MAX, then we'll
store a short path in the buffer on line 61.
Is there some reason not to use the new UNIX_PATH_MAX in both
locations?
src/os/solaris/vm/attachListener_solaris.cpp
The return values from snprintf() aren't checked here for potential
overflow conditions. It seems to me that the Solaris logic could
benefit from the same sanity checks that you make in the Linux
version.
I would keep the warnings debug only. I see you have a debug only
warning in the Solaris code, but no warning in the Linux code. Or
were you talking about a different warning?
Dan
More information about the serviceability-dev
mailing list