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

require inside thread segfault hang #4737

Open
p6rt opened this issue Nov 8, 2015 · 6 comments
Open

require inside thread segfault hang #4737

p6rt opened this issue Nov 8, 2015 · 6 comments
Labels
SEGV Segmentation fault, bus error, etc. testneeded

Comments

@p6rt
Copy link

p6rt commented Nov 8, 2015

Migrated from rt.perl.org#126587 (status was 'open')

Searchable as RT126587$

@p6rt
Copy link
Author

p6rt commented Nov 8, 2015

From @LLFourn

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

@p6rt
Copy link
Author

p6rt commented Nov 9, 2015

From @jonathanstowe

This may be related to the https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126390

On Sun Nov 08 01​:11​:45 2015, 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

@p6rt
Copy link
Author

p6rt commented Dec 12, 2015

From @LLFourn

#​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​:

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 #&#8203;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@&#8203;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

@p6rt
Copy link
Author

p6rt commented Mar 9, 2018

From @AlexDaniel

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

@p6rt
Copy link
Author

p6rt commented Mar 9, 2018

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

@p6rt
Copy link
Author

p6rt commented Mar 9, 2018

From @AlexDaniel

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

(2016-05-12) rakudo/rakudo@2511398

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​:

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

@p6rt p6rt added SEGV Segmentation fault, bus error, etc. testneeded labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SEGV Segmentation fault, bus error, etc. testneeded
Projects
None yet
Development

No branches or pull requests

1 participant