[ 
https://issues.apache.org/jira/browse/THRIFT-2536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14711501#comment-14711501
 ] 

ASF GitHub Bot commented on THRIFT-2536:
----------------------------------------

GitHub user evanj opened a pull request:

    https://github.com/apache/thrift/pull/595

    THRIFT-2536: Java: TBinaryProtocol: Use a single temp byte[] buffer

    Reduces allocations and GC when TBinaryProtocol is allocated repeatedly.
    
    Originally separate byte[] arrays were allocated for each integer type, and
    a separate array for input and output. However, one buffer of the largest
    size (8 bytes for i64) can be used for all purposes.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/evanj/thrift THRIFT-2536

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/595.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #595
    
----
commit 9a5668e8f2afd1440a94952091bec9f3da64dd3e
Author: Evan Jones <ejo...@twitter.com>
Date:   2015-08-25T15:51:07Z

    THRIFT-2536: Java: TBinaryProtocol: Use a single temp byte[] buffer
    
    Reduces allocations and GC when TBinaryProtocol is allocated repeatedly.
    
    Originally separate byte[] arrays were allocated for each integer type, and
    a separate array for input and output. However, one buffer of the largest
    size (8 bytes for i64) can be used for all purposes.

----


> new TSocket, uninitialised value reported by valgrind
> -----------------------------------------------------
>
>                 Key: THRIFT-2536
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2536
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 1.0
>         Environment: BSD, Valgrind
>            Reporter: Christoph Wollgarten
>            Priority: Minor
>
> ========================================================================================
> src:
> https://apache.googlesource.com/thrift/+/master/lib/cpp/src/thrift/transport/TSocket.cpp
> ========================================================================================
> code:
> boost::shared_ptr<TSocket> socket(new TSocket("192.168.0.1", 9090));
> boost::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
> boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
> LancomLocationBasedServices::LbsControlClient client(protocol);
> transport->open();
> ========================================================================================
> valgrind --leak-check=yes --track-origins=yes binary
> =>
> ==49066== Conditional jump or move depends on uninitialised value(s)
> ==49066==    at 0x136A443: 
> apache::thrift::transport::TSocket::openConnection(addrinfo*) 
> (TSocket.cpp:309)
> ==49066==    by 0x136B3F8: apache::thrift::transport::TSocket::local_open() 
> (TSocket.cpp:392)
>              by *********: transport->open()
> ==49066==  Uninitialised value was created by a stack allocation
> ==49066==    at 0x136A14D: 
> apache::thrift::transport::TSocket::openConnection(addrinfo*) 
> (TSocket.cpp:180)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to