Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Handler error_logger_lager_h crashes sometimes #83

Closed
keynslug opened this Issue · 3 comments

3 participants

@keynslug

Sometimes I could observe something like that in error.log:

2012-10-17 13:40:29.228 [error] <0.57.0> Lager event handler error_logger_lager_h exited with reason {'EXIT',{function_clause,[{lager,log,[error,emulator,["Error in process <0.1678.0> on node 'n1@localhost' with exit value: {function_clause,[{cowboy_protocol,parse_method,[<<0 bytes>>,{state,<0.87.0>,#Port<0.19453>,ranch_tcp,[{'_',[{['...'],http_handlers,{}}]}],undefined,undefined,5,1,infinity,4096,64,4096,100,5000,false,infinity,undefined},<<5 bytes>>],[{file,\"src/cowboy_protocol.erl\"},{line... \n","\n"]],[{file,"src/lager.erl"},{line,86}]},{error_logger_lager_h,handle_event,2,...},...]}}

Seems that it is caused by second argument to lager:log. It is emulator but lager:log handles only pids and lists, but not atoms.

Lager is at

ed7e2aa Test and fix for a printable yet improper list

Erlang is

Erlang R15B02 (erts-5.9.2) [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:true]

but HiPE feature is not used anywhere.

@keynslug

Ok, I've managed to reproduce it.

# git log --oneline -1         

ed7e2aa Test and fix for a printable yet improper list

# erl +P 256 -pa ebin -s lager

Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.2  (abort with ^G)
1> 21:49:06.429 [info] Application lager started on node nonode@nohost

1>  N = length(erlang:processes()).
35
2> [spawn(fun () -> receive ok -> ok end end) || _ <- lists:seq(1, 255 - N)].
[<0.50.0>,<0.51.0>,<0.52.0>,<0.53.0>,<0.54.0>,<0.55.0>,
 <0.56.0>,<0.57.0>,<0.58.0>,<0.59.0>,<0.60.0>,<0.61.0>,
 <0.62.0>,<0.63.0>,<0.64.0>,<0.65.0>,<0.66.0>,<0.67.0>,
 <0.68.0>,<0.69.0>,<0.70.0>,<0.71.0>,<0.72.0>,<0.73.0>,
 <0.74.0>,<0.75.0>,<0.76.0>,<0.77.0>,<0.78.0>|...]
3> spawn(fun () -> timer:sleep(1) end).
<0.817.0>
*** ERROR: Shell process terminated! ***
21:49:45.518 [error] Lager event handler error_logger_lager_h exited with reason {'EXIT',{function_clause,[{lager,log,[error,emulator,["Too many processes\n","\n"]],[{file,"src/lager.erl"},{line,86}]},{error_logger_lager_h,handle_event,2,[{file,"src/error_logger_lager_h.erl"},{line,91}]},{gen_event,server_update,4,[{file,"gen_event.erl"},{line,504}]},{gen_event,server_notify,4,[{file,"gen_event.erl"},{line,486}]},{gen_event,handle_msg,5,[{file,"gen_event.erl"},{line,248}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}}
Eshell V5.9.2  (abort with ^G)
1> 

If that does not work you could try to increase sleep timeout inside the last spawned process.

@maxlapshin

I experience the same:

16:11:19.897 [error] Lager event handler error_logger_lager_h exited with reason {'EXIT',{function_clause,[{lager,log,[error,emulator,["Bad value on output port 'tcp_inet'\n","\n"]],[{file,"src/lager.erl"},{line,86}]},{error_logger_lager_h,handle_event,2,[{file,"src/error_logger_lager_h.erl"},{line,91}]},{gen_event,server_update,4,[{file,"gen_event.erl"},{line,504}]},{gen_event,server_notify,4,[{file,"gen_event.erl"},{line,486}]},{gen_event,handle_msg,5,[{file,"gen_event.erl"},{line,248}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}}
@Vagabond
Collaborator

Pushed a fix.

@Vagabond Vagabond closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.