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

Issue 2132963002: Revert of Allocator shims working on VS2015. (Closed)

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

Description

Revert of Allocator shims working on VS2015. (patchset #12 id:220001 of https://codereview.chromium.org/1414453017/ ) Reason for revert: We're seeing probably the same or similar issue when linking on win again. https://build.chromium.org/p/chromium/builders/Win/builds/45048 FAILED: blacklist_test_main_dll.dll blacklist_test_main_dll.dll.lib blacklist_test_main_dll.dll.pdb C:\b\depot_tools\python276_bin\python.exe gyp-win-tool link-with-manifests environment.x86 True blacklist_test_main_dll.dll "C:\b\depot_tools\python276_bin\python.exe gyp-win-tool link-wrapper environment.x86 False link.exe /nologo /IMPLIB:blacklist_test_main_dll.dll.lib /DLL /OUT:blacklist_test_main_dll.dll @blacklist_test_main_dll.dll.rsp" 2 mt.exe rc.exe "obj\chrome_elf\blacklist_test_main_dll.blacklist_test_main_dll.dll.intermediate.manifest" obj\chrome_elf\blacklist_test_main_dll.blacklist_test_main_dll.dll.generated.manifest allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: __query_new_mode already defined in libucrt.lib(new_mode.obj) allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: __set_new_mode already defined in libucrt.lib(new_mode.obj) allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: _calloc already defined in libucrt.lib(calloc.obj) allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: _free already defined in libucrt.lib(free.obj) allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: _malloc already defined in libucrt.lib(malloc.obj) blacklist_test_main_dll.dll : fatal error LNK1169: one or more multiply defined symbols found Let me revert this CL to see if the revert fixes the build breakage. Original issue's description: > Allocator shims working on VS2015. > > VS2015 is happy for us to simply override the CRT symbols since they > seem to be defined weakly by the universal CRT. > > This shim is far simpler than the previous one, as the libcmt stripping > technique can be removed. > > Allocator shim is also now only be enabled on Release Static builds. > > BUG=481611 > TEST=base_unittests --gtest_filter=*Memory* in all configurations > (Debug/Release/Static/Component/GN/gyp/x64/x86) > CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel > > Committed: https://crrev.com/e20c2e0ab4e5b796e7a1890fb9048b5eb307d015 > Cr-Commit-Position: refs/heads/master@{#383810} > > Committed: https://crrev.com/08a9665ab0bce3813425f8d7ec9bec9178d5faa4 > Cr-Commit-Position: refs/heads/master@{#384711} TBR=thakis@chromium.org,brucedawson@chromium.org,rnk@chromium.org,piman@chromium.org,primiano@chromium.org,wfh@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=481611

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+390 lines, -132 lines) Patch
M base/allocator/BUILD.gn View 4 chunks +49 lines, -16 lines 0 comments Download
M base/allocator/allocator.gyp View 2 chunks +41 lines, -2 lines 0 comments Download
M base/allocator/allocator_check.cc View 2 chunks +7 lines, -5 lines 0 comments Download
D base/allocator/allocator_shim_win.h View 1 chunk +0 lines, -17 lines 0 comments Download
M base/allocator/allocator_shim_win.cc View 7 chunks +193 lines, -44 lines 0 comments Download
A base/allocator/prep_libc.py View 1 chunk +84 lines, -0 lines 0 comments Download
M base/process/memory_unittest.cc View 4 chunks +0 lines, -40 lines 0 comments Download
M build/common.gypi View 4 chunks +15 lines, -8 lines 0 comments Download
M gpu/gles2_conform_support/gles2_conform_support.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
Yuki
Created Revert of Allocator shims working on VS2015.
4 years, 5 months ago (2016-07-08 04:51:40 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2132963002/1
4 years, 5 months ago (2016-07-08 04:52:02 UTC) #3
Will Harris
On 2016/07/08 04:52:02, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
4 years, 5 months ago (2016-07-08 05:04:44 UTC) #4
piman
On 2016/07/08 05:04:44, Will Harris wrote: > On 2016/07/08 04:52:02, commit-bot: I haz the power ...
4 years, 5 months ago (2016-07-08 05:15:19 UTC) #6
Will Harris
On 2016/07/08 05:15:19, piman wrote: > On 2016/07/08 05:04:44, Will Harris wrote: > > On ...
4 years, 5 months ago (2016-07-08 05:25:23 UTC) #7
Will Harris
On 2016/07/08 05:25:23, Will Harris wrote: > On 2016/07/08 05:15:19, piman wrote: > > On ...
4 years, 5 months ago (2016-07-08 05:29:01 UTC) #8
Yuki
On 2016/07/08 05:29:01, Will Harris wrote: > On 2016/07/08 05:25:23, Will Harris wrote: > > ...
4 years, 5 months ago (2016-07-08 05:41:52 UTC) #9
Primiano Tucci (use gerrit)
On 2016/07/08 05:41:52, Yuki wrote: > Thanks for the reply. I'll try to find another ...
4 years, 5 months ago (2016-07-08 13:25:58 UTC) #11
Yuki
On 2016/07/08 13:25:58, Primiano Tucci wrote: > On 2016/07/08 05:41:52, Yuki wrote: > > Thanks ...
4 years, 5 months ago (2016-07-08 13:44:16 UTC) #12
brucedawson
4 years, 5 months ago (2016-07-11 19:54:24 UTC) #13
Message was sent while issue was closed.
> I'm sorry for that and thanks for your work.
> It was surprise for me that the CL changed the linker invocation somehow
without
> changing any *.gyp(i) or *.gn(i).

If there are multiple object files that define the same symbol then linking can
be very fragile and can easily be perturbed by seemingly irrelevant changes.

The linker repeatedly scans through its library inputs looking for the symbols
that it needs to resolve. As it does this it also finds new symbols that have to
be resolved. If a symbol is defined in multiple object files then which object
file it pulls in depends on exactly when in this cycle the symbol is first
referenced. So, a change in library order or an arbitrarily long chain of symbol
references can perturb the behavior. Or, a reference to a new symbol can do
this.

In this case something caused libucrt.lib(new_mode.obj) to be referenced when
Will's allocator.lib(allocator.allocator_shim_win.obj) was supposed to be
supplying the symbols. This could mean that there is a symbol that exists only
in new_mode.obj that somebody referenced. Or it could mean that new_mode.obj
happened to win the race.

If it is the latter (I assume that it is) then the ideal fix is to explicitly
link in allocator_shim_win.obj, instead of pulling it in from a library. That
guarantees that the desired .obj file always wins the race. Unfortunately Chrome
lacks a convenient mechanism for doing this in every binary. We thought that we
had found a stable way of pulling in the correct .obj file, but I guess it's not
as stable as we had hoped.

Powered by Google App Engine
This is Rietveld 408576698