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

threads, dynamic variables lost sometimes #4933

Closed
p6rt opened this issue Dec 26, 2015 · 9 comments
Closed

threads, dynamic variables lost sometimes #4933

p6rt opened this issue Dec 26, 2015 · 9 comments

Comments

@p6rt
Copy link

p6rt commented Dec 26, 2015

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

Searchable as RT127033$

@p6rt
Copy link
Author

p6rt commented Dec 26, 2015

From @LLFourn

perl6 -e 'sub t { say $*d }; my $*d = 1; await do { start { t() } }'

#!>Dynamic variable $*d not found

Tested on mac and deb.

@p6rt
Copy link
Author

p6rt commented Dec 26, 2015

From @lizmat

On 26 Dec 2015, at 13​:12, Lloyd Fournier (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Lloyd Fournier
# Please include the string​: [perl #​127033]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127033 >

perl6 -e 'sub t { say $*d }; my $*d = 1; await do { start { t() } }'
#!>Dynamic variable $*d not found
Tested on mac and deb.

Confirmed.

But is there a reason you want to use the do { } block? Without it, it just works!

$ 6 'sub t { say $*d }; my $*d = 1; await start { t() }’
1

Looks like any extra scope breaks it​:

$ 6 'sub t { say $*d }; my $*d = 1; await do for 1 { start { t() } }'
Dynamic variable $*d not found

$ 6 'sub t { say $*d }; my $*d = 1; await 1.map​: { start { t() } }'
Dynamic variable $*d not found

Liz

@p6rt
Copy link
Author

p6rt commented Dec 26, 2015

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

@p6rt
Copy link
Author

p6rt commented Jan 8, 2016

From @LLFourn

Zoffix++ lead to the discovery of a similar bug which can be golfed to​:

00​:16 < llfourn> m​: my $*A = 42; do { start { $*A++ } }; sleep 2; say $*A
00​:16 <+camelia> rakudo-moar fbe0a6​: OUTPUT«42␤»

if you put the block outside the start {} you don't get an error but you
don't get the side affects.

On Sun, Dec 27, 2015 at 7​:06 AM Elizabeth Mattijsen via RT <
perl6-bugs-followup@​perl.org> wrote​:

On 26 Dec 2015, at 13​:12, Lloyd Fournier (via RT) <
perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Lloyd Fournier
# Please include the string​: [perl #​127033]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127033 >

perl6 -e 'sub t { say $*d }; my $*d = 1; await do { start { t() } }'
#!>Dynamic variable $*d not found
Tested on mac and deb.

Confirmed.

But is there a reason you want to use the do { } block? Without it, it
just works!

$ 6 'sub t { say $*d }; my $*d = 1; await start { t() }’
1

Looks like any extra scope breaks it​:

$ 6 'sub t { say $*d }; my $*d = 1; await do for 1 { start { t() } }'
Dynamic variable $*d not found

$ 6 'sub t { say $*d }; my $*d = 1; await 1.map​: { start { t() } }'
Dynamic variable $*d not found

Liz

@p6rt
Copy link
Author

p6rt commented Oct 10, 2016

From @smls

All the examples in this thread work fine for me, on 64bit Linux with current Rakudo.

  This is Rakudo version 2016.09-163-g92c0921 built on MoarVM version 2016.09-39-g688796b
  implementing Perl 6.c.

Has the bug been fixed, or is it platform-dependent?

@p6rt
Copy link
Author

p6rt commented Oct 10, 2016

From @smls

It really seems to have been fixed. (Fails with older Rakudo revisions but works with newer ones on the same system).

Bisectable identifies the following as the commit that fixed it (both the original test-case and Zoffix's one)​:

rakudo/rakudo@25e9fd7

Marking as [test needed].

@p6rt
Copy link
Author

p6rt commented Oct 11, 2016

From @LLFourn

looks like it's been fixed! \o/

I will put writing test for this on my TODO.

On Tue, Oct 11, 2016 at 5​:00 AM Sam S. via RT <perl6-bugs-followup@​perl.org>
wrote​:

All the examples in this thread work fine for me, on 64bit Linux with
current Rakudo.

  This is Rakudo version 2016.09-163-g92c0921 built on MoarVM version
2016.09-39-g688796b
  implementing Perl 6.c.

Has the bug been fixed, or is it platform-dependent?

@p6rt
Copy link
Author

p6rt commented Oct 12, 2016

From @LLFourn

Tests​:
Raku/roast@0705a6e

On Tue, Oct 11, 2016 at 9​:26 PM Lloyd Fournier <lloyd.fourn@​gmail.com>
wrote​:

looks like it's been fixed! \o/

I will put writing test for this on my TODO.

On Tue, Oct 11, 2016 at 5​:00 AM Sam S. via RT <
perl6-bugs-followup@​perl.org> wrote​:

All the examples in this thread work fine for me, on 64bit Linux with
current Rakudo.

This is Rakudo version 2016\.09\-163\-g92c0921 built on MoarVM version

2016.09-39-g688796b
implementing Perl 6.c.

Has the bug been fixed, or is it platform-dependent?

@p6rt
Copy link
Author

p6rt commented Oct 12, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant