My favorites | Sign in
Project Home Downloads Wiki Issues Code Search
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 170629: ASan should use dynamic runtime in Chrome on OS X
4 people starred this issue and may be notified of changes. Back to list
 
Project Member Reported by gli...@chromium.org, Jan 17, 2013
We're about to switch to the dynamic runtime in ASan Mac, which shall allow to use dyld interposition for function interception instead of mach_override (see https://code.google.com/p/address-sanitizer/issues/detail?id=64). This shall make ASan more portable and allow us to simplify the runtime library code significantly.

The two pending LLVM CLs that will enable the dynamic runtime are http://llvm-reviews.chandlerc.com/D216 and http://llvm-reviews.chandlerc.com/D223.

Once the switch to the dynamic runtime is made, all the programs built with the trunk Clang will require libclang_rt.asan_osx_dynamic.dylib to run. Since it's shipped with the compiler and isn't usually in the $PATH when Chrome and/or the tests are ran, the Chrome buildsystem will need to copy the runtime dylib to a place where it can be located at program startup.

The current plan is to have the dylib's LC_ID_DYLIB point to @executable_path/libclang_rt.asan_osx_dynamic.dylib and copy it to the build directory so that all the test binaries can locate it (anyone willing to copy a test binary somewhere else is responsible for copying the runtime dylib as well). We'll also need to put copies of the dylib into the .app bundles generated when building Chrome.
Jan 17, 2013
#1 thakis@chromium.org
How often do you expect the runtime to change? Could we just copy it to /usr/bin (or whatever) once at slave setup time?
Jan 17, 2013
#2 gli...@chromium.org
It's going to be changed often in the nearest future (every Clang roll at Chrome updates the runtime now). We'll also need to let people copy an instrumented Chrome to another machine (I hope we'll have a canary Chrome build for OSX someday)
Jan 17, 2013
#3 thakis@chromium.org
Hm, that's a good point. What's the deployment / distribution story for asan builds when built with "regular" clang? I guess you'd want to copy the dylib into the app bundle, so maybe the LC_ID_DYLIB logic should be done in clang's build system already?

Have you discussed this point with Ted and Anna?
Jan 17, 2013
#4 gli...@chromium.org
This will strongly depend on whether the runtime is to be tied to the
compiler or to the system. We haven't figured that out yet, since I've only
prepared a POC with which the clients will experiment. Clang users (except
for Chrome) should be fine with the current scheme where the runtime
resides near the compiler. OTOH for Chrome we must copy it and fix
LC_ID_DYLIB. I've considered doing that in the postbuild scripts, but
running install_name_tool when building Clang sounds more clean for now.
Jan 17, 2013
#5 thakis@chromium.org
> Clang users (except for Chrome) should be fine with the current scheme where the runtime resides near the compiler. 

Not if they want to distribute asanified binaries to users for testing, right?
Jan 18, 2013
#6 gli...@chromium.org
(repeating my last comment as it was posted via email and hasn't made it here)

You're right.
My point is that copying and fixing the dylib should (at least for now) be done by the project's build system, since making Clang copy it near each binary being linked is kind of an overkill.
Perhaps we'll want relative LC_ID_DYLIB for Clang in the future, but currently it will just make Clang tests more complex.
Jan 18, 2013
#7 gli...@chromium.org
Clang-wise, there currently are two CLs that make ASan use the dynamic library instead of the static one (http://llvm-reviews.chandlerc.com/D216 and http://llvm-reviews.chandlerc.com/D223).
I was trying to keep those as simple as possible, thus there's no transition period when both options work. After I land these CLs none of Clang tests will be broken (even though I'm not touching LC_ID_DYLIB in Clang right now), but Chrome will be broken next time you roll the new Clang. To simplify the roll (e.g. you probably don't want to install the runtime to all the bots even once) I want to prepare Chrome for that roll by having the dylib copied to the right place even for the current Clang version (gonna send a patch next week).

The remaining question is why we should fix LC_ID_DYLIB in Chrome rather than in Clang (https://codereview.chromium.org/11946043/) - at least for now. First, it will keep the Clang diff needed for the transition slightly smaller. Second, it allows us to decide later how should the Clang clients use the runtime without breaking Clang right now. Third, we anyway need this in Chrome.
Feb 11, 2013
#8 h...@chromium.org
The next Clang roll (https://codereview.chromium.org/12220089/) is failing already at the build stage on mac_asan bots, so it seems this is not just a runtime problem.
Feb 11, 2013
#9 gli...@chromium.org
From https://code.google.com/p/chromium/issues/detail?id=174873#c12:

We're failing the compile step on mac_asan:

FAILED: ./gyp-mac-tool flock linker.lock clang++ -Wl,-search_paths_first -fsanitize=address -Wl,-pie -Wl,-dead_strip -mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -L. -o LayoutTestHelper obj/third_party/webkit/tools/dumprendertree/chromium/layouttesthelper.layouttesthelper.o  -framework AppKit && (export BUILT_PRODUCTS_DIR=/Volumes/data/b/build/slave/mac_asan/build/src/out/Release; export CHROMIUM_STRIP_SAVE_FILE=../../../../../build/asan.saves; export CONFIGURATION=Release; export EXECUTABLE_NAME=LayoutTestHelper; export EXECUTABLE_PATH=LayoutTestHelper; export FULL_PRODUCT_NAME=LayoutTestHelper; export PRODUCT_NAME=LayoutTestHelper; export PRODUCT_TYPE=com.apple.product-type.tool; export SDKROOT=/Developer/SDKs/MacOSX10.6.sdk; export SRCROOT=/Volumes/data/b/build/slave/mac_asan/build/src/out/Release/../../third_party/WebKit/Tools/DumpRenderTree/DumpRenderTree.gyp; export SOURCE_ROOT="${SRCROOT}"; export TARGET_BUILD_DIR=/Volumes/data/b/build/slave/mac_asan/build/src/out/Release; export TEMP_DIR="${TMPDIR}"; (F=0; cd ../../third_party/WebKit/Tools/DumpRenderTree/DumpRenderTree.gyp || F=$?; dsymutil ../../../../../out/Release/LayoutTestHelper -o ../../../../../out/Release/LayoutTestHelper.dSYM || F=$?; strip  -s ${CHROMIUM_STRIP_SAVE_FILE} ../../../../../out/Release/LayoutTestHelper || F=$?; ../../../../../build/mac/change_mach_o_flags_from_xcode.sh || F=$?; exit $F); G=$?; ((exit $G) || rm -rf LayoutTestHelper) && exit $G)
strip: symbols names listed in: ../../../../../build/asan.saves not in: /Volumes/data/b/build/slave/mac_asan/build/src/out/Release/LayoutTestHelper
___asan_handle_no_return
___asan_init
___asan_register_global
___asan_register_globals
___asan_report_load1
___asan_report_load16
___asan_report_load2
___asan_report_load4
___asan_report_load8
___asan_report_store1
___asan_report_store16
___asan_report_store2
___asan_report_store4
___asan_report_store8
___asan_unregister_globals
ninja: build stopped: subcommand failed.
Feb 12, 2013
#10 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=181724

------------------------------------------------------------------------
r181724 | glider@chromium.org | 2013-02-11T18:51:55.583537Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/package.sh?r1=181724&r2=181723&pathrev=181724

When building Clang for Mac, make LC_ID_DYLIB of the ASan dynamic runtime to be relative to @executable_path.

BUG=170629
Review URL: https://codereview.chromium.org/11946043
------------------------------------------------------------------------
Feb 12, 2013
#11 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=181733

------------------------------------------------------------------------
r181733 | glider@chromium.org | 2013-02-11T19:25:09.345238Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=181733&r2=181732&pathrev=181733

Do not strip ASan builds.
As of Clang r174490 instrumented binaries do not include the __asan_* symbols,
so the postbuild strip action fails.

This is a temporary measure, we may need to do something else (e.g. use different .saves files) when the dynamic runtime is adopted on OSX.

BUG=170629,174873
Review URL: https://codereview.chromium.org/12210114
------------------------------------------------------------------------
Feb 12, 2013
#12 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=181918

------------------------------------------------------------------------
r181918 | glider@chromium.org | 2013-02-12T13:09:19.060519Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=181918&r2=181917&pathrev=181918

Pin Clang revision to r170392 for ASan Mac builders.
This temporary change introduces the --is-asan-mac-builder flag and a blacklist of OSX hosts building ASan
on the Chromium waterfall. If either the flag is set or `uname -n` is in the list, older Clang is used.

BUG=170629,174873
Review URL: https://codereview.chromium.org/12210139
------------------------------------------------------------------------
Feb 12, 2013
#13 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=181927

------------------------------------------------------------------------
r181927 | glider@chromium.org | 2013-02-12T14:33:33.992084Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=181927&r2=181926&pathrev=181927

Add mini11-a1 (Mac ASan LKGR) to the list of hosts building Mac ASan binaries (those hosts should use a fixed Clang version)

BUG=170629, 174873
Review URL: https://codereview.chromium.org/12207126
------------------------------------------------------------------------
Feb 12, 2013
#14 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=182023

------------------------------------------------------------------------
r182023 | hans@chromium.org | 2013-02-12T21:40:04.887680Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=182023&r2=182022&pathrev=182023
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=182023&r2=182022&pathrev=182023

Roll Clang r170392:r174491.

BUG=174873, 170629


Review URL: https://chromiumcodereview.appspot.com/12220089
------------------------------------------------------------------------
Feb 13, 2013
#15 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=182173

------------------------------------------------------------------------
r182173 | hans@chromium.org | 2013-02-13T09:30:02.489957Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=182173&r2=182172&pathrev=182173
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=182173&r2=182172&pathrev=182173

Revert "Roll Clang r170392:r174491."

It turns out that r181918, which pinned the Clang revision on Mac ASan
bots worked a little too well, pinning the version on *all* Mac bots.

This reverts the Clang roll. We will then fix update.sh to get the Mac
ASan pinning correct, and then re-land the roll.

BUG=174873, 170629

Review URL: https://codereview.chromium.org/12256002
------------------------------------------------------------------------
Feb 13, 2013
#16 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=182175

------------------------------------------------------------------------
r182175 | glider@chromium.org | 2013-02-13T09:45:02.541719Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=182175&r2=182174&pathrev=182175

Fix a syntax error which resulted in update.sh always using the old Clang.
Renamed  --is-asan-mac-builder to --is-asan-mac-builder-hackfix per Nico's suggestion.
Added more comments.

BUG=170629, 174873
TBR=thakis
Review URL: https://codereview.chromium.org/12255003
------------------------------------------------------------------------
Feb 13, 2013
#17 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=182201

------------------------------------------------------------------------
r182201 | glider@chromium.org | 2013-02-13T13:13:11.798386Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=182201&r2=182200&pathrev=182201

Replace seq invocation with 'jot -'. They don't have seq on Mac by default.
Make sure on_asan_mac_host() always returns 1 on non-Darwin systems.

BUG=170629, 174873
TBR=thakis
Review URL: https://codereview.chromium.org/12256005
------------------------------------------------------------------------
Feb 13, 2013
#18 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=182241

------------------------------------------------------------------------
r182241 | hans@chromium.org | 2013-02-13T16:35:23.878461Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=182241&r2=182240&pathrev=182241
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=182241&r2=182240&pathrev=182241

Roll Clang r170392:r174491.

BUG=174873, 170629

Review URL: https://codereview.chromium.org/12220089
------------------------------------------------------------------------
Feb 14, 2013
#19 gli...@chromium.org
(No comment was entered for this change.)
Blocking: chromium:175554
Feb 14, 2013
#20 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=182603

------------------------------------------------------------------------
r182603 | isherman@chromium.org | 2013-02-15T02:31:54.171609Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=182603&r2=182602&pathrev=182603
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=182603&r2=182602&pathrev=182603

Revert 182241

This seems to have broken the Mac ASAN LKGR builders.  For example:
http://build.chromium.org/p/chromium.lkgr/builders/Mac%20ASAN%20Release/builds/1188/steps/compile/logs/stdio

> Roll Clang r170392:r174491.
> 
> BUG=174873, 170629
> 
> Review URL: https://codereview.chromium.org/12220089

TBR=hans@chromium.org
Review URL: https://codereview.chromium.org/12256052
------------------------------------------------------------------------
Feb 14, 2013
#21 thakis@chromium.org
glider: isherman reverted the clang roll because it apparently broke the lkgr builder. Can you do you tweak your change to pin asan to an old revision to include the lkgr bots?
Cc: isherman@chromium.org
Feb 15, 2013
#22 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=182662

------------------------------------------------------------------------
r182662 | glider@chromium.org | 2013-02-15T10:43:15.401093Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=182662&r2=182661&pathrev=182662

Clang update script: fix the hostname for the Mac ASan LKGR bots, for which we have to use the pinned version of Clang.

BUG=170629, 174873
TBR=thakis
Review URL: https://codereview.chromium.org/12212212
------------------------------------------------------------------------
Feb 15, 2013
#23 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=182815

------------------------------------------------------------------------
r182815 | hinoka@google.com | 2013-02-15T20:42:52.233984Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=182815&r2=182814&pathrev=182815

Changed asan host detection to use short hostname

mini11-a1.chrome.corp.google.com is actually mini11-a1.perf.chromium.org, but
lets just use short hostnames (hostname -s) so that the domain doesn't matter.

BUG=170629, 174873

Review URL: https://codereview.chromium.org/12285006
------------------------------------------------------------------------
Feb 27, 2013
#24 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=184971

------------------------------------------------------------------------
r184971 | glider@chromium.org | 2013-02-27T16:58:19.707284Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/DEPS?r1=184971&r2=184970&pathrev=184971

Bump GYP revision to 1589

BUG=170629
Review URL: https://codereview.chromium.org/12326162
------------------------------------------------------------------------
Mar 9, 2013
#25 bugdro...@chromium.org
(No comment was entered for this change.)
Labels: -Area-Build -Stability-AddressSanitizer Build Performance-Memory-AddressSanitizer
Mar 11, 2013
#26 gli...@chromium.org
(No comment was entered for this change.)
Blockedon: chromium:181574
Mar 11, 2013
#27 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=187297

------------------------------------------------------------------------
r187297 | glider@chromium.org | 2013-03-11T15:30:18.793065Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/all.gyp?r1=187297&r2=187296&pathrev=187297
   A http://src.chromium.org/viewvc/chrome/trunk/src/build/mac/copy_asan_runtime_dylib.sh?r1=187297&r2=187296&pathrev=187297
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=187297&r2=187296&pathrev=187297
   A http://src.chromium.org/viewvc/chrome/trunk/src/build/mac/asan.gyp?r1=187297&r2=187296&pathrev=187297

Add a postbuild action for executables built with ASan on Mac OS.
The action will copy the ASan dynamic runtime to the same dir where
the executable is.

BUG=170629
Review URL: https://codereview.chromium.org/11642018
------------------------------------------------------------------------
Mar 11, 2013
#28 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=187309

------------------------------------------------------------------------
r187309 | glider@chromium.org | 2013-03-11T17:30:53.003277Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=187309&r2=187308&pathrev=187309
   D http://src.chromium.org/viewvc/chrome/trunk/src/build/mac/asan.gyp?r1=187309&r2=187308&pathrev=187309
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/all.gyp?r1=187309&r2=187308&pathrev=187309
   D http://src.chromium.org/viewvc/chrome/trunk/src/build/mac/copy_asan_runtime_dylib.sh?r1=187309&r2=187308&pathrev=187309

Revert 187297
> Add a postbuild action for executables built with ASan on Mac OS.
> The action will copy the ASan dynamic runtime to the same dir where
> the executable is.
> 
> BUG=170629
> Review URL: https://codereview.chromium.org/11642018

TBR=glider@chromium.org
Review URL: https://codereview.chromium.org/12440020
------------------------------------------------------------------------
Mar 12, 2013
#29 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=187566

------------------------------------------------------------------------
r187566 | glider@chromium.org | 2013-03-12T11:56:31.925444Z

Changed paths:
   A http://src.chromium.org/viewvc/chrome/trunk/src/build/mac/copy_asan_runtime_dylib.sh?r1=187566&r2=187565&pathrev=187566
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=187566&r2=187565&pathrev=187566
   A http://src.chromium.org/viewvc/chrome/trunk/src/build/mac/asan.gyp?r1=187566&r2=187565&pathrev=187566

Re-land https://codereview.chromium.org/11642018/:  Add a postbuild action for executables built with ASan on Mac OS.

The action will copy the ASan dynamic runtime to the output dir and into every
bundled executable being built.

Unlike the previous change, this one does not touch build/all.gyp, since our target
doesn't need to be built when building 'All'.

BUG=170629
TBR=thakis,mark
Review URL: https://codereview.chromium.org/12685006
------------------------------------------------------------------------
Mar 12, 2013
#30 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=187582

------------------------------------------------------------------------
r187582 | glider@chromium.org | 2013-03-12T14:06:16.005434Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=187582&r2=187581&pathrev=187582

Hotfix the build on the ChromeOS ASan bots: only add a dependency on ASan dynamic runtime for OS X and iOS.

BUG=170629
TBR=mark
Review URL: https://codereview.chromium.org/12716011
------------------------------------------------------------------------
Mar 14, 2013
#31 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=188080

------------------------------------------------------------------------
r188080 | glider@chromium.org | 2013-03-14T15:38:53.465536Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=188080&r2=188079&pathrev=188080

Add vm672-m1 (the new Mac ASan builder) to the list of machines using pinned Clang version.

BUG=170629
TBR=thakis
Review URL: https://codereview.chromium.org/12729006
------------------------------------------------------------------------
Mar 14, 2013
#32 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=188113

------------------------------------------------------------------------
r188113 | tbreisacher@chromium.org | 2013-03-14T17:31:28.599355Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=188113&r2=188112&pathrev=188113

Revert 188080 "Add vm672-m1 (the new Mac ASan builder) to the li..."

This CL seems to be causing content_unittests flakiness on MAC ASAN Tests (1): http://build.chromium.org/p/chromium.memory/builders/Mac%20ASAN%20Tests%20%281%29/builds/7515/steps/content_unittests/logs/stdio

> Add vm672-m1 (the new Mac ASan builder) to the list of machines using pinned Clang version.
> 
> BUG=170629
> TBR=thakis
> Review URL: https://codereview.chromium.org/12729006

TBR=glider@chromium.org
Review URL: https://codereview.chromium.org/12545038
------------------------------------------------------------------------
Mar 14, 2013
#33 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=188142

------------------------------------------------------------------------
r188142 | tbreisacher@chromium.org | 2013-03-14T18:26:25.269863Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=188142&r2=188141&pathrev=188142

Revert 188113 "Revert 188080 "Add vm672-m1 (the new Mac ASan bui..."

> Revert 188080 "Add vm672-m1 (the new Mac ASan builder) to the li..."
> 
> This CL seems to be causing content_unittests flakiness on MAC ASAN Tests (1): http://build.chromium.org/p/chromium.memory/builders/Mac%20ASAN%20Tests%20%281%29/builds/7515/steps/content_unittests/logs/stdio
> 
> > Add vm672-m1 (the new Mac ASan builder) to the list of machines using pinned Clang version.
> > 
> > BUG=170629
> > TBR=thakis
> > Review URL: https://codereview.chromium.org/12729006
> 
> TBR=glider@chromium.org
> Review URL: https://codereview.chromium.org/12545038

TBR=glider@chromium.org
Review URL: https://codereview.chromium.org/12833010
------------------------------------------------------------------------
Mar 18, 2013
#34 gli...@chromium.org
For the record: all the necessary code changes have already been made.
In order to use the dynamic runtime on Mac we need to unpin the Clang version on the ASan bots (https://codereview.chromium.org/12457022/ is the CL that does it).
But the ASan runtime is being built using the 10.8 SDK:

Load command 7
      cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.5
      sdk 10.8

and thus can't be used by the builders running 10.6 (install_name_tool, ld and other tools choke on this library).
So before switching to the dynamic library we need to switch our bots to 10.8.
Blockedon: chromium:154281
Mar 18, 2013
#35 mark@chromium.org
Can’t you build the library to run on 10.6?
Mar 18, 2013
#36 gli...@chromium.org
I'm building the runtime with -mmacos-version-min=10.5, thus the "version" field is 10.5.
If I link the test binary (that depends on the runtime library) on 10.8, it successfully runs on 10.6.
But I can't link anything with that runtime on a 10.6 machine, because it was built with a 10.8 SDK.

I guess this is theoretically possible to build the library so that the "sdk" field also contains "10.5" or "10.6" (although this seems to be a global setting for the whole Clang build), but I'm not sure this is necessary. As soon as we switch the bots to 10.8 we won't need to build ASan binaries on 10.6. Yet the binaries built on 10.8 will still be runnable on 10.6.
Mar 18, 2013
#37 mark@chromium.org
You’re building the runtime manually, right? Why not build it with the 10.5 SDK then?
Mar 18, 2013
#38 gli...@chromium.org
We're building the runtime together with Clang. We can't make the 10.5 SDK the default one in Clang's compiler_rt, since many people may not have it (e.g. I do not, I don't think Nico has one either - and he's usually performing the builds).

We can make this an option for Chrome builds only (Nico, Hans and I will have to install the 10.5/10.6 SDK, but that's not a big deal), but do you think we need to push on the opportunity to build Chrome with ASan on machines not having the 10.8 SDK?
Mar 18, 2013
#39 mark@chromium.org
The official builds will use the 10.6 SDK for the foreseeable future. We’ve been a little more lax about unofficial builds. Can the asan lib still be used for a build with the 10.6 SDK when performed on a 10.8 machine?
Apr 1, 2013
#40 bugdro...@chromium.org
(No comment was entered for this change.)
Labels: -Performance-Memory-AddressSanitizer Stability-Memory-AddressSanitizer
Apr 10, 2013
#41 thakis@chromium.org
The mac_layout trybots fail compiling currently. The reason is that they happen to share slaves with the asan trybots, and update.sh pins clang to a by now months-old revision on these slaves because of this bug here. (the asan bots don't fail compile as they build with -w, see  issue 162783 ).

If it's not feasible to move the asan bots to use the new runtime in a day or two, please add some upstream flag so that it's possible to use the old runtime with clang head, so that we can at least remove this clang pinning on the asan bots. It's been active for months now, and it's starting to cause real issues. (Such as breaking the layout trybots.)
Labels: -Pri-2 Pri-0
Apr 10, 2013
#42 kcc@chromium.org
the old run-time in clang head is dead-dead-dead. 
Apr 10, 2013
#43 thakis@chromium.org
How much work is it to restore it from source control?

Do you have other suggestions on how to make it possible that the asan bots don't need to be pinned at a revision where the old runtime is still around?
Apr 10, 2013
#44 kcc@chromium.org
The old run-time had un-fixable bugs, there is no way we are restoring it.
We need to enable the new one.
Apr 10, 2013
#45 bugdro...@chromium.org
------------------------------------------------------------------------
r193425 | thakis@chromium.org | 2013-04-10T18:44:52.785935Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=193425&r2=193424&pathrev=193425

Make sure the asan clang pinning does not pin the layout bots too

BUG=170629

Review URL: https://codereview.chromium.org/13999003
------------------------------------------------------------------------
Apr 11, 2013
#46 gli...@chromium.org
There's a bug in ASan instrumentation that causes some tests to fail on 10.8. However it's hard to stomp upon it, so perhaps we need to just make the switch and disable those tests until the bug is fixed.
According to the trybot run (https://codereview.chromium.org/12457022, see mac_asan_alt: http://build.chromium.org/p/tryserver.chromium/builders/mac_asan_alt/builds/31, since mac_asan is a 10.6 one), most of the tests pass now. I'll try to enable the new runtime tomorrow, switch the bots to 10.8 and whack the failing tests. 
Apr 11, 2013
#47 kcc@chromium.org
is that https://code.google.com/p/address-sanitizer/issues/detail?id=171
Can you instead of disabling the chrome tests disable instrumentation of globals? 
(only on OS X of course, and only temporary of course)
Apr 11, 2013
#48 gli...@chromium.org
Yes, it is. Good idea, indeed.
Apr 12, 2013
#49 gli...@chromium.org
I've switched the bots to 10.8 and disabled the instrumentation of globals.
Will now try to unpin the Clang version: https://codereview.chromium.org/12457022
Apr 16, 2013
#50 gli...@chromium.org
FTR, before we unpin the Clang revision we need to make sure the mac_asan trybots can use the dynamic runtime, i.e. that they run at least 10.7. We're waiting for the infrastructure-team's decision.
Apr 21, 2013
#51 bugdro...@chromium.org
------------------------------------------------------------------------
r195411 | glider@chromium.org | 2013-04-21T08:37:50.135118Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/tools/build/masters/master.tryserver.chromium/master.cfg?r1=195411&r2=195410&pathrev=195411
   M http://src.chromium.org/viewvc/chrome/trunk/tools/build/masters/master.tryserver.chromium/slaves.cfg?r1=195411&r2=195410&pathrev=195411

Move the mac_asan trybots from the pool of 10.6 machines to the pool of 10.7 machines.
Wipe out the mac_asan_alt trybots.

We need the mac_asan bots use at least Xcode 4.4 (otherwise they're unable to operate on ASan dynamic library,
which contains some load commands unsupported by Xcode 4.2), and the easiest way to do so is to switch them to 10.7

BUG=154281,170629

Review URL: https://chromiumcodereview.appspot.com/14234015
------------------------------------------------------------------------
Apr 22, 2013
#52 bugdro...@chromium.org
------------------------------------------------------------------------
r195479 | thakis@chromium.org | 2013-04-22T09:57:24.415081Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=195479&r2=195478&pathrev=195479

mac: Disable clang plugin in asan builds.

asan's clang is currently pinned to a very old revision and hence includes
a very old plugin. Since all other bots run the plugin, we don't really
lose coverage by disabling the plugin on asan bots for now.

BUG=170629
TBR=glider

Review URL: https://chromiumcodereview.appspot.com/14305005
------------------------------------------------------------------------
Apr 23, 2013
#53 bugdro...@chromium.org
------------------------------------------------------------------------
r195771 | glider@chromium.org | 2013-04-23T09:58:09.485646Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=195771&r2=195770&pathrev=195771

Unpin the Clang version used by the OS X bots.
This CL only changes the Clang version to the one used by other bots.
Code cleanup will be done separately.

BUG=170629
TBR=thakis

Review URL: https://codereview.chromium.org/12457022
------------------------------------------------------------------------
Apr 23, 2013
#54 bugdro...@chromium.org
------------------------------------------------------------------------
r195775 | glider@chromium.org | 2013-04-23T11:27:32.886380Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/runtest.py?r1=195775&r2=195774&pathrev=195775

Pass replace_intrin=0 when running tests under ASan on OS X.
This suppresses an error in OpenCL, issue 162461.

BUG=162461,170629
TBR=thakis

Review URL: https://chromiumcodereview.appspot.com/13986012
------------------------------------------------------------------------
Apr 23, 2013
#55 thakis@chromium.org
This is mostly done now, right? Only the TODOs pointing to this bug ( https://code.google.com/p/chromium/codesearch#search/&q=170629%20-file:%5C.xtb&sq=package:chromium&type=cs ) need to be updated.
Apr 24, 2013
#56 gli...@chromium.org
Yeah, we're officially running the dynamic runtime now. I hope to fix the TODOs soon.
Apr 30, 2013
#57 bugdro...@chromium.org
------------------------------------------------------------------------
r197404 | thakis@chromium.org | 2013-04-30T17:58:50.070374Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/update.sh?r1=197404&r2=197403&pathrev=197404

Remove support code that was used to pin asan to an older revision.

It's no longer needed.

BUG=170629

Review URL: https://codereview.chromium.org/14568002
------------------------------------------------------------------------
May 6, 2013
#58 thakis@chromium.org
This is done, right? We should probably use new bugs for any follow-up work.
Status: Fixed
May 16, 2013
#59 gli...@chromium.org
Yes, it is. I'll look around and see where additional cleanup is needed.
May 21, 2013
#60 bugdro...@chromium.org
------------------------------------------------------------------------
r201361 | thakis@chromium.org | 2013-05-21T21:27:57.297776Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=201361&r2=201360&pathrev=201361

mac: Reenable clang plugin on asan bot now that it's using the same clang as the other bots.

BUG=170629
R=glider@chromium.org

Review URL: https://codereview.chromium.org/14789003
------------------------------------------------------------------------
Feb 21, 2014
#61 bugdro...@chromium.org
------------------------------------------------------------------------
r252561 | glider@chromium.org | 2014-02-21T15:33:03.378614Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/tools/clang/scripts/package.sh?r1=252561&r2=252560&pathrev=252561

Changes to the Clang packaging script:
 - package the iOS simulator ASan runtime and set the correct LC_ID_DYLIB for it
 - declare gcc_toolchain to fix the "unbound variable" errors

BUG=170629,344836
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/170873008
------------------------------------------------------------------------
Sign in to add a comment

Powered by Google Project Hosting