Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New react + chain syntax locks sometimes #4833

Closed
p6rt opened this issue Dec 8, 2015 · 7 comments
Closed

New react + chain syntax locks sometimes #4833

p6rt opened this issue Dec 8, 2015 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 8, 2015

Migrated from rt.perl.org#126842 (status was 'resolved')

Searchable as RT126842$

@p6rt
Copy link
Author

p6rt commented Dec 8, 2015

From pub.claudio@gmail.com

Hi,

The replacement of the 'whatever' syntax as sugar for consuming Channels
through 'react' locks very often (5-10% of the time). The thread seems to
be stuck on 'shift', probably from the Channel). When rewriting the exact
same functionality with the channel.poll syntax, the problem does not occur.

Attached you'll find 2 scripts​: loop_channelreact.p6 reproduces the
problem, while loop_channelpoll uses the old tried and tested approach.

More info at #perl6 (El_Che and also timotimo).

Regards,

C.

Tested on rakudo 2015.11 on Ubuntu 15.10 and Centos 7.0.
$ perl6 -v
This is rakudo version 2015.11-422-ge19741a built on MoarVM version
2015.11-34-gc3eea17 implementing Perl v6.b.
$ uname -a
Linux ubuntu 4.2.0-18-generic #​22-Ubuntu SMP Fri Nov 6 18​:25​:50 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux

@p6rt
Copy link
Author

p6rt commented Dec 8, 2015

@p6rt
Copy link
Author

p6rt commented Dec 8, 2015

@p6rt
Copy link
Author

p6rt commented Dec 9, 2015

From @lizmat

On 08 Dec 2015, at 14​:40, Claudio Ramirez (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Claudio Ramirez
# Please include the string​: [perl #​126842]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126842 >
Tested on rakudo 2015.11 on Ubuntu 15.10 and Centos 7.0.
$ perl6 -v
This is rakudo version 2015.11-422-ge19741a built on MoarVM version
2015.11-34-gc3eea17 implementing Perl v6.b.
$ uname -a
Linux ubuntu 4.2.0-18-generic #​22-Ubuntu SMP Fri Nov 6 18​:25​:50 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux
<loop_channelpoll.p6><loop_channelreact.p6>

Some extra data-points on OS X​:

- I could not get the channel poll version to break (kept running all night, until at least 300K runs).

- the channel react version consistently breaks on the 77th iteration with a SIGABRT

- running the channel react version with MVM_SPESH_DISABLE=1, makes it consistently break on the 70th iteration with a SIGABRT

- running it with MVM_JIT_DISABLE=1 makes no difference from not specifying it​: it breaks on the 77th iteration with a SIGABRT

Changing the whenever {} to​:

  whenever $channel -> \val {
  print val;

makes it consistently fail on the 75th iteration

All in all, this leads me to suspect some kind of garbage collect issue.

And indeed, if I put an "nqp​::force_gc" just before the “sleep”, it does not seem to fail (still running)

Liz

@p6rt
Copy link
Author

p6rt commented Dec 9, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 15, 2017

From @jnthn

On Tue, 08 Dec 2015 05​:40​:29 -0800, pub.claudio@​gmail.com wrote​:

The replacement of the 'whatever' syntax as sugar for consuming Channels
through 'react' locks very often (5-10% of the time). The thread seems to
be stuck on 'shift', probably from the Channel). When rewriting the exact
same functionality with the channel.poll syntax, the problem does not occur.

Attached you'll find 2 scripts​: loop_channelreact.p6 reproduces the
problem, while loop_channelpoll uses the old tried and tested approach.

All kinds of things have been fixed that could have been to blame since this ticket was field; either way, it works out. I remove the sleep so it'd go faster and ran it for 250,000 iterations without trouble.

Added this example as a test in S17-supply/syntax.t to make sure it doesn't come up again.

@p6rt
Copy link
Author

p6rt commented Sep 15, 2017

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 15, 2017
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant