Skip to content

Instantly share code, notes, and snippets.

@shino
Last active December 18, 2015 03:49
Show Gist options
  • Save shino/5721163 to your computer and use it in GitHub Desktop.
Save shino/5721163 to your computer and use it in GitHub Desktop.
[erlang-bugs] xmerl_scan leaks ets table http://erlang.org/pipermail/erlang-bugs/2013-June/003621.html
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:8:8] [async-threads:0] [kernel-poll:false] [systemtap]
Eshell V5.9.3.1 (abort with ^G)
1> ets:all().
[8207,4110,13,file_io_servers,inet_hosts_file_byaddr,
inet_hosts_file_byname,inet_hosts_byaddr,inet_hosts_byname,
inet_cache,inet_db,global_pid_ids,global_pid_names,
global_names_ext,global_names,global_locks,ac_tab]
2> length(ets:all()).
16
3> catch xmerl_scan:string("").
3899- fatal: expected_element_start_tag
{'EXIT',{fatal,{expected_element_start_tag,{file,file_name_unknown},
{line,1},
{col,1}}}}
4> length(ets:all()).
17
5> catch xmerl_scan:string("").
3899- fatal: expected_element_start_tag
{'EXIT',{fatal,{expected_element_start_tag,{file,file_name_unknown},
{line,1},
{col,1}}}}
6> length(ets:all()).
18
7> lists:foreach(fun(_) -> catch xmerl_scan:string("") end, lists:seq(1, 100)).
3899- fatal: expected_element_start_tag
[snip]
3899- fatal: expected_element_start_tag
ok
8> length(ets:all()).
118
9> error(dummy).
** exception error: dummy
10> length(ets:all()).
16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment