Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
subsystem-2.0.10
-
None
-
None
-
oracle jdk 1.8.0 build 181
oracle jdk 11
Description
I had create and EBA file with 157 dependencies. The Application-Content declares only web bundles, actually just one.
The EBA contains two dependencies that cause a StackOverflowError parsing MANIFEST.MF of the shared bundle repository. The actual parser is done by very complex regular expression. The clause that cause the issue is a very long "uses" directive.
I had attach the two MANIFEST.MF that cause the issue and a main Java class to reproduce the issue.
package debug; import java.util.Map; import java.util.jar.Manifest; import org.apache.aries.subsystem.core.archive.HeaderFactory; public class Main { public static void main(String[] args) throws Exception { Manifest mf = new Manifest(Main.class.getResourceAsStream("es-manifest.mf")); for (Map.Entry<Object, Object> entry : mf.getMainAttributes().entrySet()) { HeaderFactory.createHeader(String.valueOf(entry.getKey()), String.valueOf(entry.getValue())); } } }
I got the issue debugging the EBA in a IBM Webshere Liberty 19.0.0.1 application server. I would suggest to change this regexp parser with a string tokenizer, also due performace. Equinox/felix MANIFEST.MF parser are not affected to this issue.