6649594: Intermittent IOExceptions during dynamic attach on linux and solaris

Alan Bateman Alan.Bateman at oracle.com
Fri Jul 16 00:28:59 PDT 2010


David Holmes wrote:
> :
> Not to delay this but ... why replace the always safe strncpy with an 
> unsafe strcpy protected by an assert ??? I though we were moving to 
> always safe code to get past code-checkers etc.
>
> And out of curiousity where does this new UNIX_MAX_PATH come from (and 
> if it is UNIX then why isn't used on Solaris rather than Linux ;-) )
When you bind a Unix domain socket then you (usually) specify a path so 
that clients can locate it via the file system. This path is specified 
in the sun_path field and is limited to UNIX_PATH_MAX (including nul 
terminator). The original code PATH_MAX, which didn't really matter 
until it was changed recently to use the temporary directory specified 
by the java.io.tmpdir property. The reason that it's not in the Solaris 
implementation is because it's not using Unix domain sockets. As regards 
the strcpy, the length has already been checked but you are probably 
right and I should leave that as a strncpy.

-Alan.


More information about the serviceability-dev mailing list