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

Owner: Nobody
Requestors: lloyd.fourn [at] gmail.com
Cc:
AdminCc:

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



Subject: [BUG] require inside thread segfault hang
To: rakudobug [...] perl.org
Date: Sun, 8 Nov 2015 20:10:55 +1100
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Download (untitled) / with headers
text/plain 685b
Two async + require bugs. Replace LWP::Simple with whatever you like (except for builtins like Test which seem to work no matter what)

1. segfault

Thread.start({ say "entering"; require LWP::Simple; say "leaving" })
#both enters and leaves but segfault when it's done.

2. HTTP::Server::Tiny hangs

use HTTP::Server::Tiny;

HTTP::Server::Tiny.new(port => 8080).run: sub ($env) {
    note "requiring!";
    require LWP::Simple; # or whatever
    note "we got it!";
    return 200, ['Content-Type' => 'text/plain'], 'we win';
};

# then curl localhost:8080, you'll only get "requiring!".

This is perl6 version 2015.10-220-g4988c70 built on MoarVM version 2015.10-61-g624d504

Mac OSX

Download (untitled) / with headers
text/plain 873b
This may be related to the https://rt.perl.org/Ticket/Display.html?id=126390 On Sun Nov 08 01:11:45 2015, lloyd.fourn@gmail.com wrote: Show quoted text
> Two async + require bugs. Replace LWP::Simple with whatever you like > (except for builtins like Test which seem to work no matter what) > > 1. segfault > > Thread.start({ say "entering"; require LWP::Simple; say "leaving" }) > #both enters and leaves but segfault when it's done. > > 2. HTTP::Server::Tiny hangs > > use HTTP::Server::Tiny; > > HTTP::Server::Tiny.new(port => 8080).run: sub ($env) { > note "requiring!"; > require LWP::Simple; # or whatever > note "we got it!"; > return 200, ['Content-Type' => 'text/plain'], 'we win'; > }; > > # then curl localhost:8080, you'll only get "requiring!". > > This is perl6 version 2015.10-220-g4988c70 built on MoarVM version > 2015.10-61-g624d504 > > Mac OSX
Date: Sat, 12 Dec 2015 13:30:52 +0000
Subject: Re: [perl #126587] AutoReply: [BUG] require inside thread segfault hang
To: perl6-bugs-followup [...] perl.org
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Download (untitled) / with headers
text/plain 3.4k
#1 require inside thread now gives:

perl6 -e 'Thread.start({ say "entering"; require Linenoise; say "leaving" })'
entering
Unhandled exception: This type does not support associative operations
   at <unknown>:1  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm::4294967295)
 from <unknown>:1  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm::18)
 from gen/moar/m-CORE.setting:34776  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm::20)
 from gen/moar/m-CORE.setting:34770  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:setup-repositories:67)
 from gen/moar/m-CORE.setting:35668  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:INITIALIZE_DYNAMIC:38)
 from gen/moar/m-CORE.setting:585  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:INITIALIZE_DYNAMIC:25)
 from gen/moar/m-CORE.setting:576  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm::57)
 from gen/moar/m-CORE.setting:565  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm::43)
 from gen/moar/m-CORE.setting:558  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:DYNAMIC:29)
 from gen/moar/m-CORE.setting:34896  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm::169)
 from gen/moar/m-CORE.setting:34884  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm::52)
 from gen/moar/m-CORE.setting:30433  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:protect:51)
 from gen/moar/m-CORE.setting:34881  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:load_module:165)
 from -e:1  (<ephemeral file>::52)
 from gen/moar/m-CORE.setting:30362  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:THREAD-ENTRY:44)

On Sun, Nov 8, 2015 at 8:11 PM perl6 via RT <perl6-bugs-followup@perl.org> wrote:
Show quoted text
Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding:
        "[BUG] require inside thread segfault hang",
a summary of which appears below.

There is no need to reply to this message right now.  Your ticket has been
assigned an ID of [perl #126587].

Please include the string:

         [perl #126587]

in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.

                        Thank you,
                        perl6-bugs-followup@perl.org

-------------------------------------------------------------------------
Two async + require bugs. Replace LWP::Simple with whatever you like
(except for builtins like Test which seem to work no matter what)

1. segfault

Thread.start({ say "entering"; require LWP::Simple; say "leaving" })
#both enters and leaves but segfault when it's done.

2. HTTP::Server::Tiny hangs

use HTTP::Server::Tiny;

HTTP::Server::Tiny.new(port => 8080).run: sub ($env) {
    note "requiring!";
    require LWP::Simple; # or whatever
    note "we got it!";
    return 200, ['Content-Type' => 'text/plain'], 'we win';
};

# then curl localhost:8080, you'll only get "requiring!".

This is perl6 version 2015.10-220-g4988c70 built on MoarVM version
2015.10-61-g624d504

Mac OSX

dogbert++ noticed me that this issue is resolved (according to the provided snippets). It is indeed so.

Second snippet may need this change:

-return 200, ['Content-Type' => 'text/plain'], 'we win';
+return 200, ['Content-Type' => 'text/plain'], ['we win'];

I can confirm that both issues are not reproducible using recent-ish rakudo, but I can't tell when these problems were fixed. The first problem is not really reproducible on any rakudo, even the one mentioned in the OP (huh??). Also, there's some problem using HTTP::Server::Tiny on pre 2015.12 rakudos (“Supplier” did not exist back then?).

Anyway, marking as 「testneeded」. If anybody wants to find what commit affected these snippets, I'm pretty sure you'll have to bisect it manually without a bot.

On 2015-11-08 01:11:45, lloyd.fourn@gmail.com wrote:
Show quoted text
> Two async + require bugs. Replace LWP::Simple with whatever you like
> (except for builtins like Test which seem to work no matter what)
>
> 1. segfault
>
> Thread.start({ say "entering"; require LWP::Simple; say "leaving" })
> #both enters and leaves but segfault when it's done.
>
> 2. HTTP::Server::Tiny hangs
>
> use HTTP::Server::Tiny;
>
> HTTP::Server::Tiny.new(port => 8080).run: sub ($env) {
> note "requiring!";
> require LWP::Simple; # or whatever
> note "we got it!";
> return 200, ['Content-Type' => 'text/plain'], 'we win';
> };
>
> # then curl localhost:8080, you'll only get "requiring!".
>
> This is perl6 version 2015.10-220-g4988c70 built on MoarVM version
> 2015.10-61-g624d504
>
> Mac OSX


Well, bisectable just told me that maybe I should mention at least one of the suspected commits.

(2016-05-12) https://github.com/rakudo/rakudo/commit/25113987502bba1cb48bd130b21982f6608e4aa3

Output before and after that commit: https://gist.github.com/8e47787d7d7c7e6cf1ee7161740a999d

Basically, the behavior changed more than once and it's just a pain to decipher what happened.

On 2018-03-09 09:12:32, alex.jakimenko@gmail.com wrote:
Show quoted text
> dogbert++ noticed me that this issue is resolved (according to the
> provided
> snippets). It is indeed so.
>
> Second snippet may need this change:
>
> -return 200, ['Content-Type' => 'text/plain'], 'we win';
> +return 200, ['Content-Type' => 'text/plain'], ['we win'];
>
> I can confirm that both issues are not reproducible using recent-ish
> rakudo,
> but I can't tell when these problems were fixed. The first problem is
> not
> really reproducible on any rakudo, even the one mentioned in the OP
> (huh??).
> Also, there's some problem using HTTP::Server::Tiny on pre 2015.12
> rakudos
> (“Supplier” did not exist back then?).
>
> Anyway, marking as 「testneeded」. If anybody wants to find what commit
> affected
> these snippets, I'm pretty sure you'll have to bisect it manually
> without a
> bot.
>
> On 2015-11-08 01:11:45, lloyd.fourn@gmail.com wrote:
> > Two async + require bugs. Replace LWP::Simple with whatever you like
> > (except for builtins like Test which seem to work no matter what)
> >
> > 1. segfault
> >
> > Thread.start({ say "entering"; require LWP::Simple; say "leaving" })
> > #both enters and leaves but segfault when it's done.
> >
> > 2. HTTP::Server::Tiny hangs
> >
> > use HTTP::Server::Tiny;
> >
> > HTTP::Server::Tiny.new(port => 8080).run: sub ($env) {
> > note "requiring!";
> > require LWP::Simple; # or whatever
> > note "we got it!";
> > return 200, ['Content-Type' => 'text/plain'], 'we win';
> > };
> >
> > # then curl localhost:8080, you'll only get "requiring!".
> >
> > This is perl6 version 2015.10-220-g4988c70 built on MoarVM version
> > 2015.10-61-g624d504
> >
> > Mac OSX




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