trifork / erjang

A JVM-based Erlang VM
http://www.erjang.org
Apache License 2.0
725 stars 62 forks source link

Error when quitting LFE shell #85

Open oubiwann opened 10 years ago

oubiwann commented 10 years ago

When quitting the LFE shell on Erjang, I get the following:

> ^Dexception exit: #(error #(1 lfe_parse #(missing token)))
  in (lfe_io scan_and_parse 3)

> {error_logger,{{2014,4,6},{17,36,51}},supervisor_report,[{supervisor,{<0.0.683>,user_sup}},{errorContext,child_terminated},{reason,{badarg,[{queue,is_empty,[[]],[{file,"queue.erl"},{line,-1}]},{user,get_chars,7,[{file,"user.erl"},{line,600}]},{user,do_io_request,5,[{file,"user.erl"},{line,182}]},{user,server_loop,2,[{file,"user.erl"},{line,132}]}]}},{offender,[{pid,<0.0.688>},{mod,user_sup}]}]}
{error_logger,{{2014,4,6},{17,36,51}},"** Generic server ~p terminating \n** Last message in was ~p~n** When Server state == ~p~n** Reason for termination == ~n** ~p~n",[<0.0.683>,{'EXIT',<0.0.688>,{badarg,[{queue,is_empty,[[]],[{file,"queue.erl"},{line,-1}]},{user,get_chars,7,[{file,"user.erl"},{line,600}]},{user,do_io_request,5,[{file,"user.erl"},{line,182}]},{user,server_loop,2,[{file,"user.erl"},{line,132}]}]}},{state,user_sup,undefined,<0.0.688>,{<0.0.683>,user_sup}},{badarg,[{queue,is_empty,[[]],[{file,"queue.erl"},{line,-1}]},{user,get_chars,7,[{file,"user.erl"},{line,600}]},{user,do_io_request,5,[{file,"user.erl"},{line,182}]},{user,server_loop,2,[{file,"user.erl"},{line,132}]}]}]}
{error_logger,{{2014,4,6},{17,36,51}},crash_report,[[{initial_call,{supervisor_bridge,user_sup,['Argument__1']}},{pid,<0.0.683>},{registered_name,[]},{error_info,{exit,{badarg,[{queue,is_empty,[[]],[{file,"queue.erl"},{line,-1}]},{user,get_chars,7,[{file,"user.erl"},{line,600}]},{user,do_io_request,5,[{file,"user.erl"},{line,182}]},{user,server_loop,2,[{file,"user.erl"},{line,132}]}]},[{gen_server,terminate,6,[{file,"gen_server.erl"},{line,747}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}},{ancestors,[kernel_sup,<0.0.38>]},{messages,[]},{links,[<0.0.42>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,65678000},{stack_size,0},{reductions,8}],[]]}
{error_logger,{{2014,4,6},{17,36,51}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,child_terminated},{reason,{badarg,[{queue,is_empty,[[]],[{file,"queue.erl"},{line,-1}]},{user,get_chars,7,[{file,"user.erl"},{line,600}]},{user,do_io_request,5,[{file,"user.erl"},{line,182}]},{user,server_loop,2,[{file,"user.erl"},{line,132}]}]}},{offender,[{pid,<0.0.683>},{name,user},{mfargs,{user_sup,start,[]}},{restart_type,temporary},{shutdown,2000},{child_type,supervisor}]}]}
{error_logger,{{2014,4,6},{17,36,51}},std_info,"Process <0.0.743> exited abnormally without links/monitors\nexit reason was: {terminated,[{io,put_chars,[<0.0.688>,unicode,[\"exception error: \",\"function_clause\",\"\\n\",[[\"  in \",[\"(\",[\":\",\" \",\"lists\",\" \",\"sublist\",\" \",[\"#(\",[\"error\",\" \",\"terminated\"],\")\"],\" \",\"1\"],\")\"],\"\\n\"],[32,32,105,110,32,40,\"lfe_scan\",32,\"string\",32,\"4\",41,10],[32,32,105,110,32,40,\"lfe_io\",32,\"scan_and_parse\",32,\"3\",41,10]]]]},{lfe_shell,server_loop,1,[{file,\"lfe_shell.erl\"},{line,106}]}]}\njava trace: erjang.ErlangRaise: {terminated,[{io,put_chars,[<0.0.688>,unicode,[\"exception error: \",\"function_clause\",\"\\n\",[[\"  in \",[\"(\",[\":\",\" \",\"lists\",\" \",\"sublist\",\" \",[\"#(\",[\"error\",\" \",\"terminated\"],\")\"],\" \",\"1\"],\")\"],\"\\n\"],[32,32,105,110,32,40,\"lfe_scan\",32,\"string\",32,\"4\",41,10],[32,32,105,110,32,40,\"lfe_io\",32,\"scan_and_parse\",32,\"3\",41,10]]]]},{lfe_shell,server_loop,1,[{file,\"lfe_shell.erl\"},{line,106}]}]}\n\tat erjang.m.erlang.ErlBif.raise(ErlBif.java)\n\tat erjang.m.io.io.o_request__3(io.erl:66)\n\tat erjang.m.io.io$FN_o_request__3.go(Unknown Source)\n\tat erjang.EFun1.invoke(Unknown Source)\n\tat erjang.m.lfe_shell.lfe_shell.server_loop__1(lfe_shell.erl:106)\n\tat erjang.m.lfe_shell.lfe_shell$FN_server_loop__1.go(Unknown Source)\n\tat erjang.m.erlang.ErlBif.apply(ErlBif.java:140)\n\tat erjang.m.erlang.ErlBif$FN_apply__2.go(Unknown Source)\n\tat erjang.EProc.execute1(EProc.java:682)\n\tat erjang.EProc.execute0(EProc.java:607)\n\tat erjang.EProc.execute(EProc.java:590)\n\tat kilim.Task._runExecute(Task.java)\n\tat kilim.WorkerThread.run(WorkerThread.java:32)\n"}

As opposed to what happens when quitting the Erlang shell:

11> *** Terminating erlang (nonode@nohost)
$

This may be an issue with LFE; I will discuss with Robert.

eriksoe commented 10 years ago

This one is fairly interesting; the queue which is part of the "user" process's state somehow gets to be []. I'd say this is not likely to be an LFE problem.

krestenkrab commented 10 years ago

Yes, very strange. How can user's input queue suddenly not be {<list>, <list>} i.e. a proper queue, but just <list>? This shouldn't happen. We'll have to trace down the bug to which call from user causes this strange value to appear.

oubiwann commented 10 years ago

Let me know if there's anything I can do to provide you with more details on this failure!

On Mon, Apr 7, 2014 at 10:52 AM, Kresten Krab Thorup < notifications@github.com> wrote:

Yes, very strange. How can user's input queue suddenly not be {,

} but just ? This shouldn't happen. We'll have to trace down the bug to which call from user causes this strange value to appear. ## Reply to this email directly or view it on GitHubhttps://github.com/trifork/erjang/issues/85#issuecomment-39761434 .