http://bugzilla.qos.ch/show_bug.cgi?id=129

           Summary: An <include> in an included file leads to out of memory
           Product: logback-core
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: Joran
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Situation: 3 configuration files A.xml, B.xml and C.xml
A includes B and B includes C

This leads Joran to run into out of memory.

The reason is in class ch.qos.logback.core.joran.action.IncludeAction
The begin() method fills the instance variable recoder with events and adds
them to the global list. But since there is only one instance of IncludeAction
it adds the already added events from the first include a second time at the
second include event. This leads to an almost endless loop.
A not that severe effect is that if a single file contains multiple includes it
executes the first include as often as the total number of includes is.

To solve this for me clearing the event list at the end of the begin method
worked well:

  public void begin(InterpretationContext ec, String name, Attributes
attributes)
      throws ActionException {

        ...

    ec.getJoranInterpreter().addEvents(recorder.saxEventList);

    // This is my fix
    recorder.saxEventList.clear();
  }


-- 
Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
logback-dev mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-dev

Reply via email to