Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: erlang/otp
base: master
...
head fork: id/otp
compare: fix-proc_lib-crash-report
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 11, 2014
@id id Limit max message queue length in crash report
If a process having huge message queue crashes, proc_lib:format_report
might bring the whole system down while trying to format crash report
content. Here I limit max number of messages in crash report with a
fairly choosen round number.
f9f9320
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/stdlib/src/proc_lib.erl
View
10 lib/stdlib/src/proc_lib.erl
@@ -507,7 +507,7 @@ my_info_1(Class, Reason) ->
get_process_info(self(), registered_name),
{error_info, {Class,Reason,erlang:get_stacktrace()}},
get_ancestors(self()),
- get_process_info(self(), messages),
+ get_process_messages(self()),
get_process_info(self(), links),
get_cleaned_dictionary(self()),
get_process_info(self(), trap_exit),
@@ -527,6 +527,12 @@ get_ancestors(Pid) ->
{ancestors,[]}
end.
+-spec get_process_messages(pid()) -> {messages, list()}.
+
+get_process_messages(Pid) ->
+ {messages, L} = get_process_info(Pid, messages),
+ {messages, lists:sublist(L, 8)}.
+
get_cleaned_dictionary(Pid) ->
case get_process_info(Pid,dictionary) of
{dictionary,Dict} -> {dictionary,clean_dict(Dict)};
@@ -576,7 +582,7 @@ make_neighbour_report(Pid) ->
get_initial_call(Pid),
get_process_info(Pid, current_function),
get_ancestors(Pid),
- get_process_info(Pid, messages),
+ get_process_messages(Pid),
get_process_info(Pid, links),
get_cleaned_dictionary(Pid),
get_process_info(Pid, trap_exit),

No commit comments for this range

Something went wrong with that request. Please try again.