[erlang-questions] is this a shell bug?
Avinash Dhumane
avinash@REDACTED
Mon Apr 23 07:07:40 CEST 2012
At step# 8, X is already bound, unlike at step# 5. So, "receive" at step#8
is trying to receive the same message that it did at step# 5.
Issue "f(X)" (i.e. "forget" X) after step#7 and before "receive" at
step#8. That will explain.
On Mon, 23 Apr 2012 08:38:00 +0530, 吴磊 <mjollnir.ray@REDACTED> wrote:
> Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4]
> [async-threads:0] [hipe] [kernel-poll:false]
>
> Eshell V5.9.1 (abort with ^G)
> 1> self().
> <0.32.0>
> 2> process_flag(trap_exit, true).
> false
> 3> spawn_link(fun() -> ok end).
> <0.36.0>
> 4> process_info(self(), messages).
> {messages,[{'EXIT',<0.36.0>,normal}]}
> 5> receive X -> X end.
> {'EXIT',<0.36.0>,normal}
> 6> spawn_link(fun() -> ok end).
> <0.40.0>
> 7> process_info(self(), messages).
> {messages,[{'EXIT',<0.40.0>,normal}]}
> 8> receive X -> X end.
>
> shell SUSPENDING .... WHAT's happed here?
>
> ^G
> User switch command
> --> s
> --> c
> Eshell V5.9.1 (abort with ^G)
> 1> process_info(pid(0,32,0), current_function).
> {current_function,{erl_eval,receive_clauses,6}}
> 2> process_info(pid(0,32,0), messages).
> {messages,[]}
>
> BTW c:flush() looks work well with shell.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
--
-----------------------------------------------------------------------------
Avinash Dhumane * Balin Tech Labs Pvt Ltd, Pune,
India
Architect, Integration & Scalability * Fulfilling SLAs in the presence
of
+91-9767838896 | www.balinlabs.com * faults and extreme load.
-----------------------------------------------------------------------------
More information about the erlang-questions
mailing list