Path: csiph.com!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod From: Tiago Daitx Newsgroups: linux.debian.maint.java,linux.debian.ports.mips Subject: Re: Potential bug in openjdk-11 on mips64el Date: Sun, 14 Feb 2021 01:00:01 +0100 Message-ID: References: X-Original-To: Olek Wojnar X-Mailbox-Line: From debian-java-request@lists.debian.org Sat Feb 13 23:56:56 2021 Old-Return-Path: X-Amavis-Spam-Status: No, score=-11.978 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5, MURPHY_DRUGS_REL8=0.02, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001] autolearn=ham autolearn_force=no X-Policyd-Weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .canonical. - helo: .youngberry.canonical. - helo-domain: .canonical.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -5.5 X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ol1oQMDe1KEG3TBu6UCTWV66EltrnwIX4/Xqfiqlglc=; b=hdm9bOrdmjfUy0TffnTuEBmDuXLrYj2fHH3+vvOdYw4gDPrvFedKpBhrdJWq52+njK Ms/oUhpu7LKJzZSGOpf+DJKIa6CFUfSSdVCC9MpN62QcLwp8gi3lNGdnIB/32LMCy0o6 4crUpGxcWGPSfXWXneJVSvAt3CQSSplsU5f4rz1hXoJEYEun2jdqXtXWlUkqqe8YiU4P eUCCNPyiIe3npnFeEQsvYBXnHegtr5YMq3X9q8w4BobYAfZx+99caYQLArclXKF//iYR BEwjc/o5gdc8J+M0LbgOCWrr1Typr07c2SGenp7gWegKO7kbW5hJMZDEufrg7UJHTGWu 2Hpw== X-Gm-Message-State: AOAM531/TpXQRIOZZWDXFPn7YWT9ZppqrLiOg71PRgtxl6VN7R1Hpi9q CHRsWQqNr+MUBIbXTpCKI4IICgmCAfAuETHwBGeWb/g5OebFGvYukkI2uPMqiSqHYHVC+amLKdr +8oCHTgkr4J0Ilw2edgHGUxDPwIkr7PdrZgbCSm+FUsGege+r21XGd9XYpw== X-Received: by 2002:a05:6602:2a43:: with SMTP id k3mr7805518iov.16.1613260596551; Sat, 13 Feb 2021 15:56:36 -0800 (PST) X-Google-SMTP-Source: ABdhPJxuCtbPkcetgy78scrmDwPuwT1y8S1QY/e5vw4BMyCePmkX8OGGX9A1eOFkM6gd7zSrQqz2PoTyQXRLANynpzg= X-Received: by 2002:a05:6602:2a43:: with SMTP id k3mr7805514iov.16.1613260596361; Sat, 13 Feb 2021 15:56:36 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailing-List: archive/latest/22693 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/CAC-Dh9-rCxUc1PkiJLaejXuNQo=+8F5AiC=EwTUV1jEENXO5bQ@mail.gmail.com Approved: robomod@news.nic.it Lines: 46 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: openjdk-11@packages.debian.org, Debian Java List , "debian-mips@lists.debian.org" , Debian Bazel Packaging Team X-Original-Date: Sat, 13 Feb 2021 20:56:25 -0300 X-Original-Message-ID: X-Original-References: <22ba18ae-501b-3db3-47db-b3ac6f6fb1b6@debian.org> Xref: csiph.com linux.debian.maint.java:12066 linux.debian.ports.mips:2891 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/cl= asses/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/run= time/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/uni= x/classes/sun/nio/fs/UnixFileAttributes.java/#L90 cheers, --=20 Tiago St=C3=BCrmer Daitx Software Engineer tiago.daitx@canonical.com PGP Key: 4096R/F5B213BE (hkp://keyserver.ubuntu.com) Fingerprint =3D 45D0 FE5A 8109 1E91 866E 8CA4 1931 8D5E F5B2 13BE