thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sinthuja Suhothayan <s.rajan.sin...@gmail.com>
Subject OutOfMemoryError in thrift server
Date Thu, 25 Sep 2014 16:20:51 GMT
Hi all,

I'm getting OutOfMemoryError in the thrift server when I'm sending events
from SSL client to non SSL port of thrift server. Stack trace is given [1].
Even though this is misconfiguration, it can be security issue, hence I
need to solve this problem.

I'm using older thrift version - 0.7.0 as my other components in the server
are depends on thrift 0.7.0. And also this issue only comes with java 7,
and with java 6, I'm not getting this issue and i'm getting the exception
[2] which is good.
I'm starting the thrift server as given in [3] at @method -
'startEventTransmission'. And you can find the client code in [4].

I have investigated the thrift code, and I noticed the following behaviour:

   1. Version written to the transport at the client in
   TBinaryProtocol.java @ line 91, is -2147418111.
   2. In java 6 - It's read by the thrift server, TBinaryProtocol.java @
   line 204 is -2140274429. Event though it's different from #1, it's taking a
   different path and resulting in 'Bad version in readMessageBegin', since
   the value is < 0.
   3. In java 7 - It's read by the thrift server, TBinaryProtocol.java @
   line 204 is -369295616.
   4. In the correct usecase where i send events to non SSL transport via
   non SSL client, then client and receiver is getting the same value
   TBinaryProtocol.java @ line 91, and @line 204, -2147418111.

I think there are some additional information is being added to the
transport in this case and it's being different from java 6 and java 7, and
resulting in the above behaviour.
How can I resolve this issue? Please provide some insight for this issue.

[1] [2014-09-25 18:24:55,804] ERROR {org.apache.cassandra.service.
CassandraDaemon} -  Exception in thread Thread[pool-20-thread-3,5,main]
java.lang.OutOfMemoryError: Java heap space
    at
org.apache.thrift.protocol.TBinaryProtocol.readStringBody(TBinaryProtocol.java:353)
    at
org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:215)
    at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:22)
    at
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:176)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

[2] [2014-09-23 14:43:02,909] ERROR {org.apache.thrift.server.
TThreadPoolServer} -  Thrift error occurred during processing of message.
org.apache.thrift.protocol.TProtocolException: Bad version in
readMessageBegin
    at
org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:208)
    at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:22)
    at
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:176)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)

[3]
https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/4.2.2/src/main/java/org/wso2/carbon/databridge/receiver/thrift/internal/ThriftDataReceiver.java

[4]
https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/data-bridge/org.wso2.carbon.databridge.agent.thrift/4.2.2/src/main/java/org/wso2/carbon/databridge/agent/thrift/internal/pool/client/secure/SecureClientPoolFactory.java

Thanks.
Sinthuja

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message