Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Issue 2019183002: Restore the -fvisibility=hidden flag for tcmalloc when using allocator shim. (Closed)

Created:
4 years, 6 months ago by pcc1
Modified:
4 years, 6 months ago
CC:
chromium-reviews, wfh+watch_chromium.org, Dai Mikurube (NOT FULLTIME), Will Harris
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Restore the -fvisibility=hidden flag for tcmalloc when using allocator shim. Hidden visibility was initially disabled for tcmalloc in https://codereview.chromium.org/343037 as a workaround for a lack of symbol visibility annotations in the source. These annotations were finally added as part of the new allocator shim (see //base/allocator/allocator_shim_override_glibc_weak_symbols.h and //base/allocator/allocator_shim_internals.h for the definition of SHIM_ALWAYS_EXPORT). Hence it is no longer necessary to compile tcmalloc with default visibility when using the allocator shim. This fixes an issue where some of tcmalloc's internal classes were being compiled with default visibility in the implementation and with hidden visibility in clients. This is technically an ODR violation, but not normally a significant one. The ODR violation was exposed by an upcoming LLVM change [1] that enables the relative C++ ABI for (approximately) classes with hidden visibility. [1] http://reviews.llvm.org/D20749 BUG=589384 R=primiano@chromium.org, thakis@chromium.org Committed: https://crrev.com/1110ac7a5c525ab81105a8cf7be2f7b59d669657 Cr-Commit-Position: refs/heads/master@{#397015}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -5 lines) Patch
M base/allocator/BUILD.gn View 1 chunk +10 lines, -2 lines 0 comments Download
M base/allocator/allocator.gyp View 2 chunks +13 lines, -3 lines 0 comments Download

Messages

Total messages: 20 (6 generated)
pcc1
4 years, 6 months ago (2016-05-28 01:53:18 UTC) #1
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2019183002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2019183002/1
4 years, 6 months ago (2016-05-28 01:55:30 UTC) #3
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-05-28 04:20:13 UTC) #5
Primiano Tucci (use gerrit)
This patch makes and LGTM. I never realized that we were exporting, at the final ...
4 years, 6 months ago (2016-05-31 07:51:36 UTC) #6
pcc1
Thanks Primiano. On 2016/05/31 07:51:36, Primiano Tucci wrote: > The only suspicious symbols I see ...
4 years, 6 months ago (2016-05-31 20:57:21 UTC) #7
Nico
lgtm FWIW on OS X we check at build time that we only export a ...
4 years, 6 months ago (2016-05-31 21:08:53 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2019183002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2019183002/1
4 years, 6 months ago (2016-05-31 21:14:29 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/79414)
4 years, 6 months ago (2016-05-31 23:54:08 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2019183002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2019183002/1
4 years, 6 months ago (2016-05-31 23:55:50 UTC) #14
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 6 months ago (2016-06-01 01:25:18 UTC) #15
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/1110ac7a5c525ab81105a8cf7be2f7b59d669657 Cr-Commit-Position: refs/heads/master@{#397015}
4 years, 6 months ago (2016-06-01 01:28:10 UTC) #17
Nico
This breaks building base_unittests on the clangtotlinux bot: https://build.chromium.org/p/chromium.fyi/builders/ClangToTLinux/builds/5379/steps/compile/logs/stdio FAILED: base_unittests ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack ...
4 years, 6 months ago (2016-06-01 16:28:13 UTC) #18
Primiano Tucci (use gerrit)
On 2016/06/01 16:28:13, Nico wrote: > This breaks building base_unittests on the clangtotlinux bot: > ...
4 years, 6 months ago (2016-06-01 16:51:23 UTC) #19
pcc1
4 years, 6 months ago (2016-06-01 18:13:30 UTC) #20
Message was sent while issue was closed.
On 2016/06/01 16:51:23, Primiano Tucci wrote:
> On 2016/06/01 16:28:13, Nico wrote:
> > This breaks building base_unittests on the clangtotlinux bot:
> >
>
https://build.chromium.org/p/chromium.fyi/builders/ClangToTLinux/builds/5379/...
> > 
> > FAILED: base_unittests 
> > ../../third_party/llvm-build/Release+Asserts/bin/clang++
-Wl,--fatal-warnings
> > -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -fuse-ld=gold
> > -B../../third_party/binutils/Linux_x64/Release/bin -Wl,--icf=all -pthread
-m64
> > -Wl,-O1 -Wl,--gc-sections -Wl,--as-needed
> > --sysroot=../../build/linux/debian_wheezy_amd64-sysroot 
> > -Wl,-rpath-link=../Release -Wl,--disable-new-dtags -Wl,-rpath=\$ORIGIN/.
> > -Wl,-rpath-link=. -Wl,--export-dynamic -o "./base_unittests"
-Wl,--start-group
> > @"./base_unittests.rsp" ./libbase.so ./libbase_i18n.so
./libmalloc_wrapper.so
> > ./libicui18n.so ./libicuuc.so -Wl,--end-group  -ldl -lrt -lgmodule-2.0
> > -lgobject-2.0 -lgthread-2.0 -lglib-2.0 
> > ../../base/allocator/tcmalloc_unittest.cc:25: error: undefined reference to
> > 'tc_malloc'
> > ../../base/allocator/tcmalloc_unittest.cc:29: error: undefined reference to
> > 'tc_free'
> > ../../base/allocator/tcmalloc_unittest.cc:29: error: undefined reference to
> > 'tc_free'
> > ../../base/allocator/tcmalloc_unittest.cc:25: error: undefined reference to
> > 'tc_malloc'
> > ../../base/allocator/tcmalloc_unittest.cc:29: error: undefined reference to
> > 'tc_free'
> > ../../base/allocator/tcmalloc_unittest.cc:29: error: undefined reference to
> > 'tc_free'
> > ../../base/allocator/tcmalloc_unittest.cc:25: error: undefined reference to
> > 'tc_malloc'
> > ../../base/allocator/tcmalloc_unittest.cc:25: error: undefined reference to
> > 'tc_malloc'
> > 
> > Can you take a look?
> 
> I see what's happening. tcmalloc_unittest.cc uses tc_malloc and tc_free, which
> in a component build are not exported anymore.
> I don't see why tcmalloc_unittest.cc doesn't just use malloc() and free(). We
> know that if we use tcmalloc they are routed to tc_malloc and tc_free. And if
we
> don't use tcmalloc there is nothing to test.
> I think the right thing to do is:
> - enable tcmalloc_unittest.cc (or relevant parts of it) when
> defined(USE_TCMALLOC). I think that the trick there is that some parts of that
> file are not really tcmalloc specific and we want those tests in any case.
> - use malloc/free.
> 
> I am happy to fix this but I have to leave the office right now.
> So either:
> - s/tc_// and TBR me
> - comment out all tcmalloc_unittest.cc with a TODO(primiano) and I'll fix it
> tomorrow.

Thanks Primiano, https://codereview.chromium.org/2028183002 does the former.

Powered by Google App Engine
This is Rietveld 408576698