Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-7522

Duplicate feature name and version cause stack overflow errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.2.7
    • 4.3.8, 4.2.17, 4.4.2
    • karaf
    • None

    Description

      Karaf feature resolver computation is prone to an error when same feature is defined in two descriptors. While it can be an user error, quite often this error is spot when feature generation is being used.

      First occurrence of this error is seen in KARAF-6536 which links it with Windows and version ranges. I was able to reproduce issue with much simpler setup, validation with two feature files where one is "plain" and other is "aggregated".

      Exception in thread "main" java.lang.StackOverflowError
          at java.base/java.util.AbstractCollection.<init>(AbstractCollection.java:66)
          at java.base/java.util.AbstractList.<init>(AbstractList.java:78)
          at java.base/java.util.Collections$SingletonList.<init>(Collections.java:4837)
          at java.base/java.util.Collections.singletonList(Collections.java:4823)
          at org.apache.felix.utils.resource.SimpleFilter.parseSubstring(SimpleFilter.java:367)
          at org.apache.felix.utils.resource.SimpleFilter.convert(SimpleFilter.java:564)
          at org.apache.felix.utils.resource.RequirementImpl.getFilter(RequirementImpl.java:133)
          at org.apache.felix.utils.resource.RequirementImpl.<init>(RequirementImpl.java:77)
          at org.apache.felix.utils.resource.RequirementImpl.<init>(RequirementImpl.java:44)
          at org.apache.karaf.features.internal.resolver.ResourceUtils.addIdentityRequirement(ResourceUtils.java:127)
          at org.apache.karaf.features.internal.resolver.ResourceUtils.addIdentityRequirement(ResourceUtils.java:107)
          at org.apache.karaf.features.internal.resolver.ResourceUtils.addIdentityRequirement(ResourceUtils.java:99)
          at org.apache.karaf.features.internal.region.Subsystem.requireFeature(Subsystem.java:284)
          at org.apache.karaf.features.internal.region.Subsystem.doBuild(Subsystem.java:350)
          at org.apache.karaf.features.internal.region.Subsystem.build(Subsystem.java:332)
          at org.apache.karaf.features.internal.region.Subsystem.doBuild(Subsystem.java:390)
          at org.apache.karaf.features.internal.region.Subsystem.build(Subsystem.java:332)
          at org.apache.karaf.features.internal.region.Subsystem.doBuild(Subsystem.java:390)
       

      Attachments

        Activity

          People

            ldywicki Łukasz Dywicki
            ldywicki Łukasz Dywicki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: