aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolas Falco (Jira)" <j...@apache.org>
Subject [jira] [Updated] (ARIES-1950) Starting EBA raise StackOverflowError when a third party bundle MANIFEST.MF contains very long uses directive.
Date Fri, 29 Nov 2019 17:07:00 GMT

     [ https://issues.apache.org/jira/browse/ARIES-1950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nikolas Falco updated ARIES-1950:
---------------------------------
    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.
{code:java}
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()));
        }
    }
}
{code}

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.

  was:
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 the very long "uses" directive.
I had attach the two MANIFEST.MF that cause the issue and a main Java class to reproduce the
issue.

I got the issue debugging the EBA in a IBM Webshere Liberty 19.0.0.1 application server.

{code:java}
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()));
        }
    }
}
{code}



> Starting EBA raise StackOverflowError when a third party bundle MANIFEST.MF contains
very long uses directive.
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-1950
>                 URL: https://issues.apache.org/jira/browse/ARIES-1950
>             Project: Aries
>          Issue Type: Bug
>          Components: Subsystem
>    Affects Versions: subsystem-2.0.10
>         Environment: oracle jdk 1.8.0 build 181
> oracle jdk 11
>            Reporter: Nikolas Falco
>            Priority: Critical
>         Attachments: es-manifest.mf, hazelcast.mf
>
>
> 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.
> {code:java}
> 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()));
>         }
>     }
> }
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message