Skip to content

Can't use PooledByteBufAllocator with SCTP #1920

Closed

Description

@perrinz

Since 4.0.7.Final I've not been able to use PooledByteBufAllocator with the SCTP transport. The problem appears to have been introduced by 48a7a21 for issue #1697.

I checked to see if the same problem happens with the SCTP example, and it does -- if .option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) is added to the Bootstrap in NioSctpEchoClient, then simply running the server and client results in the following:

INFO: [id: 0x19eb15bb, /192.168.0.120:39359 => /192.168.0.120:2556] FLUSH
Oct 14, 2013 4:52:19 PM io.netty.handler.logging.LoggingHandler exceptionCaught
INFO: [id: 0x19eb15bb, /192.168.0.120:39359 => /192.168.0.120:2556] EXCEPTION: java.lang.IndexOutOfBoundsException: writerIndex: 14526720 (expected: readerIndex(0) <= writerIndex <= capacity(1024))
java.lang.IndexOutOfBoundsException: writerIndex: 14526720 (expected: readerIndex(0) <= writerIndex <= capacity(1024))
    at io.netty.buffer.AbstractByteBuf.writerIndex(AbstractByteBuf.java:87)
    at io.netty.channel.sctp.nio.NioSctpChannel.doReadMessages(NioSctpChannel.java:281)
    at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:71)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:478)
    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$5.run(SingleThreadEventExecutor.java:801)
    at java.lang.Thread.run(Thread.java:724)

The same thing happens if .childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) is added the server bootstrap in NioSctpEchoServer.

Activity

  1. added 2 commits that reference this issue on Oct 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions