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

Issue 635573 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Feb 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

chromeos-installer: failed at unittest when upgrading glibc.

Project Member Reported by yunlian@chromium.org, Aug 8 2016

Issue description

With this patch I try to upgrade glibc to 2.23.
https://chromium-review.googlesource.com/#/c/339261/

I got the following error at unittest stage

The full log is at
https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/release/builds/5252/steps/UnitTest/logs/stdio

chromeos-installer-0.0.1-r1952: LDCXX		cros_installer_unittest
chromeos-installer-0.0.1-r1952: /mnt/host/source/src/platform2/installer/inst_util_unittest.cc:550: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
chromeos-installer-0.0.1-r1952: /mnt/host/source/src/platform2/installer/inst_util_unittest.cc:517: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
chromeos-installer-0.0.1-r1952: /mnt/host/source/src/platform2/installer/inst_util_unittest.cc:536: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
chromeos-installer-0.0.1-r1952: ./src/gtest.cc:3451: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
chromeos-installer-0.0.1-r1952: BIN		cros_installer_unittest
chromeos-installer-0.0.1-r1952: 	-----
chromeos-installer-0.0.1-r1952: TEST		cros_installer_unittest [SETUP]
chromeos-installer-0.0.1-r1952: TEST		cros_installer_unittest [RUN]
chromeos-installer-0.0.1-r1952: common.mk:524: recipe for target 'TEST(CXX_STATIC_BINARY(cros_installer_unittest))' failed
chromeos-installer-0.0.1-r1952: make[1]: [TEST(CXX_STATIC_BINARY(cros_installer_unittest))] Error 139 (ignored)
chromeos-installer-0.0.1-r1952: TEST		cros_installer_unittest [TEARDOWN]
chromeos-installer-0.0.1-r1952: common.mk:524: recipe for target 'TEST(CXX_STATIC_BINARY(cros_installer_unittest))' failed
chromeos-installer-0.0.1-r1952: make[1]: *** [TEST(CXX_STATIC_BINARY(cros_installer_unittest))] Error 1
chromeos-installer-0.0.1-r1952: make[1]: Leaving directory '/build/falco/tmp/portage/chromeos-base/chromeos-installer-0.0.1-r1952/work/build'
chromeos-installer-0.0.1-r1952: common.mk:171: recipe for target 'TEST(CXX_STATIC_BINARY(cros_installer_unittest))' failed
chromeos-installer-0.0.1-r1952: make: *** [TEST(CXX_STATIC_BINARY(cros_installer_unittest))] Error 2
chromeos-installer-0.0.1-r1952:  * ERROR: chromeos-base/chromeos-installer-0.0.1-r1952::chromiumos failed (test phase):
chromeos-installer-0.0.1-r1952:  *   emake failed
chromeos-installer-0.0.1-r1952:  * 

 
We hit this problem when upgrading glibc.
https://gcc.gnu.org/ml/gcc/2014-11/msg00246.html

The problem is that when linking statically with pthread, the linker
knows the pthread_once is undefined weak symbol and refuses
to resolve it.

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/bb2b55dc1da5976999e39e21b9563399d999e1fa

commit bb2b55dc1da5976999e39e21b9563399d999e1fa
Author: Yunlian Jiang <yunlian@google.com>
Date: Wed Aug 10 18:19:12 2016

installer: fix a runtime error for unittest.

We hit this problem when upgrading glibc.
https://gcc.gnu.org/ml/gcc/2014-11/msg00246.html

The problem is that when linking statically with pthread, the linker
knows pthread_once is undefined weak symbol and refuses
to resolve it.

The workaround in the upstream bug is to pass -lpthread like this
-Wl,--whole-archive -lpthread -Wl,--no-whole-archive.
However, in this package, the -lpthread is passed as the output of a
shell script, so we need to use another way to workaround it.

BUG= chromium:635573 
TEST=the unittest passes with new glibc.

Change-Id: I897937b77d6674f0179fd1b2d4cfb64bd44ae18c
Reviewed-on: https://chromium-review.googlesource.com/367455
Commit-Ready: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Reviewed-by: Luis Lozano <llozano@chromium.org>

[modify] https://crrev.com/bb2b55dc1da5976999e39e21b9563399d999e1fa/installer/Makefile

Status: Fixed (was: Untriaged)

Sign in to add a comment