Bug#1074355: Build-time tests fails in some chroots

Pushkar Kulkarni pushkar.kulkarni at canonical.com
Thu Jun 27 09:08:53 BST 2024


Source: libmina-sshd-java
Version: 2.12.1-2
Severity: normal

The test
org.apache.sshd.sftp.client.extensions.helpers.SpaceAvailableExtensionImplTest.testFileStoreReport()
is observed to be failing in some chroots. Failures have been reported on
launchpad [1] and in the Debian CI [2]. The test fails with the following
exception:

java.io.IOException: Mount point not found
at
java.base/sun.nio.fs.LinuxFileStore.findMountEntry(LinuxFileStore.java:105)
at java.base/sun.nio.fs.UnixFileStore.<init>(UnixFileStore.java:69)
at java.base/sun.nio.fs.LinuxFileStore.<init>(LinuxFileStore.java:49)
at
java.base/sun.nio.fs.LinuxFileSystemProvider.getFileStore(LinuxFileSystemProvider.java:51)
at
java.base/sun.nio.fs.LinuxFileSystemProvider.getFileStore(LinuxFileSystemProvider.java:39)
at
java.base/sun.nio.fs.UnixFileSystemProvider.getFileStore(UnixFileSystemProvider.java:381)
at java.base/java.nio.file.Files.getFileStore(Files.java:1498)

I could not reproduce this error in my local chroot. I also do not have
access to a chroot where this issue is reproducible at will. However, I do
have a theory based on an internet search.

In particular, because we depend on /proc/mount to derive the FileStore for
a file, this kind of a failure could have one of these reasons:
a. The chroot has no /proc/mount
b. The /proc/mount has a lack of information
c. The chroot needs root permissions to read /proc/mount

The use of FileStores has been reported to fail in chroot environments in
the past [3][4]. I couldn't conclude about the extent to which this issue
has been resolved in the openjdk. But [3][5] do suggest a way to avoid this
problem.

We run into this issue while getting the FileStore for a given Path using
java.nio.file.Files.getFileStore(Path), which is what
SpaceAvailableExtensionImplTest.testFileStoreReport() does. Alternatively,
only for the sake of this test, we could use
path.getFileSystem().getFileStores() and loop this test through them. This
will, of course, run many more unnecessary tests including the current one.
But it might be better than skipping this altogether.

I hope to submit a patch.

[1]
https://launchpadlibrarian.net/736702067/buildlog_ubuntu-oracular-amd64.libmina-sshd-java_2.12.1-2ppa5_BUILDING.txt.gz
[2]
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/libmina-sshd-java.html
[3] https://mail.openjdk.org/pipermail/nio-dev/2016-October/003915.html
[4] https://bugs.openjdk.org/browse/JDK-8165323
[5] https://hg.openjdk.org/jdk9/jdk9/jdk/rev/2e1e4c9c8af2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-maintainers/attachments/20240627/ee632c2a/attachment.htm>


More information about the pkg-java-maintainers mailing list