Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-1950

Starting EBA raise StackOverflowError when a third party bundle MANIFEST.MF contains very long uses directive.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • subsystem-2.0.10
    • None
    • Subsystem
    • 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.

      Attachments

        1. es-manifest.mf
          171 kB
          Nikolas Falco
        2. hazelcast.mf
          130 kB
          Nikolas Falco

        Activity

          People

            Unassigned Unassigned
            nfalco79 Nikolas Falco
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: