Bug 1381883

Summary: xmvn-install fails after the build
Product: Red Hat Enterprise Linux 7 Reporter: Piotr Kliczewski <pkliczew>
Component: xmvnAssignee: Mikolaj Izdebski <mizdebsk>
Status: CLOSED CURRENTRELEASE QA Contact: Jan Kepler <jkejda>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: bmcclain, brolley, ctubbsii, fche, isenfeld, jkejda, lberk, mbenitez, mgoodwin, mizdebsk, nathans, patrickm, snagar, toneata
Target Milestone: rcKeywords: EasyFix, Patch, Upstream, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: xmvn-1.3.0-6.el7 Doc Type: Bug Fix
Doc Text:
Previously, when XMvn Installer was unable to parse bytecode, for example, new bytecode not yet recognised by the ASM library, it terminated unexpectedly. As a consequence, XMvn Installer was unusable for building RPM packages with Java 8 instructions. With this update, XMvn Installer no longer fails upon encountering unparsable JVM bytecode, and it can be successfully used for building RPM packages with Java 8 instructions.
Story Points: ---
Clone Of:
: 1441149 (view as bug list) Environment:
Last Closed: 2017-08-28 13:29:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1380363, 1434647, 1441149    
Attachments:
Description Flags
Proposed patch
none
Proposed patch none

Description Piotr Kliczewski 2016-10-05 09:24:22 UTC
We are porting Red Hat Virtualization 4.1 communication library from java7 to java8. New patch [1] introduces java streams and changes java version. During build process [2] we see following exception:


07:49:19 java.lang.ArrayIndexOutOfBoundsException: 4648
07:49:19 	at org.objectweb.asm.ClassReader.readClass(Unknown Source)
07:49:19 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
07:49:19 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
07:49:19 	at org.fedoraproject.maven.installer.impl.DefaultInstaller.usesNativeCode(DefaultInstaller.java:545)
07:49:19 	at org.fedoraproject.maven.installer.impl.DefaultInstaller.installArtifact(DefaultInstaller.java:574)
07:49:19 	at org.fedoraproject.maven.installer.impl.DefaultInstaller.install(DefaultInstaller.java:758)
07:49:19 	at org.fedoraproject.maven.tools.installer.InstallerCli.run(InstallerCli.java:174)
07:49:19 	at org.fedoraproject.maven.tools.installer.InstallerCli.main(InstallerCli.java:187)
07:49:19 error: Bad exit status from /var/tmp/rpm-tmp.igcDaI (%install)

It works with java7 without any issues.

[1] https://gerrit.ovirt.org/#/c/64481/
[2] http://jenkins.ovirt.org/job/vdsm-jsonrpc-java_master_check-patch-el7-x86_64/48/console

Comment 2 Mikolaj Izdebski 2016-10-05 09:38:17 UTC
Created attachment 1207515 [details]
Proposed patch

Comment 4 Sandro Bonazzola 2016-10-05 10:32:08 UTC
Can we have it included in first zstream of 7.3 or in an async?

Comment 6 Mikolaj Izdebski 2016-10-06 16:24:48 UTC
Improved upstream fix: https://github.com/fedora-java/xmvn/commit/30fb81d18428a82b895822fac275aa480bcb1f58

Comment 7 Mikolaj Izdebski 2016-10-06 16:25:19 UTC
Created attachment 1207977 [details]
Proposed patch

Comment 8 Sandro Bonazzola 2016-10-07 06:47:33 UTC
(In reply to Mikolaj Izdebski from comment #7)
> Created attachment 1207977 [details]
> Proposed patch

Verified working:
- built xmvn-1.3.0-5.2.el7  in CentOS Virt SIG candidate repo applying this patch
- tested it with jenkins where it previously failed: http://jenkins.ovirt.org/job/vdsm-jsonrpc-java_master_check-patch-el7-x86_64/53/

Comment 9 Christopher Tubbs 2017-02-14 08:38:01 UTC
This issue also affects a bunch of core jboss libraries, which are at the root of a very wide tree of Java libraries and applications. So, this issue seems to significantly affect the larger EL7 ecosystem, preventing a bunch of Java 8 stuffs from being packaged in EPEL7, as well as end-user packages targeting EL7 systems using xmvn as their build tool.

Comment 10 Christopher Tubbs 2017-02-25 02:27:27 UTC
Apparently, this objectweb-asm issue also affects building maven plugins with xmvn in EL7. The maven-plugin-tools-annotations jar seems to use objectweb-asm while executing the descriptor task, and that can fail, even if the plugin itself targets older byte code (I tried to build maven-injector-plugin and saw this).

Even if this gets fixed, by catching and ignoring exceptions during %mvn_install macro execution, the underlying ArrayIndexOutOfBounds problem seems likely to continue to block at least some maven plugins from being packaged for EPEL7 with xmvn.