Tanaka Akira wrote:
> After this commit, test-all causes SEGV on FreeBSD 6.4.
> 
> The SEGV doesn't occur at r25841.
> 
> % uname -a
> FreeBSD freebsd.tky.aist.go.jp 6.4-RELEASE FreeBSD 6.4-RELEASE #0: Wed Nov 26 08:21:48 UTC 2008     root / palmer.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
> % ./ruby -v test/ruby/test_process.rb -v
> ruby 1.9.2dev (2009-11-18 trunk 25846) [x86_64-freebsd6.4]
> Loaded suite test/ruby/test_process
> Started
> TestProcess#test_abort: 0.02 s: .
> TestProcess#test_argv0: 0.12 s: .
> TestProcess#test_argv0_noarg: 0.20 s: .
> TestProcess#test_exec_noshell: 0.02 s: .
> TestProcess#test_exec_shell: 0.06 s: .
> TestProcess#test_exec_wordsplit: 0.04 s: .
> TestProcess#test_execopts_chdir: 0.03 s: .
> TestProcess#test_execopts_close_others: 0.17 s: .
> TestProcess#test_execopts_duplex_io: 0.02 s: .
> TestProcess#test_execopts_env: 0.07 s: .
> TestProcess#test_execopts_exec: 0.02 s: .
> TestProcess#test_execopts_modification: 0.06 s: .
> TestProcess#test_execopts_opts: 0.02 s: .
> TestProcess#test_execopts_pgroup: 0.11 s: .
> TestProcess#test_execopts_popen: 0.12 s: .
> TestProcess#test_execopts_redirect: 0.43 s: .
> TestProcess#test_execopts_redirect_dup2_child: 0.09 s: .
> TestProcess#test_execopts_redirect_self: 0.02 s: .
> TestProcess#test_execopts_rlimit: 0.13 s: .
> TestProcess#test_execopts_umask: 0.04 s: .
> TestProcess#test_execopts_unsetenv_others: 0.04 s: .
> TestProcess#test_fd_inheritance: 0.13 s: .
> TestProcess#test_geteuid: 0.00 s: .
> TestProcess#test_getpgid: 0.00 s: .
> TestProcess#test_getpriority: 0.00 s: .
> TestProcess#test_getuid: 0.00 s: .
> TestProcess#test_gid_re_exchangeable_p: 0.00 s: .
> TestProcess#test_gid_sid_available?: 0.00 s: .
> TestProcess#test_groups: 0.00 s: .
> TestProcess#test_maxgroups: 0.00 s: .
> TestProcess#test_popen_fork: 0.00 s: .
> TestProcess#test_popen_noshell: 0.00 s: .
> TestProcess#test_popen_shell: 0.04 s: .
> TestProcess#test_popen_wordsplit: 0.02 s: .
> TestProcess#test_pst_inspect: 0.00 s: .
> TestProcess#test_rlimit_availability: 0.00 s: .
> TestProcess#test_rlimit_name: 0.00 s: .
> TestProcess#test_rlimit_nofile: 0.02 s: .
> TestProcess#test_rlimit_value: 0.04 s: .
> TestProcess#test_setpriority: 0.00 s: .
> TestProcess#test_sleep: 0.00 s: .
> TestProcess#test_spawn_noshell: 0.00 s: .
> TestProcess#test_spawn_shell: 0.04 s: .
> TestProcess#test_spawn_wordsplit: 0.02 s: .
> TestProcess#test_status: 0.02 s: .
> TestProcess#test_status_kill: 1.04 s: .
> TestProcess#test_system_noshell: 0.00 s: .
> TestProcess#test_system_shell: 0.04 s: .
> TestProcess#test_system_wordsplit: 0.02 s: .
> TestProcess#test_uid_re_exchangeable_p: 0.00 s: .
> TestProcess#test_uid_sid_available?: 0.00 s: .
> TestProcess#test_wait2: 0.12 s: .
> TestProcess#test_wait_and_sigchild: test/ruby/test_process.rb:1136: [BUG] native_mutex_unlock return non-zero: 1
> ruby 1.9.2dev (2009-11-18 trunk 25846) [x86_64-freebsd6.4]
> 
> -- control frame ----------
> c:0017 p:---- s:0059 b:0059 l:000058 d:000058 CFUNC  :sleep
> c:0016 p:0011 s:0055 b:0055 l:000778 d:000054 BLOCK  test/ruby/test_process.rb:1136
> c:0015 p:---- s:0053 b:0053 l:000052 d:000052 FINISH
> c:0014 p:---- s:0051 b:0051 l:000050 d:000050 CFUNC  :fork
> c:0013 p:0035 s:0048 b:0048 l:000778 d:000778 METHOD test/ruby/test_process.rb:1136
> c:0012 p:0063 s:0043 b:0043 l:000700 d:000700 METHOD /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:458
> c:0011 p:0091 s:0037 b:0037 l:000018 d:000036 BLOCK  /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:426
> c:0010 p:---- s:0032 b:0032 l:000031 d:000031 FINISH
> c:0009 p:---- s:0030 b:0030 l:000029 d:000029 CFUNC  :each
> c:0008 p:0026 s:0027 b:0027 l:000018 d:000026 BLOCK  /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:420
> c:0007 p:---- s:0024 b:0024 l:000023 d:000023 FINISH
> c:0006 p:---- s:0022 b:0022 l:000021 d:000021 CFUNC  :each
> c:0005 p:0082 s:0019 b:0019 l:000018 d:000018 METHOD /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:419
> c:0004 p:0154 s:0014 b:0014 l:000013 d:000013 METHOD /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:393
> c:0003 p:0041 s:0007 b:0007 l:000f98 d:000006 BLOCK  /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:334
> c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
> c:0001 p:0000 s:0002 b:0002 l:000018 d:000018 TOP   
> ---------------------------
> /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:334:in `block in autorun'
> /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:393:in `run'
> /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:419:in `run_test_suites'
> /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:419:in `each'
> /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:420:in `block in run_test_suites'
> /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:420:in `each'
> /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:426:in `block (2 levels) in run_test_suites'
> /home/akr/ruby/o0/lib/ruby/1.9.1/minitest/unit.rb:458:in `run'
> test/ruby/test_process.rb:1136:in `test_wait_and_sigchild'
> test/ruby/test_process.rb:1136:in `fork'
> test/ruby/test_process.rb:1136:in `block in test_wait_and_sigchild'
> test/ruby/test_process.rb:1136:in `sleep'
> 
> [NOTE]
> You may have encountered a bug in the Ruby interpreter or extension libraries.
> Bug reports are welcome.
> For details: http://www.ruby-lang.org/bugreport.html
> 
> 1.04 s: .
> TestProcess#test_wait_without_arg: 0.12 s: .
> TestProcess#test_waitall: 0.17 s: .
> 
> Finished in 4.792797 seconds.
> 
> 55 tests, 229 assertions, 0 failures, 0 errors, 0 skips

I cannot reproduce this segfault on OS X Snow Leopard. Though I did find another
unrelated issue while running test_process.rb, which I reported here:
http://redmine.ruby-lang.org/issues/show/2382