[erlang-bugs] Internal error in beam_block when using [] as receive timeout

Anthony Ramine n.oxyde@REDACTED
Tue Mar 4 02:37:12 CET 2014


https://github.com/erlang/otp/pull/262

-- 
Anthony Ramine

Le 4 mars 2014 à 02:20, Anthony Ramine <n.oxyde@REDACTED> a écrit :

> A smaller sample is:
> 
> 	f() -> receive after [] -> timeout end.
> 
> This should probably be forbidden by both erl_lint and core_lint.
> 
> -- 
> Anthony Ramine
> 
> Le 3 mars 2014 à 09:12, Ulf Norell <ulf.norell@REDACTED> a écrit :
> 
>> Sorry for the spam, this is the last one :).
>> 
>> -module(bug).
>> f() -> receive _ -> ok after [] -> timeout end.
>> $ erl
>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
>> 
>> Eshell V6.0  (abort with ^G)
>> 1> c(bug).
>> Function: f/0
>> bug.erl: internal error in beam_block;
>> crash reason: {case_clause,
>>    {'EXIT',
>>        {function_clause,
>>            [{beam_utils,live_opt,
>>                 [[{wait_timeout,{f,5},nil},
>>                   {label,6},
>>                   return,
>>                   {block,
>>                       [{set,[],[],remove_message},
>>                        {set,[{x,0}],[{atom,ok}],move}]},
>>                   {loop_rec,{f,6},{x,0}},
>>                   {label,5},
>>                   {line,[{location,"bug.erl",2}]},
>>                   {label,2}],
>>                  0,
>>                  {1,{1,0,nil,nil}},
>>                  [timeout,
>>                   {block,
>>                       [{'%live',0},
>>                        {set,[{x,0}],[{atom,timeout}],move},
>>                        {'%live',1}]},
>>                   return]],
>>                 [{file,"beam_utils.erl"},{line,645}]},
>>             {beam_utils,live_opt,1,[{file,"beam_utils.erl"},{line,207}]},
>>             {beam_block,function,2,[{file,"beam_block.erl"},{line,38}]},
>>             {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]},
>>             {beam_block,module,2,[{file,"beam_block.erl"},{line,29}]},
>>             {compile,'-select_passes/2-anonymous-2-',2,
>>                 [{file,"compile.erl"},{line,493}]},
>>             {compile,'-internal_comp/4-anonymous-1-',2,
>>                 [{file,"compile.erl"},{line,290}]},
>>             {compile,fold_comp,3,[{file,"compile.erl"},{line,308}]}]}}}
>> 
>>  in function  io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638)
>>  in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727)
>>  in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697)
>>  in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727)
>>  in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697)
>>  in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727)
>>  in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697)
>>  in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727)
>> bug.erl:2: Warning: function f/0 is unused
>> error
>> 
>> / Ulf
>> _______________________________________________
>> erlang-bugs mailing list
>> erlang-bugs@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-bugs
> 




More information about the erlang-bugs mailing list