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

Creating a lot of threads results in SIGABRT #4506

Closed
p6rt opened this issue Sep 3, 2015 · 5 comments
Closed

Creating a lot of threads results in SIGABRT #4506

p6rt opened this issue Sep 3, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Sep 3, 2015

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

Searchable as RT125977$

@p6rt
Copy link
Author

p6rt commented Sep 3, 2015

From @hoelzro

If I do something like this​:

  for ^1000 {
  Thread.start({}).join;
  }

MoarVM will raise a SIGABRT. The reason is that MoarVM+libuv is allocating control pipes (or something like that), MVM_tc_destroy is never called for a thread's ThreadContext after it's joined, the process quickly runs out of file descriptors, and libuv calls abort() after getting a ENFILE.

@p6rt
Copy link
Author

p6rt commented Sep 4, 2015

From @hoelzro

On 2015-09-03 06​:42​:59, rob@​hoelz.ro wrote​:

If I do something like this​:

for ^1000 {
Thread.start({}).join;
}

MoarVM will raise a SIGABRT. The reason is that MoarVM+libuv is
allocating control pipes (or something like that), MVM_tc_destroy is
never called for a thread's ThreadContext after it's joined, the
process quickly runs out of file descriptors, and libuv calls abort()
after getting a ENFILE.

My mistake; that example doesn't work! This one should​:

  for ^1000 { Thread.start(-> {}).join; }

@p6rt
Copy link
Author

p6rt commented Sep 9, 2015

From @jnthn

On Fri Sep 04 08​:06​:36 2015, rob@​hoelz.ro wrote​:

On 2015-09-03 06​:42​:59, rob@​hoelz.ro wrote​:

If I do something like this​:

for ^1000 {
Thread.start({}).join;
}

MoarVM will raise a SIGABRT. The reason is that MoarVM+libuv is
allocating control pipes (or something like that), MVM_tc_destroy is
never called for a thread's ThreadContext after it's joined, the
process quickly runs out of file descriptors, and libuv calls abort()
after getting a ENFILE.

My mistake; that example doesn't work! This one should​:

for ^1000 \{ Thread\.start\(\-> \{\}\)\.join; \}

Fixed, and added S17-lowlevel/thread-start-join-stress.t to try and ensure we don't regress on this. Tested the fix on Windows and Linux.

@p6rt
Copy link
Author

p6rt commented Sep 9, 2015

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

@p6rt
Copy link
Author

p6rt commented Sep 9, 2015

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

@p6rt p6rt closed this as completed Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant