New issue
Advanced search Search tips

Issue 821566 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2018
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Building fuzzed targets causes a link error.

Reported by dyaros...@yandex-team.ru, Mar 13 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 YaBrowser/18.1.1.841 Yowser/2.5 Safari/537.36

Steps to reproduce the problem:
Hi!

I'm trying to build a fuzzer tests on mac according to this:
https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/getting_started.md

gn args:
use_libfuzzer = true

Os: Mac Os Sierra 10.13.3

command line
ninja -C out/fuzzer/ base_json_correctness_fuzzer

What is the expected behavior?

What went wrong?
Output.

ninja: Entering directory `out/fuzzer/'
[2/4] SOLINK libbase.dylib libbase.dylib.TOC libbase.dylib.dSYM libbase.dylib.dSYM/Contents/Info.plist libbase.dylib.dSYM/Contents/Resources/DWARF/libbase.dylib
FAILED: libbase.dylib libbase.dylib.TOC libbase.dylib.dSYM libbase.dylib.dSYM/Contents/Info.plist libbase.dylib.dSYM/Contents/Resources/DWARF/libbase.dylib 
if [ ! -e "./libbase.dylib" -o ! -e "./libbase.dylib.TOC" ] || otool -l "./libbase.dylib" | grep -q LC_REEXPORT_DYLIB ; then TOOL_VERSION=1505483652 ../../build/toolchain/mac/linker_driver.py ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared  -Wl,-install_name,@rpath/"libbase.dylib"  -Wcrl,dsym,. -stdlib=libc++ -arch x86_64 -segprot PROTECTED_MEMORY rw r -Werror -isysroot ../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -mmacosx-version-min=10.9.0 -fsanitize-coverage=trace-pc-guard -Wl,-ObjC -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-U,_sanitizer_options_link_helper -fsanitize-coverage=trace-pc-guard -o "./libbase.dylib" -Wl,-filelist,"./libbase.dylib.rsp" -framework ApplicationServices -framework AppKit -lbsm -framework CoreFoundation -framework IOKit -framework Security  && { otool -l "./libbase.dylib" | grep LC_ID_DYLIB -A 5; nm -gP "./libbase.dylib" | cut -f1-2 -d' ' | grep -v U$$; true; } > "./libbase.dylib.TOC"; else TOOL_VERSION=1505483652 ../../build/toolchain/mac/linker_driver.py ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared  -Wl,-install_name,@rpath/"libbase.dylib"  -Wcrl,dsym,. -stdlib=libc++ -arch x86_64 -segprot PROTECTED_MEMORY rw r -Werror -isysroot ../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -mmacosx-version-min=10.9.0 -fsanitize-coverage=trace-pc-guard -Wl,-ObjC -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-U,_sanitizer_options_link_helper -fsanitize-coverage=trace-pc-guard -o "./libbase.dylib" -Wl,-filelist,"./libbase.dylib.rsp" -framework ApplicationServices -framework AppKit -lbsm -framework CoreFoundation -framework IOKit -framework Security  && { otool -l "./libbase.dylib" | grep LC_ID_DYLIB -A 5; nm -gP "./libbase.dylib" | cut -f1-2 -d' ' | grep -v U$$; true; } > "./libbase.dylib.tmp" && if ! cmp -s "./libbase.dylib.tmp" "./libbase.dylib.TOC"; then mv "./libbase.dylib.tmp" "./libbase.dylib.TOC" ; fi; fi
ld: file not found: /space/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/7.0.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Traceback (most recent call last):
  File "../../build/toolchain/mac/linker_driver.py", line 229, in <module>
    Main(sys.argv)
  File "../../build/toolchain/mac/linker_driver.py", line 79, in Main
    subprocess.check_call(compiler_driver_args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['../../third_party/llvm-build/Release+Asserts/bin/clang++', '-shared', '-Wl,-install_name,@rpath/libbase.dylib', '-stdlib=libc++', '-arch', 'x86_64', '-segprot', 'PROTECTED_MEMORY', 'rw', 'r', '-Werror', '-isysroot', '../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk', '-mmacosx-version-min=10.9.0', '-fsanitize-coverage=trace-pc-guard', '-Wl,-ObjC', '-Wl,-rpath,@loader_path/.', '-Wl,-rpath,@loader_path/../../..', '-Wl,-U,_sanitizer_options_link_helper', '-fsanitize-coverage=trace-pc-guard', '-o', './libbase.dylib', '-Wl,-filelist,./libbase.dylib.rsp', '-framework', 'ApplicationServices', '-framework', 'AppKit', '-lbsm', '-framework', 'CoreFoundation', '-framework', 'IOKit', '-framework', 'Security']' returned non-zero exit status 1
[3/4] CXX obj/base/base_json_correctness_fuzzer/correctness_fuzzer.o
ninja: build stopped: subcommand failed.

Did this work before? N/A 

Chrome version: 63.0.3239.132  Channel: n/a
OS Version: OS X 10.13.3
Flash Version: Shockwave Flash 29.0 r0

Help me, please?)
 

Comment 1 by danakj@chromium.org, Mar 13 2018

Does the linker error not show up here or am I missing it..? I only see

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Can you find what the error is?

Comment 2 by rsesek@chromium.org, Mar 13 2018

ld: file not found: /space/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/7.0.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib

@danakj:
Well it says:
"ld: file not found: /space/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/7.0.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib"

Could it be the problem?
Side note: if I try to enable "is_ubsan_security=true" which makes more scense for me - clang crashes. I reported it here: https://bugs.llvm.org/show_bug.cgi?id=36709

Comment 5 by danakj@chromium.org, Mar 13 2018

There's other fuzzers in base, eg base/base64_decode_fuzzer.cc. Do those compile?
I tried these:
https://cs.chromium.org/chromium/src/base/BUILD.gn?q=base/BUI&sq=package:chromium&l=2958

They don't.

This might be relevant - as a non-googler I have to set
FORCE_MAC_TOOLCHAIN="" in order to compile
A smart guy on my team helped me out:
```
use_libfuzzer = true
is_asan=true
is_debug=false
enable_nacl=false
```

and it works!
Status: WontFix (was: Unconfirmed)
Glad to hear it worked out!

Sign in to add a comment