Skip Menu |
Report information
Id: 129787
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: gfldex <wenzel.peppmeyer [at] gmx.de>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Sun, 2 Oct 2016 21:52:22 +0200 (CEST)
To: rakudobug [...] perl.org
Subject: die/CATCH inside a start-block with a channel heisenbugs
From: "Wenzel P. P. Peppmeyer" <wenzel.peppmeyer [...] gmx.de>
Download (untitled) / with headers
text/plain 584b
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
Download (untitled) / with headers
text/plain 785b
On Sun Oct 02 12:52:45 2016, gfldex wrote: Show quoted text
> 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
valgrind output when I ran it: https://gist.github.com/MasterDuke17/e98b6e661aef2d467232c47b3a443b19
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 900b
On Sun Oct 02 12:52:45 2016, gfldex wrote: Show quoted text
> 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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org