Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayIndexOutOfBoundsException in ChannelOutboundBuffer #1890

Closed
normanmaurer opened this issue Oct 6, 2013 · 0 comments
Closed

ArrayIndexOutOfBoundsException in ChannelOutboundBuffer #1890

normanmaurer opened this issue Oct 6, 2013 · 0 comments
Assignees
Labels
Milestone

Comments

@normanmaurer
Copy link
Member

The problem is when the doubling of the nioBuffers array is not enough to hold all the buffers. We need to double as long as it not fit in.

The following stacktrace happens when you try to call nioBuffers() and you have added 65+ messages to it before:

 java.lang.ArrayIndexOutOfBoundsException: 64
    at io.netty.channel.ChannelOutboundBuffer.fillBufferArray(ChannelOutboundBuffer.java:377)
    at io.netty.channel.ChannelOutboundBuffer.nioBuffers(ChannelOutboundBuffer.java:357)
    at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:236)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:680)
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.forceFlush(AbstractNioChannel.java:266)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:488)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
    at java.lang.Thread.run(Thread.java:722)

@ghost ghost assigned normanmaurer Oct 6, 2013
normanmaurer pushed a commit that referenced this issue Oct 6, 2013
The problem was that we did not handle the case correctly when doubling the array was not enough. We need to keep doubling until everything fits in.
normanmaurer pushed a commit that referenced this issue Oct 6, 2013
The problem was that we did not handle the case correctly when doubling the array was not enough. We need to keep doubling until everything fits in.
@normanmaurer normanmaurer mentioned this issue Oct 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant