Build-time test fails in some chroots

Bug #2071358 reported by Pushkar Kulkarni
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libmina-sshd-java (Debian)
Confirmed
Unknown
libmina-sshd-java (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Imported from Debian bug http://bugs.debian.org/1074355:

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

Related branches

tags: added: update-excuse
Changed in libmina-sshd-java (Debian):
importance: Undecided → Unknown
summary: - Build-time tests fails in some chroots
+ Build-time test fails in some chroots
Changed in libmina-sshd-java (Debian):
status: New → Confirmed
Revision history for this message
Vladimir Petko (vpa1977) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libmina-sshd-java - 2.12.1-2ubuntu1

---------------
libmina-sshd-java (2.12.1-2ubuntu1) oracular; urgency=medium

  * d/patches: Add patch to work-around SFTP test failure
    (LP: #2071358)

 -- Pushkar Kulkarni <email address hidden> Thu, 27 Jun 2024 18:14:54 +0530

Changed in libmina-sshd-java (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.