ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:90312] [Ruby trunk Bug#15383] Reproducible crash: crash.sh:6: [BUG] unexpected THREAD_KILLED
       [not found] <redmine.issue-15383.20181205134017@ruby-lang.org>
@ 2018-12-05 13:40 ` mbj
  2018-12-05 19:03   ` [ruby-core:90325] " Eric Wong
  2018-12-05 19:37 ` [ruby-core:90326] [Ruby trunk Bug#15383] Reproducible crash: crash.rb:6: " mbj
  1 sibling, 1 reply; 5+ messages in thread
From: mbj @ 2018-12-05 13:40 UTC (permalink / raw)
  To: ruby-core

Issue #15383 has been reported by mbjs (Markus Schirp).

----------------------------------------
Bug #15383: Reproducible crash: crash.sh:6: [BUG] unexpected THREAD_KILLED
https://bugs.ruby-lang.org/issues/15383

* Author: mbjs (Markus Schirp)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Hi,

I'm reporting a reliable crash of the ruby interpreter on contested mutexeses that are accessed in child processes.

I currently think that this happens as the child processes main thread, may be waiting for a parent process sibling thread that was holding the mutex at the time of the fork. After the fork is done, all sibling threads are dead, and the mutex detects the attempt to wait for a dead thread, bailing out.

This is simular, but not identical to the case here: https://bugs.ruby-lang.org/issues/14578

Here is a gist with some more test results on various platforms: https://gist.github.com/mbj/e6795ee5e0583c5541ee250e9942279a

I'm fine to get my hands dirty, but would need some pointers if my above conclusion points to the right direction.

Best,

Markus

---Files--------------------------------
output.txt (21.3 KB)
crash.rb (200 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:90325] Re: [Ruby trunk Bug#15383] Reproducible crash: crash.sh:6: [BUG] unexpected THREAD_KILLED
  2018-12-05 13:40 ` [ruby-core:90312] [Ruby trunk Bug#15383] Reproducible crash: crash.sh:6: [BUG] unexpected THREAD_KILLED mbj
@ 2018-12-05 19:03   ` Eric Wong
  2018-12-20  8:36     ` [ruby-core:90631] " Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2018-12-05 19:03 UTC (permalink / raw)
  To: ruby-core

> https://bugs.ruby-lang.org/issues/15383

Thanks, it affects trunk; just more difficult to reproduce
because of thread cache.

I'm a moron for not noticing this when I fixed other bugs :<

r66230 should fix it in trunk and should be backported
(but r66229 is independently broken and I just reverted it for now)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:90326] [Ruby trunk Bug#15383] Reproducible crash: crash.rb:6: [BUG] unexpected THREAD_KILLED
       [not found] <redmine.issue-15383.20181205134017@ruby-lang.org>
  2018-12-05 13:40 ` [ruby-core:90312] [Ruby trunk Bug#15383] Reproducible crash: crash.sh:6: [BUG] unexpected THREAD_KILLED mbj
@ 2018-12-05 19:37 ` mbj
  2018-12-05 20:16   ` [ruby-core:90328] " Eric Wong
  1 sibling, 1 reply; 5+ messages in thread
From: mbj @ 2018-12-05 19:37 UTC (permalink / raw)
  To: ruby-core

Issue #15383 has been updated by mbjs (Markus Schirp).


Thanks for the quick fix. Also for marking the fix to be backported.

Just curious, is there an associated CI build for these changes?

----------------------------------------
Bug #15383: Reproducible crash: crash.rb:6: [BUG] unexpected THREAD_KILLED
https://bugs.ruby-lang.org/issues/15383#change-75434

* Author: mbjs (Markus Schirp)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: REQUIRED
----------------------------------------
Hi,

I'm reporting a reliable crash of the ruby interpreter on contested mutexeses that are accessed in child processes.

I currently think that this happens as the child processes main thread, may be waiting for a parent process sibling thread that was holding the mutex at the time of the fork. After the fork is done, all sibling threads are dead, and the mutex detects the attempt to wait for a dead thread, bailing out.

This is simular, but not identical to the case here: https://bugs.ruby-lang.org/issues/14578

Here is a gist with some more test results on various platforms: https://gist.github.com/mbj/e6795ee5e0583c5541ee250e9942279a

I'm fine to get my hands dirty, but would need some pointers if my above conclusion points to the right direction.

Best,

Markus

---Files--------------------------------
output.txt (21.3 KB)
crash.rb (200 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:90328] Re: [Ruby trunk Bug#15383] Reproducible crash: crash.rb:6: [BUG] unexpected THREAD_KILLED
  2018-12-05 19:37 ` [ruby-core:90326] [Ruby trunk Bug#15383] Reproducible crash: crash.rb:6: " mbj
@ 2018-12-05 20:16   ` Eric Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2018-12-05 20:16 UTC (permalink / raw)
  To: ruby-core

mbj@schirp-dso.com wrote:
> Just curious, is there an associated CI build for these changes?

I check https://rubyci.org/ and http://ci.rvm.jp/ (and get
automated mails from the latter).

There's also TravisCI; but I don't use JavaScript; so I rely
on others giving me URLs to the raw logs.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:90631] Re: [Ruby trunk Bug#15383] Reproducible crash: crash.sh:6: [BUG] unexpected THREAD_KILLED
  2018-12-05 19:03   ` [ruby-core:90325] " Eric Wong
@ 2018-12-20  8:36     ` Eric Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2018-12-20  8:36 UTC (permalink / raw)
  To: ruby-core

> > https://bugs.ruby-lang.org/issues/15383

> r66230 should fix it in trunk and should be backported

No, actually.  r66230 hides an existing problem in the fix
for https://bugs.ruby-lang.org/issues/14578
...
Still working on this and my head hurts :<

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-12-20  8:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15383.20181205134017@ruby-lang.org>
2018-12-05 13:40 ` [ruby-core:90312] [Ruby trunk Bug#15383] Reproducible crash: crash.sh:6: [BUG] unexpected THREAD_KILLED mbj
2018-12-05 19:03   ` [ruby-core:90325] " Eric Wong
2018-12-20  8:36     ` [ruby-core:90631] " Eric Wong
2018-12-05 19:37 ` [ruby-core:90326] [Ruby trunk Bug#15383] Reproducible crash: crash.rb:6: " mbj
2018-12-05 20:16   ` [ruby-core:90328] " Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).