Lockup in child after fork
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.
Updated by alk (Aliaksey Kandratsenka) about 12 years ago
ruby_1_8_7@27173 and ruby_1_8@27224 still hang.
with 1.8.7 branch the backtrace is a bit different
#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 ()
#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
Updated by vo.x (Vit Ondruch) over 10 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  and it lockups on my Fedora with ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]. I am