ClassLoader.loadLibrary NullPointerException Regression in 8u242
Chris Smith
chris.smith at zocdoc.com
Mon Jan 27 14:27:41 UTC 2020
Thanks for taking a look Anton,
There is another way to reproduce the bug but it's more complicated
than just starting the server. Since teamcity is very stateful, I
likely had some other change that allowed me to reproduce this using
the previous method.
To isolate all the environmental stuff you can use the modified
version of the Dockerfile here
https://github.com/chris-smith-zocdoc/teamcity-docker-server/commit/d89927a29d99defb826c8eec7babfad82744fe8c
Just clone that repo and follow these steps, it's more tedious but
should be 100% reproducible.
docker build -f ubuntu/Dockerfile -t tc-ubuntu:latest .
docker run -it -p 8111:8111 tc-ubuntu:latest
Now you should have a bash prompt running in the context of the docker container
./run-services.sh
Now that the server is running, we need to setup TeamCity and
configure a version control system (VCS). This particular codepath
triggers the bug
open localhost:8111 in your browser
click through the setup, the default settings are fine
create a user. you should see your "profile settings" now
click the TeamCity icon in the top left to go to the main screen
click "Create project"
click "Manually" and enter a name, click next
click "Create build configuration"
enter a name, click next
change the "Type of VCS:" to "git"
enter a name into "VCS root name: " (eg test)
enter any git repo into "Fetch URL" (eg "git at github.com:openjdk/jdk.git")
click "Test Connection"
At this point you should receive an error "Connection failed!"
and either the message
Test connection failed in test / test
See teamcity-vcs.log for more details.
or
Test connection failed in test / test
Could not initialize class sun.nio.fs.LinuxNativeDispatcher
If you look at the output in your console you should see
java.lang.NoClassDefFoundError: Could not initialize class
sun.nio.fs.LinuxNativeDispatcher
at sun.nio.fs.LinuxFileSystem.getMountEntries(LinuxFileSystem.java:81)
at sun.nio.fs.LinuxFileStore.findMountEntry(LinuxFileStore.java:70)
at sun.nio.fs.UnixFileStore.<init>(UnixFileStore.java:65)
at sun.nio.fs.LinuxFileStore.<init>(LinuxFileStore.java:44)
at sun.nio.fs.LinuxFileSystemProvider.getFileStore(LinuxFileSystemProvider.java:51)
at sun.nio.fs.LinuxFileSystemProvider.getFileStore(LinuxFileSystemProvider.java:39)
at sun.nio.fs.UnixFileSystemProvider.getFileStore(UnixFileSystemProvider.java:368)
at java.nio.file.Files.getFileStore(Files.java:1461)
....
with a caused by
Caused by: java.lang.NullPointerException
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at sun.nio.fs.LinuxNativeDispatcher$1.run(LinuxNativeDispatcher.java:126)
at sun.nio.fs.LinuxNativeDispatcher$1.run(LinuxNativeDispatcher.java:124)
at java.security.AccessController.doPrivileged(Native Method)
at sun.nio.fs.LinuxNativeDispatcher.<clinit>(LinuxNativeDispatcher.java:124)
... 104 more
On Mon, Jan 27, 2020 at 4:38 AM Anton Kozlov <akozlov at azul.com> wrote:
>
> On 27.01.2020 11:20, Anton Kozlov wrote:
> >> You can use their docker container to reproduce the bug though
> >> change the version to https://corretto.aws/downloads/resources/8.242.07.1/amazon-corretto-8.242.07.1-linux-x64.tar.gz
> >> hit the server on http://localhost:8111/
> >> exception is logged to /opt/teamcity/logs/catalina.out
> >> I can explain more if there is interest.
>
> I was unable to reproduce the issue.
> I followed TeamCity installation instructions to create a docker image.
> The docker image do not specify particular TeamCity version, so I used recent 2019.2.1
>
> I was able to login into TeamCity via web-browser.
> I have no catalina.out, but have catalina.<date>.log. In the log, there is not NullPointerException.
>
> Excerpt from the log
>
> 27-Jan-2020 08:54:01.518 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/8.5.47
> 27-Jan-2020 08:54:01.522 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Oct 7 2019 13:30:46 UTC
> 27-Jan-2020 08:54:01.522 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.47.0
> 27-Jan-2020 08:54:01.522 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
> 27-Jan-2020 08:54:01.523 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.4.6-arch1-1
> 27-Jan-2020 08:54:01.523 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
> 27-Jan-2020 08:54:01.523 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /opt/java/openjdk/jre
> 27-Jan-2020 08:54:01.523 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_242-b07
> 27-Jan-2020 08:54:01.523 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Amazon.com Inc.
>
> I think it probably related to TeamCity version. Which one do you use?
>
> Thanks,
> Anton
>
More information about the jdk8u-dev
mailing list