From: Lucas Nussbaum Date: 2010-03-11T15:34:36+09:00 Subject: [ruby-core:28605] [Bug #2739] ruby 1.8.7 built with pthreads hangs under some circumstances Issue #2739 has been updated by Lucas Nussbaum. I'm building with: CFLAGS="-fno-strict-aliasing -g -O2" CXXFLAGS="-fno-strict-aliasing -g" CPPFLAGS="" LDFLAGS="" ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir="\${prefix}/include" --mandir="\${prefix}/share/man" --infodir="\${prefix}/share/info" --sysconfdir=/etc --localstatedir=/var --libexecdir="\${prefix}/lib/ruby1.8" --disable-maintainer-mode --disable-dependency-tracking --disable-silent-rules --srcdir=. --program-suffix=1.8 --enable-pthread --enable-shared --enable-ipv6 --with-lookup-order-hack=INET --disable-rpath --disable-install-doc --with-sitedir='/usr/local/lib/site_ruby' --with-default-kcode=none --with-dbm-type=gdbm_compat --with-tklib=tk8.4 --with-tcllib=tcl8.4 --with-tcl-include=/usr/include/tcl8.4 --with-bundled-sha1 --with-bundled-md5 --with-bundled-rmd160 && make all && sudo make install What I did when you proposed the patches was to rebuild the Debian package with the patches. And indeed, the problem remained, and the backtraces are: Child: #0 __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136 #1 0x00007f3d5ed2f40b in pthread_cond_signal@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:117 #2 0x00007f3d5ef75308 in rb_thread_stop_timer () at eval.c:12539 #3 0x00007f3d5e1a7e66 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c:170 #4 0x00007f3d5efc6611 in rb_f_system (argc=, argv=0x7fff7e47c170) at process.c:1584 #5 0x00007f3d5ef7efdc in rb_call0 (klass=, recv=, id=, oid=, argc=, argv=, body=0x7f3d5f4214d8, flags=0) at eval.c:6003 #6 0x00007f3d5ef7f1c3 in rb_call (klass=139901568018760, recv=139901568008880, mid=9425, argc=1, argv=0x7fff7e47c170, scope=1, self=139901568008880) at eval.c:6255 #7 0x00007f3d5ef7becb in rb_eval (self=140735312019832, n=) at eval.c:3583 #8 0x00007f3d5ef7d327 in rb_yield_0 (val=, self=, klass=, flags=, avalue=) at eval.c:5167 #9 0x00007f3d5ef79662 in rb_eval (self=140735312033144, n=) at eval.c:3371 #10 0x00007f3d5ef7c427 in rb_eval (self=140735312033144, n=) at eval.c:3382 #11 0x00007f3d5ef7c560 in rb_eval (self=140735312033144, n=) at eval.c:3432 #12 0x00007f3d5ef7ee60 in rb_call0 (klass=, recv=0, id=140735312033144, oid=, argc=0, argv=0x7fff7e47f578, body=0x7f3d5f418068, flags=0) at eval.c:6158 #13 0x00007f3d5ef7f1c3 in rb_call (klass=139901567846520, recv=139901567847360, mid=11025, argc=1, argv=0x7fff7e47f570, scope=0, self=139901568008880) at eval.c:6255 #14 0x00007f3d5ef7bfd2 in rb_eval (self=1, n=) at eval.c:3568 #15 0x00007f3d5ef7c8ba in rb_eval (self=0, n=) at eval.c:3296 #16 0x00007f3d5ef79b66 in rb_eval (self=0, n=) at eval.c:3762 #17 0x00007f3d5ef883cb in ruby_exec_internal () at eval.c:1689 #18 0x00007f3d5ef883f5 in ruby_exec () at eval.c:1712 #19 0x00007f3d5ef88425 in ruby_run () at eval.c:1722 #20 0x00000000004008d1 in main () Parent: #0 0x00007f3d5e1cff82 in select () from /lib/libc.so.6 #1 0x00007f3d5ef8459b in rb_thread_schedule () at eval.c:11280 #2 0x00007f3d5efc6185 in rb_waitpid (pid=, st=, flags=1) at process.c:597 #3 0x00007f3d5efc6484 in rb_syswait (pid=16044) at process.c:1442 #4 0x00007f3d5efc6625 in rb_f_system (argc=, argv=0x7fff7e47c170) at process.c:1601 #5 0x00007f3d5ef7efdc in rb_call0 (klass=, recv=, id=, oid=, argc=, argv=, body=0x7f3d5f4214d8, flags=0) at eval.c:6003 #6 0x00007f3d5ef7f1c3 in rb_call (klass=139901568018760, recv=139901568008880, mid=9425, argc=1, argv=0x7fff7e47c170, scope=1, self=139901568008880) at eval.c:6255 #7 0x00007f3d5ef7becb in rb_eval (self=140735312019832, n=) at eval.c:3583 #8 0x00007f3d5ef7d327 in rb_yield_0 (val=, self=, klass=, flags=, avalue=) at eval.c:5167 #9 0x00007f3d5ef79662 in rb_eval (self=140735312033144, n=) at eval.c:3371 #10 0x00007f3d5ef7c427 in rb_eval (self=140735312033144, n=) at eval.c:3382 #11 0x00007f3d5ef7c560 in rb_eval (self=140735312033144, n=) at eval.c:3432 #12 0x00007f3d5ef7ee60 in rb_call0 (klass=, recv=0, id=140735312033144, oid=, argc=0, argv=0x7fff7e47f578, body=0x7f3d5f418068, flags=0) at eval.c:6158 #13 0x00007f3d5ef7f1c3 in rb_call (klass=139901567846520, recv=139901567847360, mid=11025, argc=1, argv=0x7fff7e47f570, scope=0, self=139901568008880) at eval.c:6255 #14 0x00007f3d5ef7bfd2 in rb_eval (self=1, n=) at eval.c:3568 #15 0x00007f3d5ef7c8ba in rb_eval (self=0, n=) at eval.c:3296 #16 0x00007f3d5ef79b66 in rb_eval (self=0, n=) at eval.c:3762 #17 0x00007f3d5ef883cb in ruby_exec_internal () at eval.c:1689 #18 0x00007f3d5ef883f5 in ruby_exec () at eval.c:1712 #19 0x00007f3d5ef88425 in ruby_run () at eval.c:1722 #20 0x00000000004008d1 in main () But applying the patch to the svn tree (branch v1_8_7) works, strangely. This is very surprising, because the Debian package and the SVN tree should be almost identical (we do have a few Debian-specific things, but nothing that should be relevant). I tried to download the ruby-1.8.7-p249.tar.gz tarball, and rebuild it with the patch applied, and it works like the SVN branch (=> the patch works). Conclusion: your patch fixes the bug, and we have something broken in the Debian package that causes the effects of your patch to be hidden. Would you happen to know if something in the Ruby build process could explain that? Anyway, thanks a lot for working on that issue! What is the next step? Are you going to release a 1.8.7.250? ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2739 ---------------------------------------- http://redmine.ruby-lang.org