Project

General

Profile

Actions

Bug #3100

closed

Lockup in child after fork

Added by alk (Aliaksey Kandratsenka) over 14 years ago. Updated about 5 years ago.

Status:
Closed
Assignee:
-
ruby -v:
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
[ruby-core:29263]

Description

=begin
I was using PTY.spawn and found a bug. I'm attaching a small testcase that at least on 2 my machines gives quite probable ruby process lockup in child.

I'm also attaching gdb backtrace of locked up child. It can be seen that we're stuck in NTPL's low-level lock that protects timer thread condition variable. So it looks like I'm doing fork at 'right' time, when this condition is being signaled in parent.

P.S. I'm categorizing it as core even though I can reproduce this only via PTY.spawn, 'cause pty.c looks very much innocent.
=end


Files

forktest.rb (548 Bytes) forktest.rb alk (Aliaksey Kandratsenka), 04/05/2010 08:14 PM
backtrace.txt (7.8 KB) backtrace.txt alk (Aliaksey Kandratsenka), 04/05/2010 08:14 PM
strace.log (36.1 KB) strace.log $ strace ruby forktest.rb 1 vo.x (Vit Ondruch), 08/30/2011 05:09 PM

Related issues 1 (0 open1 closed)

Related to Backport187 - Backport #2739: ruby 1.8.7 built with pthreads hangs under some circumstancesClosedshyouhei (Shyouhei Urabe)02/12/2010Actions
Actions #1

Updated by naruse (Yui NARUSE) over 14 years ago

=begin
Try ruby_1_8 branch and see the thread [ruby-core:28151].
=end

Actions #2

Updated by alk (Aliaksey Kandratsenka) over 14 years ago

=begin
ruby_1_8_7@27173 and ruby_1_8@27224 still hang.

with 1.8.7 branch the backtrace is a bit different

(gdb) bt
#0 0xffffe430 in __kernel_vsyscall ()
#1 0xf76d3b69 in __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:142
#2 0xf76d16f6 in pthread_cond_signal@@GLIBC_2.3.2 ()
at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_signal.S:174
#3 0xf7728e6d in rb_thread_stop_timer () at eval.c:12357
#4 0xf75b38b6 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:170
#5 0xf76d66f4 in __fork () at ../nptl/sysdeps/unix/sysv/linux/pt-fork.c:26
#6 0xf76f84d9 in establishShell (argc=1, argv=0xff9c80e0, self=4149235120) at pty.c:226

=end

Actions #3

Updated by kosaki (Motohiro KOSAKI) over 14 years ago

=begin
Unfortunatelly, I don't reproduce this problem on current ruby_1_8 branch. ruby_1_8_7 branch result is expected, you saw #2739 issue.
=end

Actions #4

Updated by alk (Aliaksey Kandratsenka) over 14 years ago

=begin
Pass --enable-pthread to ./configure. That's part of ruby configuration in Debian/Ubuntu.

Latest as of Sat May 8 14:39:23 UTC 2010 ruby_1_8 still hangs.

=end

Updated by vo.x (Vit Ondruch) about 13 years ago

May I ask what is the state of this issue? The reproducer was recently mentioned as an issue in upcoming RHEL 6.2 [1] and it lockups on my Fedora with ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]. I am

[1] https://bugzilla.redhat.com/show_bug.cgi?id=734180

Updated by vo.x (Vit Ondruch) about 13 years ago

Please can somebody take a look into this issue? Ruby 1.8.7-p352 are unfortunately still affected by this bug.

Actions #7

Updated by jeremyevans0 (Jeremy Evans) about 5 years ago

  • Description updated (diff)
  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0