[ruby-core:83067] Re: [Ruby trunk Bug#13794] Infinite loop of sched_yield

From: Eric Wong <normalperson@...>
Date: 2017-09-30 21:54:46 UTC
List: ruby-core #83067
xkernigh@netscape.net wrote:
> Anyone can use Gregory's sched_yield_loop.rb to check for the
> bug. If the weaker patch from Eric Wong fixes the bug for
> Linux, I suggest to put the weaker patch in trunk, and to
> backport it to older Ruby versions.

Thanks to all you for the feedback, I've commited my original patcha
as r60079.

> But I might have found a different bug. I did kill -ABRT a
> spinning child and gave the core dump to gdb; it seemed that
> both threads were stuck inside OpenBSD's thread library. The
> main thread was stuck in pthread_join(), and the other thread
> was stuck in _rthread_tls_destructors(). I did not find any
> thread stuck in the loop `while
> (ATOMIC_CAS(timer_thread_pipe.writing, (rb_atomic_t)0, 0))`
> identified by Charlie Smurthwaite in the original bug report.

Yes, this seems like a different bug.  Maybe OpenBSD pthreads
doesn't work well with fork/vfork (glibc barely does), and
that's a bug for OpenBSD guys to fix.

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread