powered by Jive Software

Openfire 3.7.0 broken for unicode status messages

Sending a presence packet with a unicode status message causes Openfire 3.7.0 to terminate the session connection with the following logging info:

2011.04.26 19:21:42 Closing session due to exception: (SOCKET, R: /127.0.0.1:56159, L: /127.0.0.1:5222, S: 0.0.0.0/0.0.0.0:5222)

org.apache.mina.filter.codec.ProtocolDecoderException: java.nio.charset.MalformedInputException: Input length = 2 (Hexdump: 3C 69 71 20 74 79 70 65 3D 22 73 65 74 22 20 69 64 3D 22 35 22 3E 3C 71 75 65 72 79 20 78 6D 6C 6E 73 3D 22 6A 61 62 62 65 72 3A 69 71 3A 72 65 67 69 73 74 65 72 22 3E 3C 75 73 65 72 6E 61 6D 65 3E 38 38 38 38 38 38 3C 2F 75 73 65 72 6E 61 6D 65 3E 3C 70 61 73 73 77 6F 72 64 3E 6A 40 62 62 33 72 73 74 31 67 3C 2F 70 61 73 73 77 6F 72 64 3E 3C 6E 61 6D 65 3E E8 87 AA E7 94 B1 E8 81)

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

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

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

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

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

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

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 650)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.nio.charset.MalformedInputException: Input length = 2

at java.nio.charset.CoderResult.throwException(CoderResult.java:260)

at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:771)

at org.jivesoftware.openfire.nio.XMLLightweightParser.read(XMLLightweightParser.ja va:183)

at org.jivesoftware.openfire.nio.XMPPDecoder.doDecode(XMPPDecoder.java:41)

at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtoco lDecoder.java:133)

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

… 9 more

How do I file a bug report or does anyone have a workaround fix for this?

Can’t reproduce with Spark (setting the unicode message, using cyrillic and baltic symbols) and Exodus (reading the unicode status message) on Openfire 3.7.0. Embedded-db, apparently using utf-8 as i have no problems sending and receiving unicode messages.

I am not using embedded-db. I am using a mysql backend when this error occurs.

I have narrowed it down. It IS NOT every unicode message that causes this error. It is a very specific sequence of characters. I have narrowed it down to the following presence packet/status that will cause the problem:

login

DO NOT send the initial roster request.

send the packet with the status update (replace username and password as appropriate). The name payload is:

‘\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x8 7\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe 8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xa a\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x8 7\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe 8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xa a\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x8 7\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe 8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa\xe8\x87\xaa’

XXX

XXX

自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自自

This will cause openfire to error and close the connection with the following in the warn.log:

2011.04.27 18:58:41 Closing session due to exception: (SOCKET, R: /127.0.0.1:64330, L: /127.0.0.1:5222, S: 0.0.0.0/0.0.0.0:5222)

org.apache.mina.filter.codec.ProtocolDecoderException: java.nio.charset.MalformedInputException: Input length = 2 (Hexdump: 3C 69 71 20 74 79 70 65 3D 22 73 65 74 22 20 69 64 3D 22 33 22 3E 3C 71 75 65 72 79 20 78 6D 6C 6E 73 3D 22 6A 61 62 62 65 72 3A 69 71 3A 72 65 67 69 73 74 65 72 22 3E 3C 75 73 65 72 6E 61 6D 65 3E 74 65 73 74 31 3C 2F 75 73 65 72 6E 61 6D 65 3E 3C 70 61 73 73 77 6F 72 64 3E 6A 40 62 62 33 72 73 74 31 67 3C 2F 70 61 73 73 77 6F 72 64 3E 3C 6E 61 6D 65 3E E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87)

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

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

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

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

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

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

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 651)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)

at java.lang.Thread.run(Thread.java:613)

Caused by: java.nio.charset.MalformedInputException: Input length = 2

at java.nio.charset.CoderResult.throwException(CoderResult.java:260)

at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:771)

at org.jivesoftware.openfire.nio.XMLLightweightParser.read(XMLLightweightParser.ja va:183)

at org.jivesoftware.openfire.nio.XMPPDecoder.doDecode(XMPPDecoder.java:41)

at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtoco lDecoder.java:133)

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

… 9 more

2011.04.27 18:58:41 Closing session due to exception: (SOCKET, R: /127.0.0.1:64330, L: /127.0.0.1:5222, S: 0.0.0.0/0.0.0.0:5222)

org.apache.mina.filter.codec.ProtocolDecoderException: java.nio.charset.MalformedInputException: Input length = 1 (Hexdump: AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA E8 87 AA 3C 2F 6E 61 6D 65 3E 3C 2F 71 75 65 72 79 3E 3C 2F 69 71 3E)

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

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

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

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

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

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

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 651)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)

at java.lang.Thread.run(Thread.java:613)

Caused by: java.nio.charset.MalformedInputException: Input length = 1

at java.nio.charset.CoderResult.throwException(CoderResult.java:260)

at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:771)

at org.jivesoftware.openfire.nio.XMLLightweightParser.read(XMLLightweightParser.ja va:183)

at org.jivesoftware.openfire.nio.XMPPDecoder.doDecode(XMPPDecoder.java:41)

at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtoco lDecoder.java:133)

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

… 9 more

Ok, This is hard for me to reproduce, but i will file this. OF-455

I’m able to reproduce this issue when sending emoji’s as either the presence or within a message on ios.

Same here, see http://community.igniterealtime.org/thread/48846?tstart=0

You can cut & paste the emoticons from the wikipedia page.