<div dir="ltr">Hi Khitai,<div><br></div><div>That's because jiffy (mis)uses erlang:throw.</div><div><br></div><div>Best,</div><div>Ali</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 15, 2017 at 5:13 AM, Khitai Pang <span dir="ltr"><<a href="mailto:khitai.pang@outlook.com" target="_blank">khitai.pang@outlook.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Raimo, Attila,<br>
<br>
I have found out the cause: the handle_info callback of my gen_server<br>
failed to decode a json string:<br>
<br>
{Json} = jiffy:decode(Msg),<br>
<br>
the above code generates {error, {91, invalid_string}}, and I believe<br>
the error is caught by OTP gen_server code, and somehow the terminate()<br>
function in OTP gen_server code complains about {bad_return_value,<br>
{error, {91, invalid_string}}}. Now I know the root cause of the<br>
problem but I don't understand why it ends up in an error of<br>
gen_server:terminate().<br>
<br>
<br>
Best wishes,<br>
Khitai<br>
<div class="HOEnZb"><div class="h5"><br>
On 2017/8/14 19:54, Attila Rajmund Nohl wrote:<br>
> Hello!<br>
><br>
> I'd check the code that handles the<br>
> {basic.cancel_ok,<<"amq.ctag-<wbr>YRIyK1Kv0i93rkLbD9Zo8w">>} message,<br>
> because this was the last received message. Also my intuition is that<br>
> somewhere your code expects a list of strings, but gets a simple<br>
> string, and when it checks the first element, it finds 91 (probably<br>
> the '[' character) instead of a string.<br>
><br>
> 2017-08-14 5:17 GMT+02:00 Khitai Pang <<a href="mailto:khitai.pang@outlook.com">khitai.pang@outlook.com</a>>:<br>
>> Hi list,<br>
>><br>
>> On my CentOS7 server with esl-erlang-19.3.6-1.x86_64, a gen_server<br>
>> process mysteriously crashes. See the error info below. I can't figure<br>
>> out the reason of the error. Any hint would be appreciated.<br>
>><br>
>> {error_report,<0.25443.97>,<br>
>> {<0.28918.97>,crash_report,<br>
>> [[{initial_call,{xeef_<wbr>analyzer,init,[Argument__1]}},<br>
>> {pid,<0.28918.97>},<br>
>> {registered_name,xeef_<wbr>analyzer_009},<br>
>> {error_info,<br>
>> {exit,<br>
>> {bad_return_value,{error,{91,<wbr>invalid_string}}},<br>
>> [{gen_server,terminate,7,[{<wbr>file,"gen_server.erl"},{line,<wbr>812}]},<br>
>> {proc_lib,init_p_do_apply,3,<br>
>> [{file,"proc_lib.erl"},{line,<wbr>247}]}]}},<br>
>> {ancestors,[xeef_analyzer_sup,<wbr>xeef_sup,<0.25310.97>]},<br>
>> {messages,[{basic.cancel_ok,<<<wbr>"amq.ctag-<wbr>YRIyK1Kv0i93rkLbD9Zo8w">>}]},<br>
>> {links,<br>
>> [#Port<0.2317500>,#Port<0.<wbr>2317503>,<0.29009.97>,#Port<0.<wbr>2317499>]},<br>
>> {dictionary,<br>
>> [{rand_seed,<br>
>> {#{max => 18446744073709551615,next =><br>
>> #Fun<rand.4.41921595>,<br>
>> type => exs1024,uniform => #Fun<rand.5.41921595>,<br>
>> uniform_n => #Fun<rand.6.41921595>},<br>
>> {[5529181756040335035,<wbr>6774320120208346895,<br>
>> 4985297473998268992,<wbr>12813505499546735856,<br>
>> 3059599059795068553,<wbr>3134963973831305956,<br>
>> 5508046504858988103,<wbr>3821329447243874404],<br>
>> [6547380368325771448,<wbr>16036002885223559991,<br>
>> 13982350927889545678,<wbr>14401258729428095242,<br>
>> 6347438184782916914,<wbr>10561027033563628251,<br>
>> 10847483533189471003,<wbr>3486622809589930158]}}}]},<br>
>> {trap_exit,true},<br>
>> {status,running},<br>
>> {heap_size,987},<br>
>> {stack_size,27},<br>
>> {reductions,139726}],<br>
>> []]}}<br>
>><br>
>><br>
>> {error_report,<0.25443.97>,<br>
>> {<0.29009.97>,supervisor_<wbr>report,<br>
>> [{supervisor,{local,xeef_<wbr>analyzer_sup}},<br>
>> {errorContext,child_<wbr>terminated},<br>
>> {reason,{bad_return_value,{<wbr>error,{91,invalid_string}}}},<br>
>> {offender,<br>
>> [{pid,<0.28918.97>},<br>
>> {id,xeef_analyzer},<br>
>> {mfargs,<br>
>> {xeef_analyzer,start_link,<br>
>> [{sandbox,{<0.28962.97>,<<"<wbr>sanbox_queue">>},none,true}]}}<wbr>,<br>
>> {restart_type,permanent},<br>
>> {shutdown,5000},<br>
>> {child_type,worker}]}]}}<br>
>><br>
>><br>
>><br>
>> Best wishes,<br>
>> Khitai<br>
>> ______________________________<wbr>_________________<br>
>> erlang-questions mailing list<br>
>> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>