[
https://issues.apache.org/jira/browse/KARAF-7522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17570068#comment-17570068
]
ASF GitHub Bot commented on KARAF-7522:
---------------------------------------
splatch opened a new pull request, #1604:
URL: https://github.com/apache/karaf/pull/1604
Hey folks,
I nailed reason why we get stack overflows while making validation and it
seems to be caused by subsystem eating its own tail. I made a fix which is
proven to work, but now I need a bit of your feedback if proposed way is fine.
Few points - `Feature` equality uses name and version, ignoring actual
feature contents, so we can rely on sets instead of lists making my fix
redundant. Yet, it would require quite big update of code and could lead to
some unexpected behavior changes.
> Duplicate feature name and version cause stack overflow errors
> --------------------------------------------------------------
>
> Key: KARAF-7522
> URL: https://issues.apache.org/jira/browse/KARAF-7522
> Project: Karaf
> Issue Type: Bug
> Affects Versions: 4.2.7
> Reporter: Łukasz Dywicki
> Assignee: Łukasz Dywicki
> Priority: Major
>
> 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".
> {code:java}
> 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)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)