[cxml-devel] [PATCH] A memory leak in klacks parser

Kalyanov Dmitry kalyanov.dmitry at gmail.com
Wed Nov 16 20:44:11 UTC 2011


I've been trying to parse a relatively large XML file with Klacks and
found what seems to be a memory leak inside Klacks parser.

1) When klacks sees the start of an element, an URI is pushed to the
'base-stack' field of 'context' structure ('klacks/element' calls
'p/sztag' which pushes the URI) but never actually removes it off the
stack.

2) Similarly, klacks pushes the namespace to the 'namespace-stack' field
of 'cxml-source' structure but never actually removes it off the stack
('klacks/element-2' pushes the namespace).

Attached is a proposed patch that seems to fix these issues.

With the patch, memory usage stays (almost) constant during parsing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-memory-leak-in-klacks.patch
Type: text/x-patch
Size: 1361 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cxml-devel/attachments/20111117/b01d415d/attachment.bin>


More information about the cxml-devel mailing list