Debian Bug report logs - #855858
[openjdk-8-jre] jexec'ing .jar-files through binfmt doesn't work

version graph

Package: openjdk-8-jre; Maintainer for openjdk-8-jre is OpenJDK Team <openjdk@lists.launchpad.net>; Source for openjdk-8-jre is src:openjdk-8 (PTS, buildd, popcon).

Reported by: Steffen Weinhart <stw392@blue-cable.de>

Date: Wed, 22 Feb 2017 14:39:02 UTC

Severity: normal

Found in version openjdk-8/8u121-b13-3

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, OpenJDK Team <openjdk@lists.launchpad.net>:
Bug#855858; Package openjdk-8-jre. (Wed, 22 Feb 2017 14:39:04 GMT) (full text, mbox, link).


Acknowledgement sent to Steffen Weinhart <stw392@blue-cable.de>:
New Bug report received and forwarded. Copy sent to OpenJDK Team <openjdk@lists.launchpad.net>. (Wed, 22 Feb 2017 14:39:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Steffen Weinhart <stw392@blue-cable.de>
To: submit@bugs.debian.org
Subject: [openjdk-8-jre] jexec'ing .jar-files through binfmt doesn't work
Date: Wed, 22 Feb 2017 15:34:32 +0100
Package: openjdk-8-jre
Version: 8u121-b13-3
Severity: normal

--- Please enter the report below this line. ---
When trying to execute a .jar-file (x-bit is set) via terminal, I get 
the error 'invalid file (bad magic number): Exec format error'. The same 
procedure with the same .jar used to work in an earlier version of 
openjdk (about 2 months ago, already openjdk-8).

The installed binfmt executes jexec on the file. Typing 'jexec 
$jar_file' throws the same error.
Executing 'java -jar $jar_file' still works as expected, no errors, so I 
think jexec doesn't call java or whatever program correctly.

--- System information. ---
Architecture:
Kernel: Linux 4.9.9

Debian Release: 9.0
900 testing ftp.de.debian.org
900 testing deb-multimedia.org
500 stable-updates ftp.de.debian.org
500 stable security.debian.org
500 stable ftp.de.debian.org
500 proposed-updates ftp.de.debian.org
50 unstable ftp.de.debian.org
50 unstable deb-multimedia.org
100 jessie-backports ftp.de.debian.org
1 experimental ftp.de.debian.org

--- Package information. ---
Depends (Version) | Installed
================================================-+-=====================
openjdk-8-jre-headless (= 8u121-b13-3) | 8u121-b13-3
libgtk2.0-0 | 2.24.31-2
libxrandr2 | 2:1.5.1-1
libxinerama1 |
libgl1-mesa-glx |
OR libgl1 |
libatk-wrapper-java-jni (>= 0.30.4-0ubuntu2) |
libasound2 (>= 1.0.16) |
libc6 (>= 2.14) |
libgif7 (>= 5.1) |
libjpeg62-turbo (>= 1.3.1) |
libpng16-16 (>= 1.6.2-1) |
libpulse0 (>= 0.99.1) |
libx11-6 |
libxext6 |
zlib1g (>= 1:1.1.4) |


Recommends (Version) | Installed
=================================-+-===========
libgnome-2-0 | 2.32.1-5
libgnomevfs2-0 | 1:2.24.4-6.1+b1
libgconf-2-4 | 3.2.6-4
fonts-dejavu-extra | 2.37-1


Suggests (Version) | Installed
===============================-+-===========
icedtea-8-plugin | 1.6.2-3.1



Information forwarded to debian-bugs-dist@lists.debian.org, OpenJDK Team <openjdk@lists.launchpad.net>:
Bug#855858; Package openjdk-8-jre. (Fri, 03 Mar 2017 21:57:06 GMT) (full text, mbox, link).


Acknowledgement sent to Kevin Locke <kevin@kevinlocke.name>:
Extra info received and forwarded to list. Copy sent to OpenJDK Team <openjdk@lists.launchpad.net>. (Fri, 03 Mar 2017 21:57:06 GMT) (full text, mbox, link).


Message #10 received at 855858@bugs.debian.org (full text, mbox, reply):

From: Kevin Locke <kevin@kevinlocke.name>
To: 855858@bugs.debian.org
Subject: Re: [openjdk-8-jre] jexec'ing .jar-files through binfmt doesn't work
Date: Fri, 3 Mar 2017 14:48:51 -0700
On Wed, 2017-02-22 at 15:34 +0100, Steffen Weinhart wrote:
> When trying to execute a .jar-file (x-bit is set) via terminal, I get the
> error 'invalid file (bad magic number): Exec format error'. The same
> procedure with the same .jar used to work in an earlier version of openjdk
> (about 2 months ago, already openjdk-8).

The same issue occurs in
<https://bugs.launchpad.net/ubuntu/+source/ditaa/+bug/1498832>.  It
appears to occur when there is a version-mismatch between jexec and
the jar.  For example, with ditaa 0.10+ds1-1.1

/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jexec /usr/bin/ditaa

works while

/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jexec /usr/bin/ditaa

fails with `invalid file (bad magic number): Exec format error`.

/usr/bin/jarwrapper /usr/bin/ditaa

also works.  Note that whether executing a jar file works is dependent
on the order that jarwrapper and the openjdk-*-jre-headless packages
were configured.  Whichever package was configured first is the one
used used by binfmt_misc.

Note that the conflicting jar registrations was also mentioned in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=136993#82

I contend that if jexec can not handle jars from different Java
versions, then it should not be registered with binfmt_misc.  If it
must be, for compatibility, then perhaps binfmt-support should have a
priority system like alternatives so that jarwrapper can be registered
with a higher priority?

Cheers,
Kevin



Information forwarded to debian-bugs-dist@lists.debian.org, OpenJDK Team <openjdk@lists.launchpad.net>:
Bug#855858; Package openjdk-8-jre. (Thu, 06 Apr 2017 14:09:02 GMT) (full text, mbox, link).


Acknowledgement sent to Hans-Christoph Steiner <hans@eds.org>:
Extra info received and forwarded to list. Copy sent to OpenJDK Team <openjdk@lists.launchpad.net>. (Thu, 06 Apr 2017 14:09:02 GMT) (full text, mbox, link).


Message #15 received at 855858@bugs.debian.org (full text, mbox, reply):

From: Hans-Christoph Steiner <hans@eds.org>
To: 855858@bugs.debian.org
Subject: also affects apksigner
Date: Thu, 6 Apr 2017 16:06:16 +0200
This also affects apksigner, which is compiled with java8 and run with
java8.



Information forwarded to debian-bugs-dist@lists.debian.org, OpenJDK Team <openjdk@lists.launchpad.net>:
Bug#855858; Package openjdk-8-jre. (Thu, 06 Apr 2017 14:15:03 GMT) (full text, mbox, link).


Acknowledgement sent to Hans-Christoph Steiner <hans@at.or.at>:
Extra info received and forwarded to list. Copy sent to OpenJDK Team <openjdk@lists.launchpad.net>. (Thu, 06 Apr 2017 14:15:03 GMT) (full text, mbox, link).


Message #20 received at 855858@bugs.debian.org (full text, mbox, reply):

From: Hans-Christoph Steiner <hans@at.or.at>
To: 855858@bugs.debian.org
Subject: Re: also affects apksigner
Date: Thu, 6 Apr 2017 16:12:50 +0200
actually, nevermind.  In my case, it was a Xen VM that did not have the
kernel modules installed so binfmt was not being loaded.



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Jan 10 18:08:51 2018; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.