Bug#923284: Seemingly miscompiles with jdk-11

2019-02-26 Thread Sjoerd Simons
On Tue, 2019-02-26 at 12:40 +0100, Emmanuel Bourg wrote:
> Le 26/02/2019 à 12:22, Sjoerd Simons a écrit :
> 
> > ASM7 mode seems to have been introduced in the gradle v5.x series.
> > Not
> > sure if it makes sense for buster to upgrade to that (I really
> > don't
> > know much about java, so no idea about the impact)?
> 
> We can't upgrade to Gradle 5 unfortunately, not until Kotlin is
> packaged
> (#892842). This will be a key issue in the next development cycle.
> 
> 
> > That said making all gradle dependencies target pre-Java
> > 11  probably
> > doens't scale either?
> 
> If it's just the Gradle dependencies it's doable, and the severity of
> the bug can be downgraded because the issue only appears if the
> dependencies are rebuilt. If the issue also appears when project
> dependencies use Java 11 this is a more important issue.

Right it seems to be the following list:
bsh
libjaxp1.3-java
xml-commons-external

So not as bad as i worried; But i'm not sure more stuff may come out of
the woodwork when building things that uses gradle.

-- 
Sjoerd Simons 



Bug#923284: Seemingly miscompiles with jdk-11

2019-02-26 Thread Emmanuel Bourg
Le 26/02/2019 à 12:22, Sjoerd Simons a écrit :

> ASM7 mode seems to have been introduced in the gradle v5.x series. Not
> sure if it makes sense for buster to upgrade to that (I really don't
> know much about java, so no idea about the impact)?

We can't upgrade to Gradle 5 unfortunately, not until Kotlin is packaged
(#892842). This will be a key issue in the next development cycle.


> That said making all gradle dependencies target pre-Java 11  probably
> doens't scale either?

If it's just the Gradle dependencies it's doable, and the severity of
the bug can be downgraded because the issue only appears if the
dependencies are rebuilt. If the issue also appears when project
dependencies use Java 11 this is a more important issue.

Emmanuel Bourg



Bug#923284: Seemingly miscompiles with jdk-11

2019-02-26 Thread Sjoerd Simons
On Tue, 2019-02-26 at 11:35 +0100, Emmanuel Bourg wrote:
> Le 26/02/2019 à 10:20, Sjoerd Simons a écrit :
> 
> > I've atteched the output of running docker build on the DockerFile
> > i
> > attached to reproduce the issue; The relevant part in the gradle
> > build
> > seems to be:
> 
> Thank you! The "Malformed jar" message is just a warning. The actual
> issue is:
> 
> > Caused by: java.lang.UnsupportedOperationException: This feature
> > requires ASM7
> > at
> > org.objectweb.asm.ClassVisitor.visitNestHost(ClassVisitor.java:150)
> > at org.objectweb.asm.ClassReader.accept(ClassReader.java:541)
> > at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)
> > at
> > org.gradle.api.internal.tasks.compile.incremental.asm.ClassDependen
> > ciesVisitor.analyze(ClassDependenciesVisitor.java:75)
> 
> Most likely triggered because the recompiled bsh uses Java 11
> bytecode.
> This can be fixed either by targeting a pre Java 11 release in the
> bsh
> build, or by patching Gradle to use Opcodes.ASM7.

ASM7 mode seems to have been introduced in the gradle v5.x series. Not
sure if it makes sense for buster to upgrade to that (I really don't
know much about java, so no idea about the impact)? 

That said making all gradle dependencies target pre-Java 11  probably
doens't scale either?

-- 
Sjoerd Simons 



Bug#923284: Seemingly miscompiles with jdk-11

2019-02-26 Thread Emmanuel Bourg
Le 26/02/2019 à 10:20, Sjoerd Simons a écrit :

> I've atteched the output of running docker build on the DockerFile i
> attached to reproduce the issue; The relevant part in the gradle build
> seems to be:

Thank you! The "Malformed jar" message is just a warning. The actual
issue is:

> Caused by: java.lang.UnsupportedOperationException: This feature requires ASM7
>   at org.objectweb.asm.ClassVisitor.visitNestHost(ClassVisitor.java:150)
>   at org.objectweb.asm.ClassReader.accept(ClassReader.java:541)
>   at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)
>   at 
> org.gradle.api.internal.tasks.compile.incremental.asm.ClassDependenciesVisitor.analyze(ClassDependenciesVisitor.java:75)

Most likely triggered because the recompiled bsh uses Java 11 bytecode.
This can be fixed either by targeting a pre Java 11 release in the bsh
build, or by patching Gradle to use Opcodes.ASM7.

Emmanuel Bourg



Bug#923284: Seemingly miscompiles with jdk-11

2019-02-26 Thread Sjoerd Simons
On Mon, 2019-02-25 at 23:59 +0100, Emmanuel Bourg wrote:
> Thank you for the report Sjoerd. What error did you get when
> compiling
> gradle with the rebuilt bsh?
> 
> Emmanuel Bourg

Btw; I tested with forcing bsh to build with openjdk-8 instead and then
the issue doesn't occur while building gradle; Hence assuming it's a
bsh issue not a gradle one.



Bug#923284: Seemingly miscompiles with jdk-11

2019-02-25 Thread Emmanuel Bourg
Thank you for the report Sjoerd. What error did you get when compiling
gradle with the rebuilt bsh?

Emmanuel Bourg



Bug#923284: Seemingly miscompiles with jdk-11

2019-02-25 Thread Sjoerd Simons
Source: bsh
Version: 2.0b4-19
Severity: serious

When building bsh with openjdk-11 it seems that afterwards building packages
using it fails e.g. after rebuilding bsh gradle fails to build.

Attached is a dockerfile which nicely shows the issue

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'proposed-updates'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental-debug'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: armhf

Kernel: Linux 4.19.0-2-amd64 (SMP w/32 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
FROM debian:buster

RUN apt-get update && \
apt-get install -y --no-install-recommends vim-tiny

RUN cat /etc/apt/sources.list | sed 's,^deb,deb-src,g' > 
/etc/apt/sources.list.d/s.list

RUN apt-get update && \
apt-get install -y build-essential devscripts

RUN apt-get update && \
apt-get build-dep -y bsh gradle

# builds fine
RUN apt-get source gradle  && \
cd gradle* && \
debuild -uc -us

# Rebuild bsh
RUN apt-get source bsh  && \
cd bsh* && \
debuild -uc -us && \
cd .. && \
dpkg -i libbsh-java*.deb

# fail :/
RUN apt-get source gradle  && \
cd gradle* && \
debuild -uc -us