Mantis - Resin
Viewing Issue Advanced Details
5428 minor always 04-26-13 12:26 08-12-13 11:00
ferg  
ferg  
normal  
closed 4.0.36  
fixed  
none    
none 4.0.37  
0005428: array index issue with Zing VM
(rep by Daniel Shearer)
Caused by: java.lang.ArrayIndexOutOfBoundsException
        at com.caucho.vfs.JniSocketImpl.readNative(Native Method)
        at com.caucho.vfs.JniSocketImpl.read(JniSocketImpl.java:449)
        at com.caucho.vfs.JniStream.read(JniStream.java:74)
        at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:1240)
        at com.caucho.vfs.ReadStream.read(ReadStream.java:484)
        at com.caucho.server.http.ContentLengthStream.read(ContentLengthStream.java:79)
        at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:1240)
        at com.caucho.vfs.ReadStream.read(ReadStream.java:365)
        at com.caucho.vfs.i18n.UTF8Reader.read(UTF8Reader.java:91)
        at com.caucho.vfs.ReadStream.readChar(ReadStream.java:566)
        at com.caucho.vfs.BufferedReaderAdapter.read(BufferedReaderAdapter.java:63)
  

Notes
(0006243)
stevenn   
04-30-13 08:41   
We're still getting this error intermittently with Zing VM (perhaps once every three runs). It's not something we've seen with hotspot though that doesn't necessarily mean it doesn't happen on hotspot. Stack trace is consistent every time (though it varies where in our code this occurs).

Looking at the resin source we have available, it appears that the buffer is managed via TempBuffer and should be consistent. The code appears to only read from the zero offset and for no more than the buffer length. We assume that the exception is being raised within the native code but we can't see that.

Also, the version we have deployed on this box is 4.0.34 not 4.0.36 as listed on this issue.
(0006308)
ferg   
08-12-13 11:00   
Added validation to the native read call, both for the caller and the callee.

If the problem persists, please report it again.