<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi there -<br>
When parsing a string, xmerl_scan creates an ets table which it
doesn't delete again in the case of exceptions.<br>
<br>
Demo:<br>
<blockquote>Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:8:8]
[async-threads:10] [hipe] [kernel-poll:false]<br>
<br>
Eshell V5.10.1 (abort with ^G)<br>
1> length(ets:all()). <br>
16<br>
2> <br>
2> catch xmerl_scan:string("").<br>
3900- fatal: expected_element_start_tag<br>
{'EXIT',<br>
{fatal,<br>
{expected_element_start_tag,<br>
{file,file_name_unknown},<br>
{line,1},<br>
{col,1}}}}<br>
3> length(ets:all()). <br>
17<br>
</blockquote>
(I just re-discovered this bug; I apologize for having neglected to
report it earlier, considering that I've noticed it before some
years ago.)<br>
<br>
From a brief inspection at the code, I think the place to ensure
table deletion would be to add a "try...after" in scan_document.
Alternatively, it could be done in int_string/4 and
int_string_decl/4, where the cleanup can mirror the calls to
initial_state0()->initial_state() where the ets table is created.<br>
<br>
Regards,<br>
Erik Søe Sørensen<br>
<br>
<div class="moz-signature">-- <br>
<div style="color: black; text-align: center;"> <span>Mobile: +
45 26 36 17 55</span> <span> </span> <span style="color:
black; ">| Skype: eriksoesorensen</span> <span> </span> <span
style="color: black; ">| Twitter: @eriksoe</span>
</div>
<div style="text-align: center; color: gray;"> <span>Trifork A/S
| Margrethepladsen 4 | DK-8000 Aarhus C | </span> <a
href="http://www.trifork.com/"><span style="text-decoration:
underline; color: gray;">www.trifork.com</span></a>
</div>
</div>
</body>
</html>