Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile bazel on centos6 successful but trigger /lib64/libc.so.6: version `GLIBC_2.14' not found #4374

Closed
wush978 opened this issue Jan 2, 2018 · 11 comments
Labels
area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug

Comments

@wush978
Copy link

wush978 commented Jan 2, 2018

Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.

Description of the problem / feature request / question:

The compiled bazel executable yields the following errors:

[linuxbrew@3e67cadeb1b0 build-bazel]$ jenv exec output/bazel --help
Extracting Bazel installation...
...
Server crashed during startup. Now printing '/home/linuxbrew/.cache/bazel/_bazel_linuxbrew/3f8a7cd0bf59ecd065c281daa40527cb/server/jvm.out':
JNI initialization failed: /home/linuxbrew/.cache/bazel/_bazel_linuxbrew/install/f75975279c416ea3cf82411356d17f89/_embedded_binaries/libunix.so: /lib64/libc.so.6: version `GLIBC_2.14' not found (required
by /home/linuxbrew/.cache/bazel/_bazel_linuxbrew/install/f75975279c416ea3cf82411356d17f89/_embedded_binaries/libunix.so).  Possibly your installation has been corrupted.
java.lang.UnsatisfiedLinkError: /home/linuxbrew/.cache/bazel/_bazel_linuxbrew/install/f75975279c416ea3cf82411356d17f89/_embedded_binaries/libunix.so: /lib64/libc.so.6: version `GLIBC_2.14' not found (requ
ired by /home/linuxbrew/.cache/bazel/_bazel_linuxbrew/install/f75975279c416ea3cf82411356d17f89/_embedded_binaries/libunix.so)

If possible, provide a minimal example to reproduce the problem:

docker pull wush978/bazel-glibc-centos6
docker run -it wush978/bazel-glibc-centos6 /bin/bash
# under docker
cd /tmp
mkdir build-bazel2
cd build-bazel2
jenv local 1.8
unzip ~/.cache/Homebrew/bazel-0.9.0.zip
jenv exec ./compile.sh
jenv exec output/bazel

Environment info

  • Operating System: Centos 6
  • Bazel version (output of bazel info release): 0.9.0
  • There are two glibc:
    • Host glibc: 2.12
    • linuxbrew glibc: 2.23
  • java 1.8

Have you found anything relevant by searching the web?

(e.g. StackOverflow answers,
GitHub issues,
email threads on the bazel-discuss Google group)

There are some instruction of modifying CROSSTOOL which is no effect in version 0.9.

Anything else, information or logs or outputs that would be helpful?

(If they are large, please upload as attachment or provide link).

@hlopko
Copy link
Member

hlopko commented Jan 3, 2018

Which version of centos6? We have a ci job testing for centos 6.7 (https://source.bazel.build/bazel/+/master:src/test/docker/Dockerfile.centos6.7?q=centos) and it's green. I'd assume it's the problem with your configuration, maybe wrong glibc is detected because of linuxbrew. Which gcc version do you use? It would help me greatly if you could isolate the problem more (to the level of "this step in cc_configure.bzl is incorrect because ..."). Thanks!

@hlopko hlopko self-assigned this Jan 3, 2018
@hlopko hlopko added category: misc > bootstrap / installation P3 We're not considering working on this, but happy to review a PR. (No assignee) type: bug labels Jan 3, 2018
@wush978
Copy link
Author

wush978 commented Jan 3, 2018

Hi @mhlopko , thanks for your reply.

We're using gcc-5.4.0 which is installed via linuxbrew.
The docker image above is based on centos-release-6-9.el6.12.3.x86_64.

Because I am new to bazel, is there any guide for understanding cc_configure.bzl?

@hlopko
Copy link
Member

hlopko commented Feb 2, 2018

Not really, just the code. The TLDR is that bazel executes that code before the build starts to configure the C++ toolchain.

@chaoren
Copy link
Contributor

chaoren commented Mar 27, 2018

I'm running into the same problem.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux rodete (upgraded from: Ubuntu 14.04.5 LTS)
Release:        rodete
Codename:       rodete
$ git rev-parse HEAD
e666d3b88efb59f2a8f10b18882c9f13801508d9
$ bazel build //src:bazel
INFO: Analysed target //src:bazel (1 packages loaded).
INFO: Found 1 target...
Target //src:bazel up-to-date:
  bazel-bin/src/bazel
INFO: Elapsed time: 9.654s, Critical Path: 9.15s
INFO: Build completed successfully, 8 total actions
$ ./bazel-bin/src/bazel
Starting local Bazel server and connecting to it...
...
Server crashed during startup. Now printing $HOME/.cache/bazel/_bazel_$USER/01115f8ce9481ee60d028a899f74d769/server/jvm.out
JNI initialization failed: $HOME/.cache/bazel/_bazel_$USER/install/9bd122f52c77fd712c59125d8b3db8b7/_embedded_binaries/libunix.so: /usr/crosstool/v18/x86_64-grtev4-linux-gnu/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by $HOME/.cache/bazel/_bazel_$USER/install/9bd122f52c77fd712c59125d8b3db8b7/_embedded_binaries/libunix.so).  Possibly your installation has been corrupted.
java.lang.UnsatisfiedLinkError: $HOME/.cache/bazel/_bazel_$USER/install/9bd122f52c77fd712c59125d8b3db8b7/_embedded_binaries/libunix.so: /usr/crosstool/v18/x86_64-grtev4-linux-gnu/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by $HOME/.cache/bazel/_bazel_$USER/install/9bd122f52c77fd712c59125d8b3db8b7/_embedded_binaries/libunix.so)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1948)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1122)
        at com.google.devtools.build.lib.UnixJniLoader.loadJni(UnixJniLoader.java:28)
        at com.google.devtools.build.lib.unix.ProcessUtils.<clinit>(ProcessUtils.java:28)
        at com.google.devtools.build.lib.util.ProcessUtils.getpid(ProcessUtils.java:47)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.getPidUsingJNI(BlazeRuntime.java:1155)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.maybeForceJNIByGettingPid(BlazeRuntime.java:1144)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.maybeGetPidString(BlazeRuntime.java:1137)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.main(BlazeRuntime.java:608)
        at com.google.devtools.build.lib.bazel.BazelMain.main(BazelMain.java:60)
ERROR: <unknown> crash in async thread:
java.lang.UnsatisfiedLinkError: $HOME/.cache/bazel/_bazel_$USER/install/9bd122f52c77fd712c59125d8b3db8b7/_embedded_binaries/libunix.so: /usr/crosstool/v18/x86_64-grtev4-linux-gnu/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by $HOME/.cache/bazel/_bazel_$USER/install/9bd122f52c77fd712c59125d8b3db8b7/_embedded_binaries/libunix.so)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1948)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1122)
        at com.google.devtools.build.lib.UnixJniLoader.loadJni(UnixJniLoader.java:28)
        at com.google.devtools.build.lib.unix.ProcessUtils.<clinit>(ProcessUtils.java:28)
        at com.google.devtools.build.lib.util.ProcessUtils.getpid(ProcessUtils.java:47)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.getPidUsingJNI(BlazeRuntime.java:1155)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.maybeForceJNIByGettingPid(BlazeRuntime.java:1144)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.maybeGetPidString(BlazeRuntime.java:1137)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.main(BlazeRuntime.java:608)
        at com.google.devtools.build.lib.bazel.BazelMain.main(BazelMain.java:60)
$ ldd $HOME/.cache/bazel/_bazel_$USER/install/9bd122f52c77fd712c59125d8b3db8b7/_embedded_binaries/libunix.so
        linux-vdso.so.1 (0x00007fb10cb96000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb10c5f0000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb10c2ec000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb10c0d4000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb10bd35000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb10c975000)

@chaoren
Copy link
Contributor

chaoren commented Mar 27, 2018

I don't know why the error shows /usr/crosstool/v18/x86_64-grtev4-linux-gnu/lib64/libstdc++.so.6 while ldd shows /usr/lib/x86_64-linux-gnu/libstdc++.so.6.

@jin
Copy link
Member

jin commented Mar 29, 2018

@chaoren, this is a bug with Bazel on Rodete. Check out the internal go/bazel FAQ page for the workaround (you'll need to set JAVA_HOME to OpenJDK)

@chaoren
Copy link
Contributor

chaoren commented Mar 29, 2018

Ah, thanks. Would that work for this user on centos6 as well?

@meisterT
Copy link
Member

Is this still an issue?

@Char-Aznable
Copy link

I have the same issue on CentOS 7:

libunix.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found

my OS is:

LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.8.2003 (Core)
Release:        7.8.2003
Codename:       Core

Setting JAVA_HOME to openJDK does work
@meisterT

@jin jin added area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website labels Mar 1, 2021
@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Apr 26, 2023
@github-actions
Copy link

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage). Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug
Projects
None yet
Development

No branches or pull requests

7 participants