Discussion:
[Rabbit-dev] StackOverflowError
Mindaugas Žakšauskas
2011-06-17 08:51:24 UTC
Permalink
Hi,

I am getting this exception on rare occasions, has anybody seen it before?

Exception in thread "org.khelekore.rnio.impl.SingleSelectorRunner 0"
java.lang.StackOverflowError
at java.util.logging.Logger.getLogger(Logger.java:287)
at rabbit.httpio.BaseSocketHandler.<init>(BaseSocketHandler.java:24)
at rabbit.httpio.BlockSender.<init>(BlockSender.java:37)
at rabbit.handler.BaseHandler.bufferRead(BaseHandler.java:493)
at rabbit.httpio.ChunkHandler.handleChunkData(ChunkHandler.java:164)
at rabbit.httpio.ChunkHandler.handleData(ChunkHandler.java:74)
at rabbit.httpio.WebConnectionResourceSource.handleBlock(WebConnectionResourceSource.java:100)
at rabbit.httpio.WebConnectionResourceSource.addBlockListener(WebConnectionResourceSource.java:81)
at rabbit.handler.BaseHandler.blockSent(BaseHandler.java:504)
at rabbit.httpio.BlockSender.writeBuffer(BlockSender.java:98)
at rabbit.httpio.BlockSender.write(BlockSender.java:82)
at rabbit.handler.BaseHandler.bufferRead(BaseHandler.java:497)
at rabbit.httpio.ChunkHandler.handleChunkData(ChunkHandler.java:164)
at rabbit.httpio.ChunkHandler.handleData(ChunkHandler.java:74)

(pattern repeaded many many times, last bottom lines are below)

at rabbit.httpio.ChunkHandler.handleData(ChunkHandler.java:74)
at rabbit.httpio.WebConnectionResourceSource.handleBlock(WebConnectionResourceSource.java:100)
at rabbit.httpio.WebConnectionResourceSource.addBlockListener(WebConnectionResourceSource.java:81)

Needless to say, this causes Rabbit to die silently :(

Regards,
Mindaugas
Robert Olofsson
2011-06-17 12:23:16 UTC
Permalink
On Fri, 17 Jun 2011 09:51:24 +0100
Post by Mindaugas Žakšauskas
I am getting this exception on rare occasions, has anybody seen it before?
Exception in thread "org.khelekore.rnio.impl.SingleSelectorRunner 0"
java.lang.StackOverflowError
What version of rabbit are you using?
I have not seen such things for a long time.

/robo
Mindaugas Žakšauskas
2011-06-17 12:46:27 UTC
Permalink
Sorry, this is Rabbit 4.7 - should have mentioned that.

Also, this occurs very, very rarely and is obviously non-reproducible
under normal circumstances.

m.

On Fri, Jun 17, 2011 at 1:23 PM, Robert Olofsson
Post by Robert Olofsson
On Fri, 17 Jun 2011 09:51:24 +0100
Post by Mindaugas Žakšauskas
I am getting this exception on rare occasions, has anybody seen it before?
Exception in thread "org.khelekore.rnio.impl.SingleSelectorRunner 0"
java.lang.StackOverflowError
What version of rabbit are you using?
I have not seen such things for a long time.
/robo
_______________________________________________
Rabbit-dev mailing list
Rabbit-dev at khelekore.org
http://khelekore.org/cgi-bin/mailman/listinfo/rabbit-dev
Ping ni
2011-06-17 12:57:23 UTC
Permalink
When there are flood concurrency number, it would occur. you can check the
condition for the var time in the class throwed exceptions.

On Fri, Jun 17, 2011 at 8:23 PM, Robert Olofsson <
Post by Robert Olofsson
On Fri, 17 Jun 2011 09:51:24 +0100
Post by Mindaugas Žakšauskas
I am getting this exception on rare occasions, has anybody seen it
before?
Post by Mindaugas Žakšauskas
Exception in thread "org.khelekore.rnio.impl.SingleSelectorRunner 0"
java.lang.StackOverflowError
What version of rabbit are you using?
I have not seen such things for a long time.
/robo
_______________________________________________
Rabbit-dev mailing list
Rabbit-dev at khelekore.org
http://khelekore.org/cgi-bin/mailman/listinfo/rabbit-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khelekore.org/pipermail/rabbit-dev/attachments/20110617/c106f62f/attachment.html>
Robert Olofsson
2011-06-26 15:00:49 UTC
Permalink
On Fri, 17 Jun 2011 09:51:24 +0100
Post by Mindaugas Žakšauskas
Exception in thread "org.khelekore.rnio.impl.SingleSelectorRunner 0"
java.lang.StackOverflowError
at java.util.logging.Logger.getLogger(Logger.java:287)
at rabbit.httpio.BaseSocketHandler.<init>(BaseSocketHandler.java:24)
at rabbit.httpio.BlockSender.<init>(BlockSender.java:37)
at rabbit.handler.BaseHandler.bufferRead(BaseHandler.java:493)
at rabbit.httpio.ChunkHandler.handleChunkData(ChunkHandler.java:164)
at rabbit.httpio.ChunkHandler.handleData(ChunkHandler.java:74)
Ok, I have identified this problem, it comes from web pages that send back a
big block of data (from a web page) with chunked data and each chunk is only
a few bytes long, basically the data looks like:

3
<ht
3
ml>
5
<body
1
...

Chunked data has a minimal header that tells how big the next chunk is and
then that number of bytes of data.

This can happen with BaseHandler and with GZipHandler/FilterHandler.

Ok, now I figure out a way to remove this problem.

/robo
Mindaugas Žakšauskas
2011-06-26 18:06:02 UTC
Permalink
Great news, let me/us know when this is ready to be tested!

m.

On Sun, Jun 26, 2011 at 4:00 PM, Robert Olofsson
Post by Robert Olofsson
Ok, I have identified this problem, it comes from web pages that send back a
big block of data (from a web page) with chunked data and each chunk is only
3
<ht
3
ml>
5
<body
1
...
Chunked data has a minimal header that tells how big the next chunk is and
then that number of bytes of data.
This can happen with BaseHandler and with GZipHandler/FilterHandler.
Ok, now I figure out a way to remove this problem.
/robo
_______________________________________________
Rabbit-dev mailing list
Rabbit-dev at khelekore.org
http://khelekore.org/cgi-bin/mailman/listinfo/rabbit-dev
Robert Olofsson
2011-06-27 22:40:59 UTC
Permalink
Hello!

On Sun, 26 Jun 2011 19:06:02 +0100
Post by Mindaugas Žakšauskas
Great news, let me/us know when this is ready to be tested!
If you have the time to help me testing the current git head
it would be good. I have made three changes in the code to fix
this problem:
----------------------------------------------------------------
commit 66e1b4bd47cb761c14c40260de5d6880d48a2e10
Author: Robert Olofsson <robo at khelekore.org>
Date: Tue Jun 28 00:23:11 2011 +0200

Try to merge all chunks so that we do not get StackOverFlow when
we have lots of small chunks in a buffer.

commit 062d543510047edae7a45acb90d58d31d63f6a33
Author: Robert Olofsson <robo at khelekore.org>
Date: Mon Jun 27 23:53:29 2011 +0200

Flip the buffer so that we can grow and copy it correctly when needed.

commit 04f723e314512d31303c5d393e2a35673425172c
Author: Robert Olofsson <robo at khelekore.org>
Date: Mon Jun 27 23:52:57 2011 +0200

Just return the buffer if it is already large.
----------------------------------------------------------------

only the top one is directly related to this, but I did find the
other two will testing this chunk merging and I had to fix them to
be able to fully test the chunk merging.

I had an alternative that is a bit cheaper in copy-cost, but requires
so much changes that I think that will have to wait until I decide
to make rabbit v5 (and that may take quite a lot of time :-).

/robo

Loading...