New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 779863 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Dec 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 724628



Sign in to add a comment

chromeos-cheets-scripts UnitTest fails with libc++

Project Member Reported by manojgupta@chromium.org, Oct 31 2017

Issue description

https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/llvm_toolchain/builds/440
https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/llvm_toolchain/builds/443

Build fails because of missing symbols.

chromeos-cheets-scripts-0.0.1-r399: protoc --cpp_out=. --proto_path=/build/eve/usr/include/chromeos/dbus/cryptohome /build/eve/usr/include/chromeos/dbus/cryptohome/rpc.proto /build/eve/usr/include/chromeos/dbus/cryptohome/key.proto /build/eve/usr/include/chromeos/dbus/cryptohome/signed_secret.proto
chromeos-cheets-scripts-0.0.1-r399: generate-chromeos-dbus-bindings boot_lockbox_dbus.xml \
chromeos-cheets-scripts-0.0.1-r399: --proxy=boot_lockbox_dbus.h
chromeos-cheets-scripts-0.0.1-r399: protoc: symbol lookup error: /usr/lib64/libprotoc.so.13: undefined symbol: _ZN6google8protobuf13StringAppendFEPSsPKcz
chromeos-cheets-scripts-0.0.1-r399: generate-chromeos-dbus-bindings: symbol lookup error: generate-chromeos-dbus-bindings: undefined symbol: _ZN4base15DictionaryValue33GetDictionaryWithoutPathExpansionERKSsPPS0_
chromeos-cheets-scripts-0.0.1-r399: make[1]: *** [/build/eve/tmp/portage/chromeos-base/chromeos-cheets-scripts-0.0.1-r399/work/chromeos-cheets-scripts-0.0.1/arc-setup/Makefile:28: generate_dbus_proto] Error 127

The symbols are missing because the build uses host protoc and generate-chromeos-dbus-bindings binaries which are built with libstdc++. Since the target is compiled with libc++, it can't find the symbols because of ABI mismatch.

Solutions:
1. Install protoc binary ( dev-libs/protobuf) and generate-chromeos-dbus-bindings binaries (chromeos-base/chromeos-dbus-bindings) in target and use them. 
Note:
There might be an easier solution since rest of platform code uses protobuf but does not suffer from this problem.

OR

2. Build full system i.e. host + target with libc++.

 
Cc: xzhou@chromium.org
+xzhou@ who implemented the proto stuff.
Description: Show this description
The rest of the platform code uses gyp instead of Make, so maybe that's what enables the other platform2 projects to use protoc.

That might be another alternative.

Comment 4 by vapier@chromium.org, Oct 31 2017

i don't think that's the reason for the error.  protoc/generate-chromeos-dbus-bindings are build time tools that we install in SDK.  we don't install them into the target board and we don't want to execute out of that.
The binary is indeed in the host but the target has the same shared libraries as the host installed as well. Therefore when executing in the target build directory, the binary picks the target libraries instead of the host and fails.

i.e. $ protoc works (Uses libraries from host)
     $ LD_LIBRARY_PATH=/build/$BOARD/usr/lib64 protoc fails because of mismatched symbols. 

Comment 6 by vapier@chromium.org, Oct 31 2017

we don't execute build time programs "in the target build directory".  no build should be setting LD_LIBRARY_PATH either.

there is a bashrc hack, but only for the src_test phase.
  https://chromium-review.googlesource.com/212784

the logs aren't loading there, so i can't check it further.
So IIUC, cheets-scripts should call  protoc/generate-chromeos-dbus-bindings more carefully i.e. without setting LD_LIBRARY_PATH etc.
Blocking: 724628
Labels: libcxx
cheets-scripts isn't setting LD_LIBRARY_PATH, the ebuild env hacks are

i talked with Xiaoyong while he was in town and suggested a few routes:
(1) fix the Makefile to not use dummy targets (look at chaps/Makefile as an example).  those are causing the generated protobuf files to be regenerated & recompiled all the time.  if that was fixed, then this issue would just go away as we wouldn't be running the tool in the first place during src_test.
(2) split the massive cheets ebuild up into multiple ebuilds.  it's currently doing a lot of unrelated things (compiling daemons, hacking squashfs files, installing init scripts, etc...).
(3) stop using custom Makefiles and convert to platform2 gyp files.  this would take care of a lot of things for you (like target management, build tests during src_compile, and executing tests in the target sysroot).
(4) move the code to the public platform2 to make it easier to re-use.

i think in the end he was interested in only doing (1) ;).
Thanks Mike for the update :-).
Labels: -Pri-3 Pri-1
Bump to P1 since we want to migrate to libc++ soon. 
xzhou@ Can you take a look at this?
Owner: xzhou@chromium.org
Status: Assigned (was: Untriaged)
The proto files are not used for production right now. I didn't delete the files because xzhou@'s plan was to start using it soon in M65, but if this libc++ bug is urgent, one thing we could easily do for now is to stop building the proto files.
Status: Started (was: Assigned)
@manojgupta

I just talked with Luis and Yusukes, and it seems that moving to gyp is a better solution. I am not quite familiar with gyp. So it may take ~2 days, is this ok for you?
Yes, that's fine.
Discussed with hidehiko@ who is moving the spliting arc-setup and move it to platform2. It make more sense to apply http://crrev.com/i/523179 on top his CL once I receive it. 
Project Member

Comment 19 by bugdroid1@chromium.org, Dec 13 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/cheets-scripts/+/e14a4e94e80b3ded6223b43cef01fb1d87109023

commit e14a4e94e80b3ded6223b43cef01fb1d87109023
Author: Hidehiko Abe <hidehiko@chromium.org>
Date: Wed Dec 13 20:33:34 2017

Status: Fixed (was: Started)
i believe this should be all set now by virtue of using platform2

Comment 21 Deleted

Comment 22 by xz...@google.com, Dec 14 2017

C#19 solved the problem by removing calls to protoc in Makefile. There will be more CLs coming to separate arc-setup and move arc-setup to platform2.
Status: Verified (was: Fixed)
Thanks for fixing this.

Sign in to add a comment