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: testneeded
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
RT-Send-CC: perl6-compiler [...] perl.org
On Wed, 02 Nov 2016 07:13:26 -0700, jnthn@jnthn.net wrote: Show quoted text
> 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
This is now fixed, but have no idea how to test it… On 2016.10, I can only repro this bug with STDERR/STDOUT set to a TTY terminal.
FWIW, this bug is somewhat similar in feel: https://github.com/rakudo/rakudo/issues/1202

On 2017-10-15 03:14:02, cpan@zoffix.com wrote:
Show quoted text
> On Wed, 02 Nov 2016 07:13:26 -0700, jnthn@jnthn.net wrote:
> > 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
>
>
> This is now fixed, but have no idea how to test it… On 2016.10, I can
> only repro this bug with STDERR/STDOUT set to a TTY terminal.




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