You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by dawiddr <gi...@git.apache.org> on 2016/08/15 13:58:20 UTC

[GitHub] thrift pull request #1065: Remove AC_FUNC_MALLOC and AC_FUNC_REALLOC to fix ...

GitHub user dawiddr opened a pull request:

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

    Remove AC_FUNC_MALLOC and AC_FUNC_REALLOC to fix building with Address Sanitizer

    Compilation of Thrift fails when Clang with Address Sanitizer is used:
    
    ```
    $ ./bootstrap.sh
    $ ./configure CC=/usr/bin/clang-3.8 CXX=/usr/bin/clang++-3.8 LD=/usr/bin/clang-3.8 CPPFLAGS=-fsanitize=address CFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address
    $ make
    
    libtool: compile:  /usr/bin/clang++-3.8 -DHAVE_CONFIG_H -I. -I../.. -I../../lib/cpp/src/thrift -I../../lib/c_glib/src/thrift -I/usr/include -I/home/drechny/.linuxbrew/Cellar/openssl/1.0.2c/include -I./src -D__STDC_LIMIT_MACROS -fsanitize=address -Wall -Wextra -pedantic -g -O2 -std=c++11 -MT src/thrift/TApplicationException.lo -MD -MP -MF src/thrift/.deps/TApplicationException.Tpo -c src/thrift/TApplicationException.cpp -o src/thrift/TApplicationException.o
    In file included from src/thrift/TApplicationException.cpp:20:
    In file included from ./src/thrift/TApplicationException.h:23:
    In file included from ./src/thrift/Thrift.h:37:
    In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.1.1/../../../../include/c++/6.1.1/string:52:
    In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.1.1/../../../../include/c++/6.1.1/bits/basic_string.h:5402:
    In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.1.1/../../../../include/c++/6.1.1/ext/string_conversions.h:41:
    /usr/bin/../lib/gcc/x86_64-linux-gnu/6.1.1/../../../../include/c++/6.1.1/cstdlib:159:11: error: no member named 'realloc' in the global namespace
      using ::realloc;
            ~~^
    1 error generated.
    ```
    
    The reason of the failure is nicely described here: http://darmawan-salihun.blogspot.nl/2016/01/sanitizing-your-cc-code.html
    
    This pull request removes `AC_FUNC_MALLOC` and `AC_FUNC_REALLOC` from `configure.ac` file, what fixes the problem. This assumes that those function don't serve any real purpose in Thrift, which of course might not be true.
    
    Note that after applying this change there are some memory leaks generated during build process. In order to make it succeed `LSAN_OPTIONS=exitcode=0` environment variable has to be set.

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

    $ git pull https://github.com/dawiddr/thrift address-sanitizer-build

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

    https://github.com/apache/thrift/pull/1065.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 #1065
    
----
commit 3496384e66431c0d566cc1fde89b739f22cd4391
Author: Dawid Drechny <da...@tomtom.com>
Date:   2016-08-15T13:42:44Z

    Remove AC_FUNC_MALLOC and AC_FUNC_REALLOC

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift issue #1065: Remove AC_FUNC_MALLOC and AC_FUNC_REALLOC to fix buildin...

Posted by jeking3 <gi...@git.apache.org>.
Github user jeking3 commented on the issue:

    https://github.com/apache/thrift/pull/1065
  
    I created THRIFT-4045 for this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request #1065: Remove AC_FUNC_MALLOC and AC_FUNC_REALLOC to fix ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift issue #1065: Remove AC_FUNC_MALLOC and AC_FUNC_REALLOC to fix buildin...

Posted by jeking3 <gi...@git.apache.org>.
Github user jeking3 commented on the issue:

    https://github.com/apache/thrift/pull/1065
  
    Opened a new PR under https://github.com/apache/thrift/pull/1169.  This can be closed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---