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

JNI error: Failed to load JNI library #12375

Closed
meisterT opened this issue Oct 28, 2020 · 9 comments
Closed

JNI error: Failed to load JNI library #12375

meisterT opened this issue Oct 28, 2020 · 9 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug

Comments

@meisterT
Copy link
Member

Description of the problem / feature request:

While debugging some weirdness around //src/test/bazel/remote:remote_execution_test, I am seeing this in the test logs:

201028 15:32:55.513:WT 1 [com.google.devtools.build.lib.jni.JniLoader.<clinit>] Failed to load JNI library
java.lang.UnsatisfiedLinkError: /usr/local/google/home/twerth/.cache/bazel/_bazel_twerth/f01bc937da326f5bb0feb15c854c110c/sandbox/linux-sandbox/2355/execroot/io_bazel/_tmp/e29069609bc298cb3b1996e685786dd3/bazel-jni.4974307323357703982/libunix_jni.so: libstdc++.so.6: cannot open shared object file: No such file or directory
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2714)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
        at java.base/java.lang.Runtime.load0(Runtime.java:768)
        at java.base/java.lang.System.load(System.java:1837)
        at com.google.devtools.build.lib.jni.JniLoader.loadLibrary(JniLoader.java:106)
        at com.google.devtools.build.lib.jni.JniLoader.<clinit>(JniLoader.java:44)
        at com.google.devtools.build.lib.unix.ProcessUtils.<clinit>(ProcessUtils.java:24)
        at com.google.devtools.build.lib.util.ProcessUtils.getpid(ProcessUtils.java:51)
        at com.google.devtools.build.remote.worker.RemoteWorker.createPidFile(RemoteWorker.java:197)
        at com.google.devtools.build.remote.worker.RemoteWorker.main(RemoteWorker.java:287)
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'int com.google.devtools.build.lib.unix.ProcessUtils.getpid()'
        at com.google.devtools.build.lib.unix.ProcessUtils.getpid(Native Method)
        at com.google.devtools.build.lib.util.ProcessUtils.getpid(ProcessUtils.java:51)
        at com.google.devtools.build.remote.worker.RemoteWorker.createPidFile(RemoteWorker.java:197)
        at com.google.devtools.build.remote.worker.RemoteWorker.main(RemoteWorker.java:287)

I believe this is unrelated to the test itself and may point to a bigger, hidden problem.

@meisterT
Copy link
Member Author

cc @alandonovan who reviewed recent JNI changes by Julio

@meisterT
Copy link
Member Author

meisterT commented Oct 28, 2020

Ah, with USE_BAZEL_VERSION=last_green bazelisk test --test_arg=test_fail //src/test/shell/bazel/remote:remote_execution_test this is gone, so probably can be ignored / deduplicated.

scratch that - it's still there, was just looking in the wrong place

@oquenchil
Copy link
Contributor

Installing openjdk-8 and then bazel clean --expunge should get rid of this error.

@meisterT
Copy link
Member Author

But why? We ship Bazel with an embedded JVM so you don't have to install it yourself just to run the server. Do we need to include more files there?

@philwo philwo added team-Remote-Exec Issues and PRs for the Execution (Remote) team untriaged type: bug labels Nov 10, 2020
@meisterT
Copy link
Member Author

I already have openjdk-8 installed, this doesn't help for me.

@coeuvre coeuvre added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Dec 9, 2020
@coeuvre
Copy link
Member

coeuvre commented Dec 9, 2020

@meteorcloudy Yun, is this related to what you have fixed recently?

@meteorcloudy
Copy link
Member

Nope, I fixed #12376 and #12377, it doesn't seem to be related to this issue.

@meteorcloudy
Copy link
Member

@meisterT This test isn't failing on CI, it looks like the failure may be related to your local environment?

@meisterT
Copy link
Member Author

meisterT commented Dec 9, 2020

It's not failing, I just saw that in the logs. But it seems to be triggered by my local environment. Closing.

@meisterT meisterT closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug
Projects
None yet
Development

No branches or pull requests

5 participants