powered by Jive Software

BUG: Compression failures in 3.3.2

I upgraded from JM 2.1.4 (that’‘s right!) to Openfire 3.3.2 last night, and now I’‘m getting sporadic IO exceptions. I thought it might have something to do with DIRMINA-279, but I think 3.3.2 should already have that fix applied. Perhaps there are related bugs that I’'m hitting.

I can reproduce the error in Spark v2.5.4, Pandion v2.5 and PSI v0.11-RC1 .

The end result is that the client gets disconnected upon initial login, then eventually gets a good connection upon reconnects. Our rosters are published by Openfire to all the clients and everyone can see everyone else. We currently have about 125 users, so the initial roster download is bug for each user. Once you finally get that downloaded (without an IO exception), you can stay connected.

I’'d love to see a 3.3.3 release that fixes this or even test some openfire.jar builds. Thanks

Here’‘s a few sample backtraces that I’'m seeing:

Spark with TLS

[org.jivesoftware.openfire.nio.ConnectionHandler.exceptionCaught(ConnectionHand ler.java:109)]

java.lang.ArrayIndexOutOfBoundsException

at java.lang.System.arraycopy(Native Method)

at com.jcraft.jzlib.ZStream.read_buf(ZStream.java:199)

at com.jcraft.jzlib.Deflate.fill_window(Deflate.java:983)

at com.jcraft.jzlib.Deflate.deflate_slow(Deflate.java:1120)

at com.jcraft.jzlib.Deflate.deflate(Deflate.java:1567)

at com.jcraft.jzlib.ZStream.deflate(ZStream.java:133)

at org.apache.mina.filter.support.Zlib.deflate(Zlib.java:176)

at org.apache.mina.filter.CompressionFilter.filterWrite(CompressionFilter.java:198 )

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1400(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:824)

at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilte r.java:227)

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1400(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:824)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.filterWrite(Abs tractIoFilterChain.java:727)

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.fireFilterWrite(AbstractIo FilterChain.java:436)

at org.apache.mina.transport.socket.nio.SocketSessionImpl.write0(SocketSessionImpl .java:196)

at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:149)

at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:135)

at org.jivesoftware.openfire.nio.NIOConnection.deliver(NIOConnection.java:209)

at org.jivesoftware.openfire.session.ClientSession.deliver(ClientSession.java:728)

at org.jivesoftware.openfire.session.Session.process(Session.java:281)

at org.jivesoftware.openfire.net.SocketPacketWriteHandler.process(SocketPacketWrit eHandler.java:82)

at org.jivesoftware.openfire.spi.PacketDelivererImpl.deliver(PacketDelivererImpl.j ava:48)

at org.jivesoftware.openfire.spi.PresenceManagerImpl.probePresence(PresenceManager Impl.java:381)

at org.jivesoftware.openfire.handler.PresenceUpdateHandler.initSession(PresenceUpd ateHandler.java:205)

at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:104)

at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:88)

at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:151)

at org.jivesoftware.openfire.PresenceRouter.handle(PresenceRouter.java:123)

at org.jivesoftware.openfire.PresenceRouter.route(PresenceRouter.java:69)

at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:75)

at org.jivesoftware.openfire.net.StanzaHandler.processPresence(StanzaHandler.java: 306)

at org.jivesoftware.openfire.net.ClientStanzaHandler.processPresence(ClientStanzaH andler.java:85)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:231)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:153)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:132)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:703)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:62)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:200)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)

at org.apache.mina.filter.CompressionFilter.messageReceived(CompressionFilter.java :168)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :266)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:326)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Pandion with TLS

[org.jivesoftware.openfire.nio.ConnectionHandler.exceptionCaught(ConnectionHand ler.java:109)]

java.lang.ArrayIndexOutOfBoundsException

at java.lang.System.arraycopy(Native Method)

at com.jcraft.jzlib.ZStream.flush_pending(ZStream.java:170)

at com.jcraft.jzlib.Deflate.deflate(Deflate.java:1527)

at com.jcraft.jzlib.ZStream.deflate(ZStream.java:133)

at org.apache.mina.filter.support.Zlib.deflate(Zlib.java:176)

at org.apache.mina.filter.CompressionFilter.filterWrite(CompressionFilter.java:198 )

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1400(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:824)

at org.apache.mina.filter.executor.ExecutorFilter.filterWrite(ExecutorFilter.java: 292)

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1400(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:824)

at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilte r.java:227)

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1400(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:824)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.filterWrite(Abs tractIoFilterChain.java:727)

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.fireFilterWrite(AbstractIo FilterChain.java:436)

at org.apache.mina.transport.socket.nio.SocketSessionImpl.write0(SocketSessionImpl .java:196)

at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:149)

at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:135)

at org.jivesoftware.openfire.nio.NIOConnection.deliver(NIOConnection.java:209)

at org.jivesoftware.openfire.session.ClientSession.deliver(ClientSession.java:728)

at org.jivesoftware.openfire.session.Session.process(Session.java:281)

at org.jivesoftware.openfire.net.SocketPacketWriteHandler.process(SocketPacketWrit eHandler.java:82)

at org.jivesoftware.openfire.spi.PacketDelivererImpl.deliver(PacketDelivererImpl.j ava:48)

at org.jivesoftware.openfire.spi.PresenceManagerImpl.probePresence(PresenceManager Impl.java:381)

at org.jivesoftware.openfire.handler.PresenceUpdateHandler.initSession(PresenceUpd ateHandler.java:205)

at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:104)

at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:88)

at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:151)

at org.jivesoftware.openfire.PresenceRouter.handle(PresenceRouter.java:123)

at org.jivesoftware.openfire.PresenceRouter.route(PresenceRouter.java:69)

at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:75)

at org.jivesoftware.openfire.net.StanzaHandler.processPresence(StanzaHandler.java: 306)

at org.jivesoftware.openfire.net.ClientStanzaHandler.processPresence(ClientStanzaH andler.java:85)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:231)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:153)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:132)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:703)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:62)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:200)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :266)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:326)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Pandion without TLS

java.io.IOException: Compression failed with return value : -5

at org.apache.mina.filter.support.Zlib.deflate(Zlib.java:181)

at org.apache.mina.filter.CompressionFilter.filterWrite(CompressionFilter.java:198 )

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1400(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:824)

at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilte r.java:227)

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1400(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:824)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.filterWrite(Abs tractIoFilterChain.java:727)

at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:445)

at org.apache.mina.common.support.AbstractIoFilterChain.fireFilterWrite(AbstractIo FilterChain.java:436)

at org.apache.mina.transport.socket.nio.SocketSessionImpl.write0(SocketSessionImpl .java:196)

at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:149)

at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:135)

at org.jivesoftware.openfire.nio.NIOConnection.deliver(NIOConnection.java:209)

at org.jivesoftware.openfire.session.ClientSession.deliver(ClientSession.java:728)

at org.jivesoftware.openfire.session.Session.process(Session.java:281)

at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:315)

at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:104)

at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:67)

at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:289)

at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler .java:79)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:254)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:153)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:132)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:703)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:62)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:200)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :266)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:326)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

bump!

Hey Cameron,

We are using the latest MINA version in trunk (SVN). The code in trunk belongs to Openfire 3.4.0 that was already refactored to support clustering. Moreover, all of our public servers are using the version built from trunk and things are looking fine.

I think that there are 2 options for you. 1) Download code from trunk and create a new build or 2) Download code from trunk to just copy the new mina jira files to your 3.3.2 setup. Create a new build of 3.3.2 with the latest MINA. FYI, our MINA version is the latest MINA (of 1.1.) plus one or two classes that were modified. If you go with option 1 then remember to update your plugins.

Regards,

– Gato

Oh, you have a third option if you just want to test the latest MINA. Try connecting with your clients to jivesoftware.com or igniterealtime.org and see how it goes.

Regards,

– Gato

Regarding Option #3, I’‘ve attempted to connect to jivesoftware.com, but it looks like compression is disabled on the server. Here’'s the feature stanza I see:

Option #1 & #2 are less appealing right now since I have Option #4 available: disable Compression, convince Gato that it’'s a bug and wait for a fix in the next build.

BTW, I assume you’'re using Spark. You have to tell Spark to explicitly use Compression in the Advanced settings window of the Login screen. Same goes for PSI-0.11-RC1. Pandion attempts to use Compression by default.

Gato,

I’‘ve tried reproducing the error against the jivesoftware.com server now that compression is enabled, but I can’‘t get the bug to show itself. Either the bug is fixed in trunk or I just don’‘t have enough of a roster to download on the jivesoftware.com site to be able to trigger it. Here at our location, we’'re up over 150 users in the roster. My jivesoftware.com roster has 8 users via the AIM gateway.

So, at this point, I’'m just going to wait for the next release and do my testing then to see if I am able to reproduce with a larger roster.

Thanks

Ok. Meanwhile I will leave it enabled here and will check the logs.

– Gato

While testing my patch for JM-865, I did some testing locally on my workstation to try to reproduce this bug and haven’‘t been able to reproduce it using Openfire trunk rev 8812. So, it looks like it may be fixed in trunk, but I’'ll be sure to do some tests on my production server when 3.4 is released. Thanks