The implementation of the multiplex protocol can throw a runtime exception,
ArrayIndexOutOfBoundsException; this seems to only show up in practice with
JDK 1.1.x, where (2 <= x <= 4).
The problem is in the implementation of the flow control mechanism, if the
current position in the input buffer is past a certain mark before a read
request, it squeezes the active data in the buffer back to the beginning and
sends a message requesting more data ahead of time. The problem is that the
length parameter passed to System.arraycopy() for moving the data is incorrect;
it is the threshold for the current buffer position, not the length of active
data in the buffer. As it is, this can cause an ArrayIndexOutOfBoundException
in some circumstances.
This problem never occurred before JDK1.1.2 because the usage pattern for the
MultiplexInputStream was different. For 1.1.2, RMI uses BufferedInputStreams
on top of each connection (perhaps unnecessary for multiplex protocol
connections) and ObjectInputStream buffers the input of array of primitive
types, changing the practical use of the MultiplexInputStream.
The multiplex protocol was not supposed to be used with JDK 1.1 because
applets are now supposed to be able to create server socket (and thus it
must not have been tested since JDK 1.1.2), but the correct
functionality of the multiplex protocol may still be necessary to support
RMI applets with Internet Explorer 4.0.
john.bui@eng 1997-10-17
No specific test case available. Implicity tested, closed with exposure.
ArrayIndexOutOfBoundsException; this seems to only show up in practice with
JDK 1.1.x, where (2 <= x <= 4).
The problem is in the implementation of the flow control mechanism, if the
current position in the input buffer is past a certain mark before a read
request, it squeezes the active data in the buffer back to the beginning and
sends a message requesting more data ahead of time. The problem is that the
length parameter passed to System.arraycopy() for moving the data is incorrect;
it is the threshold for the current buffer position, not the length of active
data in the buffer. As it is, this can cause an ArrayIndexOutOfBoundException
in some circumstances.
This problem never occurred before JDK1.1.2 because the usage pattern for the
MultiplexInputStream was different. For 1.1.2, RMI uses BufferedInputStreams
on top of each connection (perhaps unnecessary for multiplex protocol
connections) and ObjectInputStream buffers the input of array of primitive
types, changing the practical use of the MultiplexInputStream.
The multiplex protocol was not supposed to be used with JDK 1.1 because
applets are now supposed to be able to create server socket (and thus it
must not have been tested since JDK 1.1.2), but the correct
functionality of the multiplex protocol may still be necessary to support
RMI applets with Internet Explorer 4.0.
john.bui@eng 1997-10-17
No specific test case available. Implicity tested, closed with exposure.