# New Ticket Created by Wenzel Peppmeyer
# Please include the string: [perl #129787]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=129787 >
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