On Sun Oct 02 12:52:45 2016, gfldex wrote:
> sub f(){
>      my $c = Channel.new;
> 
>      start {
>          for 1..* {
>              CATCH { default { note .Str } }
> 
>              $c.send($_);
>              die 'bad';
>          }
>      }
> 
>      $c.list
> }
> 
> .say for f;
> 
> # sometimes it works
> # sometimes it counts to 20 and outputs: 
> #     Command terminated
> # sometimes it outputs some numbers and 'bad's end then some 
> # unicode-garbage
> # sometimes it outputs a few 100s 'bad' and then stalls with one thread at 
> # 100% CPU
> # heisenbug rate is about 1/3
> #
> # also it seams to eat up plenty of RAM while it's running without the 
> # die/CATCH

This one is yet another case of the long-standing issues with use of handles 
across threads. The channel golfs away; you can get this bug with just:

start { for ^100 { note "hi" } }; for ^100 { say "oops" }

/jnthn

Reply via email to