[Bug 129] New: An <include> in an included file leads to out of memory

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: logback-dev@qos.ch ReportedBy: mfranz@intershop.de 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.

http://bugzilla.qos.ch/show_bug.cgi?id=129 noreply.ceki@qos.ch changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from noreply.ceki@qos.ch 2008-03-04 17:41 ------- Hi Michael, Thanks for this bug report and a suggested fix which was quite helpful. The fix, as well as associated test cases, have been checked in revision 1628. -- 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.

http://bugzilla.qos.ch/show_bug.cgi?id=129 ------- Comment #2 from msiegenthaler@gmx.net 2008-03-20 19:27 ------- This also fixes a problem with multiple includes: ERROR in ch.qos.logback.core.joran.spi.Interpreter@2b7fc2 - no applicable action for [included], current pattern is [[configuration][included]], ERROR in ch.qos.logback.core.joran.spi.Interpreter@2b7fc2 - no applicable action for [appender], current pattern is [[configuration][included][appender]], in a configuration like <?xml version="1.0" encoding="UTF-8" ?> <configuration> <include resource="logconfig/database.xml"/> <include resource="logconfig/file-debug.xml"/> <include resource="logconfig/file-error.xml" /> <logger name="myapp" > <level value="debug" /> </logger> </configuration> (I just added this to help people that run into the above error with 0.98) -- 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.
participants (1)
-
bugzilla-daemon@pixie.qos.ch