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

Signal + thread tests from MRI are unreliable #4956

Open
headius opened this issue Jan 8, 2018 · 0 comments
Open

Signal + thread tests from MRI are unreliable #4956

headius opened this issue Jan 8, 2018 · 0 comments

Comments

@headius
Copy link
Member

headius commented Jan 8, 2018

There are two tests in MRI that test whether a Thread can be joined from a Signal trap handler. Both tend to fail intermittently on JRuby (the INT trap fails to capture the event), likely because of some race between setting up the signal handler and initiating the interrupt.

Because these are very peculiar cases, and test behavior specific to MRI's VM (thread state and signal handlers did not mix) I'm excluding these cases from our run.

@headius headius added this to the Non-Release milestone Jan 8, 2018
headius added a commit that referenced this issue Jan 8, 2018
I am not convinced the intermittent failures here indicate an
issue in JRuby. Rather, I suspect there's a race, since these
tests involve setting up a signal handler, signalling INT from a
thread, and joining in both main and the handler itself. However
I have been unable to come up a reason for the race, so I have
filed #4956 to track this exclusion.

An example script, which should run forever but dies:

```ruby
loop {
  Signal.trap(:INT, "DEFAULT")
  t0 = Thread.current
  t = Thread.new {Thread.pass until t0.stop?; Process.kill(:INT, $$)}

  Signal.trap :INT do
    t.join
  end

  t.join
  print '.'
}
```
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