You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Henrique Andrade (JIRA)" <ji...@apache.org> on 2017/12/03 19:56:01 UTC

[jira] [Created] (THRIFT-4402) Minimize global uninitialized symbol leakage (TSocket::useLowMinRto_)

Henrique Andrade created THRIFT-4402:
----------------------------------------

             Summary: Minimize global uninitialized symbol leakage (TSocket::useLowMinRto_)
                 Key: THRIFT-4402
                 URL: https://issues.apache.org/jira/browse/THRIFT-4402
             Project: Thrift
          Issue Type: Bug
          Components: C++ - Library
    Affects Versions: 0.10.0
            Reporter: Henrique Andrade
            Priority: Trivial


Since the symbol TSocket::useLowMinRto_ is only used in TSocket.cpp, it can be declared and made static in TSocket.cpp.

This way it will not be a global symbol in the corresponding shared file.

```
> nm -C ./lib/cpp/src/thrift/transport/TSocket.o | grep " B "
0000000000000000 B apache::thrift::transport::TSocket::useLowMinRto_
```

Unnecessary exposed global symbols like this can cause subtle dynamic linking errors:

https://stackoverflow.com/questions/6714046/c-linux-double-destruction-of-static-variable-linking-symbols-overlap



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)