</div><div>I've been trying to get the bazel-bootstrap package to build on mips64el. It's *almost* completing now but it runs into an error when trying to clean an output directory.[1] This is using `deleteRecursively` from Guava [2] which issupposed to delete files and directories recursively, as the name implies. However, it throws an error [3] complaining that the target is a directory. This error makes no sense and the code works just fine on all other architectures supported by Bazel (
Hello Java Team and OpenJDK Team,
I'm hesitant to start filing potentially serious bugs at this point in the release cycle so please let me know if there's something I'm missing in
this situation.
I've been trying to get the bazel-bootstrap package to build on mips64el. It's *almost* completing now but it runs into an error when trying to clean an output directory.[1] This is using `deleteRecursively` from Guava [2] which is supposed to delete files and directories recursively, as the name implies. However, it throws an error [3] complaining that the target is a directory. This error makes no sense and the code works just fine on all other architectures supported by Bazel (amd64, arm64, ppc64el, s390x,
ppc64, and riscv64).
Any insights or suggestions would be greatly appreciated!
-Olek
[1] https://salsa.debian.org/bazel-team/bazel-bootstrap/-/blob/olek-mips-riscv-3/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java#L379
[2] https://salsa.debian.org/java-team/guava-libraries/-/blob/master/guava/src/com/google/common/io/MoreFiles.java#L521
[3] https://buildd.debian.org/status/fetch.php?pkg=bazel-bootstrap&arch=mips64el&ver=3.5.1%2Bds-3%7Eexp2&stamp=1612583842&raw=0
On 2/12/21 10:26 PM, Olek Wojnar wrote:
Any insights or suggestions would be greatly appreciated!
you could try to debug with java -zero / javac -J-zero on amd64.
On 2/12/21 10:26 PM, Olek Wojnar wrote:
Any insights or suggestions would be greatly appreciated!
you could try to debug with java -zero / javac -J-zero on amd64.
Hi,
This particular exception is being thrown by the call to unlinkat [1]
which calls native unlinkat. Man page for unlinkat describes EISDIR
error [2] as:
"EISDIR pathname refers to a directory, and AT_REMOVEDIR was not
specified in flags."
Assuming unlinkat is telling the truth and this is indeed a directory,
it can be seen from the stacktrace that deleteRecursivelySecure is
calling deleteFile [3] instead of deleteDir (deleteDir does set AT_REMOVERDIR).
This seems to indicate that the isDirectory call [4] is getting wrong
file attributes. Following the trail, those file attributes come from
a fstatat call [5] which ultimately come from the native stack in UnixNativeDispatcher.c [6]. The actual way that fstatat is called
depends on the build flags and defines from the arch, so somebody with
better knowledge might want to take a look at UnixNativeDispatcher.c
[6] and tell if OpenJDK is picking the right function to call for
mips64el.
References:
[1] unlinkat call https://sources.debian.org/src/openjdk-11/11.0.10+9-1/src/java.base/unix/classes/sun/nio/fs/UnixSecureDirectoryStream.java/#L200
[2] EISDIR in OpenJDK: https://sources.debian.org/src/openjdk-11/11.0.10+9-1/src/hotspot/share/runtime/os.cpp/#L1504
[3] https://salsa.debian.org/java-team/guava-libraries/-/blob/master/guava/src/com/google/common/io/MoreFiles.java#L630
[4] https://salsa.debian.org/java-team/guava-libraries/-/blob/master/guava/src/com/google/common/io/MoreFiles.java#L335
[5] https://sources.debian.org/src/openjdk-11/11.0.10+9-1/src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java/#L90
you could try to debug with java -zero / javac -J-zero on amd64.
It selects the "Zero" VM, which I assume is the one used on mips64el.
https://openjdk.java.net/projects/zero/
This seems to indicate that the isDirectory call [4] is getting wrong
file attributes. Following the trail, those file attributes come from
a fstatat call [5] which ultimately come from the native stack in UnixNativeDispatcher.c [6]. The actual way that fstatat is called
depends on the build flags and defines from the arch, so somebody with
better knowledge might want to take a look at UnixNativeDispatcher.c
[6] and tell if OpenJDK is picking the right function to call for
mips64el.
Done! [1] Unfortunately, I don't see anything useful there but perhaps one
of you will.
-Olek
[1] https://gist.githubusercontent.com/olekw/32e54c0829d739e8fa88893a853c0fa8/raw/b2fce4d2ab77555a3d28c22441f1de3cb2d99f38/bazel-bootstrap-zero-jre
On Sat, Feb 13, 2021 at 2:21 PM <raphael.jolly@free.fr <mailto:raphael.jolly@free.fr>> wrote:
It selects the "Zero" VM, which I assume is the one used on mips64el.
https://openjdk.java.net/projects/zero/
Ah, thanks for the explanation! It helped me to appropriately adjust build-depends. Hmm, it looks
like Zero is not supported on MIPS at the moment, but perhaps that site is just out-of-date?
On Sat, Feb 13, 2021 at 6:56 PM Tiago Daitx <tiago.daitx@canonical.com <mailto:tiago.daitx@canonical.com>> wrote:
This seems to indicate that the isDirectory call [4] is getting wrong
file attributes. Following the trail, those file attributes come from
a fstatat call [5] which ultimately come from the native stack in
UnixNativeDispatcher.c [6]. The actual way that fstatat is called
depends on the build flags and defines from the arch, so somebody with
better knowledge might want to take a look at UnixNativeDispatcher.c
[6] and tell if OpenJDK is picking the right function to call for
mips64el.
Thanks for the excellent analysis! So is this indeed a bug in OpenJDK on mips64el then? I'm happy to
file the bug, referencing all of the information in this thread, if that's the probable culprit here.
On 2/15/21 1:40 AM, Olek Wojnar wrote:
On Sat, Feb 13, 2021 at 2:21 PM <raphael.jolly@free.fr <mailto:raphael.jolly@free.fr>> wrote:
It selects the "Zero" VM, which I assume is the one used on mips64el.
https://openjdk.java.net/projects/zero/
Ah, thanks for the explanation! It helped me to appropriately adjust build-depends. Hmm, it looks
like Zero is not supported on MIPS at the moment, but perhaps that site is just out-of-date?
There only Zero on mips64el for all current OpenJDKs. Zero for mips64el should be supported since
JDK 10, see JDK-8186313: https://bugs.openjdk.java.net/browse/JDK-8186313
...so openjdk-11 is supposed to work.
On Sat, Feb 13, 2021 at 6:56 PM Tiago Daitx <tiago.daitx@canonical.com <mailto:tiago.daitx@canonical.com>> wrote:
This seems to indicate that the isDirectory call [4] is getting wrong
file attributes. Following the trail, those file attributes come from
a fstatat call [5] which ultimately come from the native stack in
UnixNativeDispatcher.c [6]. The actual way that fstatat is called
depends on the build flags and defines from the arch, so somebody with
better knowledge might want to take a look at UnixNativeDispatcher.c
[6] and tell if OpenJDK is picking the right function to call for
mips64el.
Thanks for the excellent analysis! So is this indeed a bug in OpenJDK on mips64el then? I'm happy to
file the bug, referencing all of the information in this thread, if that's the probable culprit here.
Thing is, there is hardly anyone who supports mips64el in OpenJDK upstream. I think Debian folks are
the most heavy users of it :) So, while you can submit a bug upstream, I don't think there is a high
chance anyone picks it up. You can try to ask here:
https://mail.openjdk.java.net/mailman/listinfo/mips-port
It looks to me that Zero mips64el is another instance of SecureDirectoryStream bug tail:
https://bugs.openjdk.java.net/issues/?jql=text%20~%20%22SecureDirectoryStream%22
If there is the mips64el machine where this reproduces, the next step would be trying the mainline
JDK NIO tests, something like:
$ git clone https://github.com/openjdk/jdk
$ cd jdk
$ wget https://builds.shipilev.net/jtreg/jtreg.zip
$ unzip jtreg.zip
$ ./configure --with-debug-level=fastdebug --with-jtreg=./jtreg
$ make run-test TEST=java/nio
...and if that does not yield failures, then MCVE would be needed.
--
Thanks,
-Aleksey
On Mon, Feb 15, 2021 at 10:22 PM Aleksey Shipilev <shade@redhat.com> wrote:
On 2/15/21 1:40 AM, Olek Wojnar wrote:
On Sat, Feb 13, 2021 at 2:21 PM <raphael.jolly@free.fr <mailto:raphael.jolly@free.fr>> wrote:
It selects the "Zero" VM
I tried to dpkg-buildpackage bazel-bootstrap, but I failed to
reproduce the issue. It seems a long time is needed. Is there a
simpler way to reproduce the problem?
has anything to do with this problem.
On Mon, Feb 15, 2021 at 10:22 PM Aleksey Shipilev <shade@redhat.com>wrote:
raphael.jolly@free.fr>> wrote:On 2/15/21 1:40 AM, Olek Wojnar wrote:
On Sat, Feb 13, 2021 at 2:21 PM <raphael.jolly@free.fr <mailto:
mips64el.It selects the "Zero" VM, which I assume is the one used on
https://openjdk.java.net/projects/zero/
build-depends. Hmm, it looksAh, thanks for the explanation! It helped me to appropriately adjust
site is just out-of-date?like Zero is not supported on MIPS at the moment, but perhaps that
mips64el should be supported sinceThere only Zero on mips64el for all current OpenJDKs. Zero for
https://bugs.openjdk.java.net/browse/JDK-8186313JDK 10, see JDK-8186313:
...so openjdk-11 is supposed to work.
Thing is, there is hardly anyone who supports mips64el in OpenJDKupstream. I think Debian folks are
I don't think there is a highthe most heavy users of it :) So, while you can submit a bug upstream,
chance anyone picks it up. You can try to ask here:
I would like to pick it up. However, I am on vacation at the moment
and did not have a mips64el machine on hand. If time permits, I will
return to the company in three days to follow up on this issue.
It looks to me that Zero mips64el is another instance ofSecureDirectoryStream bug tail:
https://bugs.openjdk.java.net/issues/?jql=text%20~%20%22SecureDirectoryStream%22
would be trying the mainlineIf there is the mips64el machine where this reproduces, the next step
JDK NIO tests, something like:
$ git clone https://github.com/openjdk/jdk
$ cd jdk
$ wget https://builds.shipilev.net/jtreg/jtreg.zip
$ unzip jtreg.zip
$ ./configure --with-debug-level=fastdebug --with-jtreg=./jtreg
$ make run-test TEST=java/nio
...and if that does not yield failures, then MCVE would be needed.
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> I would like to pick it up. However, I am on vacation at the moment<br>> and did not have a mips64el machine on hand. If time permits, I will<br> > return to the company in three days to follow up on this issue.<br></blockquote><div><br></div><div>Thanks for the follow-up! It sounds like we may have a better idea of what's going on now. </div><div><br></div><blockquote class="gmail_quote"
</div><div dir="ltr" class="gmail_attr">Thanks!</div><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr">-Olek</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>
Update: I see that a new version of OpenJDK 11 is currently building for mips64el. Does this new version address the directory deletion issue?
If so, then yay and thanks. If not, I'll go ahead and just report a bug against the Debian package so it's easier to track. I'm thinking Severity Important, does that sound fair?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 90:24:59 |
Calls: | 6,658 |
Files: | 12,203 |
Messages: | 5,334,090 |