Buffer Overflow and Null Pointer Exceptions in 1.4.3

179 views
Skip to first unread message

ashwin nagarajan

unread,
Mar 5, 2012, 7:03:41 AM3/5/12
to Hazelcast
Hi,

Following exceptions are observed in our server logs :

2012-03-05 12:09:22,870 [hz.1.InThread] WARN Slf4jFactory$Slf4jLogger
- [p-ki2-48] hz.1.InThread Closing socket to endpoint null,
Cause:java.lang.NullPointerException
java.lang.NullPointerException
at com.hazelcast.nio.IOUtil.copyToHeapBuffer(IOUtil.java:58)
at
com.hazelcast.impl.ascii.rest.HttpPostCommand.doActualRead(HttpPostCommand.java:
95)
at
com.hazelcast.impl.ascii.rest.HttpPostCommand.doRead(HttpPostCommand.java:
55)
at
com.hazelcast.nio.ascii.SocketTextReader.doRead(SocketTextReader.java:
104)
at
com.hazelcast.nio.ascii.SocketTextReader.read(SocketTextReader.java:
85)
at com.hazelcast.nio.ReadHandler.handle(ReadHandler.java:86)
at com.hazelcast.nio.SelectorBase.run(SelectorBase.java:144)
at java.lang.Thread.run(Thread.java:662)

2012-03-05 12:09:09,625 [hz.1.InThread] WARN Slf4jFactory$Slf4jLogger
- [p-ki2-48] hz.1.InThread Closing socket to endpoint null,
Cause:java.nio.BufferOverflowException
java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:497)
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:156)
at
com.hazelcast.nio.ascii.SocketTextReader.doRead(SocketTextReader.java:
96)
at
com.hazelcast.nio.ascii.SocketTextReader.read(SocketTextReader.java:
85)
at com.hazelcast.nio.ReadHandler.handle(ReadHandler.java:86)
at com.hazelcast.nio.SelectorBase.run(SelectorBase.java:144)
at java.lang.Thread.run(Thread.java:662)

Application uses hazelcast 1.4.3 with three distributed map objects .
These exceptions doesnt seem to impact server operation but occurs
randomly . does this happen due to size restrictions when copying
socket data to buffer ?

Any ideas on the cause and how to rectify ?

Thanks
Ashwin

Talip Ozturk

unread,
Mar 5, 2012, 7:43:05 AM3/5/12
to haze...@googlegroups.com
Can you try reproducing it with hazelcast 2.0? It is very likely to be fixed.

-talip

> --
> You received this message because you are subscribed to the Google Groups "Hazelcast" group.
> To post to this group, send email to haze...@googlegroups.com.
> To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.
>

ashwin nagarajan

unread,
Mar 5, 2012, 8:16:16 AM3/5/12
to Hazelcast
Hi

Since this version is currently running in Production environment live
to millions of users, upgrade is immediately not possible . Since we
are not able to reproduce this in our testing environment, is it
possible to find the actual cause for such a behaviour ?

Secondly, is there a way to find out the preallocated or configured
buffer size used by hazelcast when reading data from socket ? I
believe this problem pertains to restrictions in heap buffer size used
by hazelcast .

Or, is this configured somehow from the hazelcast side as we dont see
any such configurations in our application ?

Thanks fr ur help

Ashwin

On Mar 5, 5:43 pm, Talip Ozturk <ta...@hazelcast.com> wrote:
> Can you try reproducing it with hazelcast 2.0? It is very likely to be fixed.
>
> -talip
>
>
>
> On Mon, Mar 5, 2012 at 2:03 PM, ashwin nagarajan <ashwinn...@gmail.com> wrote:
> > Hi,
>
> > Following exceptions are observed in our server logs :
>
> > 2012-03-05 12:09:22,870 [hz.1.InThread] WARN Slf4jFactory$Slf4jLogger
> > - [p-ki2-48] hz.1.InThread Closing socket to endpoint null,
> > Cause:java.lang.NullPointerException
> > java.lang.NullPointerException
> >        at com.hazelcast.nio.IOUtil.copyToHeapBuffer(IOUtil.java:58)
> >        at
> > com.hazelcast.impl.ascii.rest.HttpPostCommand.doActualRead(HttpPostCommand.­java:
> > For more options, visit this group athttp://groups.google.com/group/hazelcast?hl=en.- Hide quoted text -
>
> - Show quoted text -

ashwin nagarajan

unread,
Mar 6, 2012, 10:01:00 AM3/6/12
to Hazelcast
Guys..

Any help ?

I find that the buffer size for socket read and write is configured 32
KB . Any idea if it was the same for 1.4.3 ? And the above exceptions
relate to this parameter ?

Talip Ozturk

unread,
Mar 6, 2012, 10:09:15 AM3/6/12
to haze...@googlegroups.com
it was same for 1.9.4.3. I don't think it is related to buffer size at all.

Hazelcast is receiving Http Post request which some how either doesn't
have 'Content-Length' header or its format wasn't properly handled by
Hazelcast. I think that is the root cause. If you can find a way to
reproduce it then fix is easy.

-talip

Reply all
Reply to author
Forward
0 new messages