-
Bug
-
Resolution: Unresolved
-
Minor
-
java.class.version 52.0
java.endorsed.dirs /usr/lib/jvm/java-8-oracle/jre/lib/endorsed
java.ext.dirs /usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/java/packages/lib/ext
java.home /usr/lib/jvm/java-8-oracle/jre
java.io.tmpdir /tmp
java.library.path /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.runtime.name Java(TM) SE Runtime Environment
java.runtime.version 1.8.0_161-b12
java.specification.name Java Platform API Specification
java.specification.vendor Oracle Corporation
java.specification.version 1.8
java.vendor Oracle Corporation
java.vendor.url http://java.oracle.com/
java.vendor.url.bug http://bugreport.sun.com/bugreport/
java.version 1.8.0_161
java.vm.info mixed mode
java.vm.name Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Oracle Corporation
java.vm.specification.version 1.8
java.vm.vendor Oracle Corporation
java.vm.version 25.161-b12
println GroovySystem.version
2.4.11
os.arch amd64
os.name Linux
os.version 4.4.0-134-generic
Ubuntu 16.04.5 LTS
Jenkins 2.121.3java.class.version 52.0 java.endorsed.dirs /usr/lib/jvm/java-8-oracle/jre/lib/endorsed java.ext.dirs /usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/java/packages/lib/ext java.home /usr/lib/jvm/java-8-oracle/jre java.io.tmpdir /tmp java.library.path /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib java.runtime.name Java(TM) SE Runtime Environment java.runtime.version 1.8.0_161-b12 java.specification.name Java Platform API Specification java.specification.vendor Oracle Corporation java.specification.version 1.8 java.vendor Oracle Corporation java.vendor.url http://java.oracle.com/ java.vendor.url.bug http://bugreport.sun.com/bugreport/ java.version 1.8.0_161 java.vm.info mixed mode java.vm.name Java HotSpot(TM) 64-Bit Server VM java.vm.specification.name Java Virtual Machine Specification java.vm.specification.vendor Oracle Corporation java.vm.specification.version 1.8 java.vm.vendor Oracle Corporation java.vm.version 25.161-b12 println GroovySystem.version 2.4.11 os.arch amd64 os.name Linux os.version 4.4.0-134-generic Ubuntu 16.04.5 LTS Jenkins 2.121.3
The overrided methods of pipeline libraries start to loop on themselves after three iterations.
Looks very similar to this groovy bug:
https://issues.apache.org/jira/browse/GROOVY-6818
Reproducing:
pipeline library:
======== ./Order_0.groovy package [PACKAGE] import org.jenkinsci.plugins.workflow.cps.CpsFlowExecution import org.jenkinsci.plugins.workflow.cps.CpsThread class Order_0 implements Serializable { static protected def script def echo(Object data) { CpsThread thread = CpsThread.current() CpsFlowExecution execution = thread.execution execution?.getOwner()?.getListener()?.getLogger()?.println(data) } String doThingAsc () { echo '-0- (base)' } } ======== ./Order_1.groovy package [PACKAGE] class Order_1 extends Order_0 implements Serializable { @Override String doThingAsc () { echo '-1-' super.doThingAsc() } String doThingDsc () { echo '-1- (base)' } } ======== ./Order_2.groovy package [PACKAGE] class Order_2 extends Order_1 implements Serializable { @Override String doThingAsc () { echo '-2-' super.doThingAsc() } @Override String doThingDsc () { echo '-2-' super.doThingDsc() } } ======== ./Order_3.groovy package [PACKAGE] class Order_3 extends Order_2 implements Serializable { @Override String doThingDsc () { echo '-3-' super.doThingDsc() } }
pipeline file:
@Library("[Library]") _; import [PACKAGE].* def test0 = new Order_0(script: this); def test1 = new Order_1(script: this); def test2 = new Order_2(script: this); def test3 = new Order_3(script: this); ///////////////////////////////////////// try { test0.doThingAsc() test0.echo '-'*30 test1.doThingAsc() test1.echo '-'*30 test2.doThingAsc() test2.echo '-'*30 test3.doThingAsc() } catch (java.lang.StackOverflowError ex) { echo 'We have an error ASC' } ///////////////////////////////////////// try { test1.doThingDsc() test0.echo '-'*30 test2.doThingDsc() test0.echo '-'*30 test3.doThingDsc() } catch (java.lang.StackOverflowError ex) { echo 'We have an error DSC' } /////////////////////////////////////////
We expect output:
-0- (base) ------------------------------ -1- -0- (base) ------------------------------ -2- -1- -0- (base) ------------------------------ -2- -1- -0- (base) -1- (base) ------------------------------ -2- -1- (base) ------------------------------ -3- -2- -1- (base)
We get output:
-0- (base) ------------------------------ -1- -0- (base) ------------------------------ -2- -1- -1- -1- -1- <... way too much ...> -1- -1- We have an error ASC -1- (base) ------------------------------ -2- -1- (base) ------------------------------ -3- -2- -2- -2- -2- -2- -2- -2- -2- -2- <... way too much ...> -2- -2- We have an error DSC