Description
Describe the bug
The stack_size
of the process running xmerl_sax_parser:stream/2
keeps growing.
To Reproduce
Use xmerl_sax_parser:stream/2
on a large file and observe the stack growing by checking process_info(Pid, stack_size)
.
Expected behavior
I expect the stream parser to handle infinite stream without blowing up the stack.
Affected versions
Tested on 27.2 but seems all versions are affected.
Additional context
I used xmerl_sax_parser:stream/2
to parse the XML stream from an ejabberd server and noticed after a while the VM is killed by the OOM killer. After some inspection the process has a huge stack_size that keeps growing.
I also verified that removing the error handling in the first two clauses of xmerl_sax_parser_utf8:parse_content/4
and keeping just the cf/5 calls i.e. making it tail-recursive, the stack size is constant.
Activity