stop using mmap for zip I/O

Alan Bateman Alan.Bateman at oracle.com
Fri Feb 27 14:17:03 UTC 2015


On 27/02/2015 11:30, Andrew Haley wrote:
> On 02/27/2015 09:51 AM, Seán Coffey wrote:
>>> So we catch the signal, right?  Maybe there's something I'm missing...
>> We don't catch/detect such SEGV's. Would it make sense, is it possible ?
> Sure.  There's some fiddly low-level code involved but it's perfectly
> possible, at least on GNU/Linux.  Maybe it's not worth the effort,
> though.
>
The closest is MappedByteBuffer and there is code in hotspot to handle 
the SIGBUS and recover (recover in the form of throw an Error). It 
should be possible to do the same for zip but I assume would require 
this code to go through the VM. Much easier if we just disable mapping 
the central directory. At one point then Sherman and I talked about only 
mapping the directory of rt.jar and other JAR files in the JDK, don't 
map for zip/JAR files elsewhere. This gets easier now because we don't 
have JAR files in the JDK image, hence we just need to flip the default 
on the property that enables/disable this. Better again is Sherman's 
patch to move from native completely, we've had good experience along 
these lines already with the NIO zip provider.

-Alan



More information about the core-libs-dev mailing list