[llvm-bugs] [Bug 30642] New: Regression(281673): libc++ leaks always-visible symbols into programs

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 7 15:25:31 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30642

            Bug ID: 30642
           Summary: Regression(281673): libc++ leaks always-visible
                    symbols into programs
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

thakis-macpro:llvm-build thakis$ cat test.cc
#include <string.h>
#include <string>
int main(int argc, char* argv[]) {
  std::string b(argv[0], strlen(argv[0]));
  b.insert(b.end(), argv[1], argv[1] + strlen(argv[1]));
}

$ bin/clang++ -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -c
test.cc -isysroot $(xcrun -show-sdk-path) && nm -m test.o | grep insert
0000000000001dc0 (__TEXT,__text) weak external
__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertIPKcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPcEEE4typeENSB_IS8_EESA_SA_
00000000000007c0 (__TEXT,__text) weak external
__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertIPcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueENS_11__wrap_iterIS7_EEE4typeENSA_IPKcEES9_S9_


Prior to r281673, these used to be "weak private external" (note private). This
is a problem since these functions will leak from programs that try to control
which functions they export.


(Condensed from the longer report at
https://bugs.chromium.org/p/chromium/issues/detail?id=653337#c16)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161007/4d7cc2f9/attachment.html>


More information about the llvm-bugs mailing list