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

IndexOutOfBoundsException when receiving Datagrams on LG Optimus L5 #1079

Closed
dfyx opened this issue Feb 22, 2013 · 2 comments
Closed

IndexOutOfBoundsException when receiving Datagrams on LG Optimus L5 #1079

dfyx opened this issue Feb 22, 2013 · 2 comments

Comments

@dfyx
Copy link

dfyx commented Feb 22, 2013

First of all: I'm not entirely sure if this is a netty problem or not.

I'm developing an android app that uses netty as its network library. On one of the phones I use for testing (LG Optimus L5 a.k.a. LG E610, Android 4.0.3) I get an exception whenever a UDP packet is received:

02-22 15:10:44.241: W/System.err(10342): java.lang.IndexOutOfBoundsException: length=2, offset=0, buffer size=0
02-22 15:10:44.241: W/System.err(10342):    at java.net.DatagramPacket.setLengthOnly(DatagramPacket.java:237)
02-22 15:10:44.251: W/System.err(10342):    at libcore.io.IoBridge.postRecvfrom(IoBridge.java:529)
02-22 15:10:44.251: W/System.err(10342):    at libcore.io.IoBridge.recvfrom(IoBridge.java:516)
02-22 15:10:44.251: W/System.err(10342):    at java.nio.DatagramChannelImpl.receiveDirectImpl(DatagramChannelImpl.java:232)
02-22 15:10:44.261: W/System.err(10342):    at java.nio.DatagramChannelImpl.receive(DatagramChannelImpl.java:185)
02-22 15:10:44.261: W/System.err(10342):    at org.jboss.netty.channel.socket.nio.NioDatagramWorker.read(NioDatagramWorker.java:73)
02-22 15:10:44.271: W/System.err(10342):    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
02-22 15:10:44.271: W/System.err(10342):    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
02-22 15:10:44.271: W/System.err(10342):    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
02-22 15:10:44.271: W/System.err(10342):    at org.jboss.netty.channel.socket.nio.NioDatagramWorker.run(NioDatagramWorker.java:343)
02-22 15:10:44.271: W/System.err(10342):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
02-22 15:10:44.281: W/System.err(10342):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
02-22 15:10:44.281: W/System.err(10342):    at java.lang.Thread.run(Thread.java:856)

It looks as if somewhere deep inside the standard library the packet length is set to something longer than the available data. I'm not sure if this is a bug in the standard library, some mistake made by netty or a combination of both.

I've successfully tested the app on an HTC Desire C (Android 4.0.3), Samsung Galaxy S3 (Android 4.2.0) and several older Samsungs with Android 2, so it's not a general Android problem.

@normanmaurer
Copy link
Member

@dfyx there is nothing we can do about it in netty. It is a bug in the android version or the native code on the device.

@dfyx
Copy link
Author

dfyx commented Feb 26, 2013

Alright, just wanted to have that confirmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants