Bug when daemonizing


#1

e$B$k$S$-$A$G$9!#e(B

e$B860xITL@$J$N$G%"%W%j%1!<%7%g%s$NNc$G?=$7Lu$"$j$^$;$s!#e(B
rcodetools (gem install rcodetools) e$BFb$Ke(B rct-fork /
rct-fork-client
e$B$H$$$&%i%$%V%i%j%m!<%I$N%*!<%P!<%X%C%I$rM^@)$9$k%9%/%j%W%H$,$"$j$^$9!#e(B
e$B$3$l$Oe(B xmpfilter
e$B$HAH$_9g$o$;$F;H$&$3$H$rG0F,$KCV$$$F$$$^$9!#e(B
xmpfilter --fork e$B$r<B9T$9$k$H!"e(B rct-fork-client
e$B$r;H$C$FCm<a$r9T$$$^$9!#e(B

e$B860x5fL@$r;n$_$^$7$?$,!"$I$&$7$F$b:G>.8B$N%5%s%W%k$r:n@.$G$-$^$;$s$G$7$?!#e(B
trunk e$B$K$*$$$Fe(B xmpfilter --fork e$B$r<B9T$9$k$H3N$+$Ke(B Ruby
e$B%$%s%?%W%j%?$OMn$A$^$9!#e(B

Ruby 1.8 e$B$G$O@5$7$$5sF0$r<($7$^$9!#e(B

$ ruby18 -S rct-fork -rcgi # e$B%5!<%Pe(B

$ (echo “RUBY_VERSION # =>”; echo ‘$".grep (/cgi/) # =>’) | xmpfilter
–fork # e$B%/%i%$%"%s%He(B
RUBY_VERSION # => “1.8.7”
$".grep (/cgi/) # => [“cgi.rb”]

trunk e$B$N>l9g$OMn$A$^$9!#e(B

$ ruby19 -S rct-fork -rcgi # e$B%5!<%Pe(B
e$B!J%5!<%P$O@5$7$/F0:n$9$k!Ke(B

$ (echo “RUBY_VERSION # =>”; echo ‘$".grep (/cgi/) # =>’) | xmpfilter
–fork
(eval):1: [BUG] Segmentation fault
ruby 1.9.2dev (2009-03-03 trunk 22725) [i686-linux]

– control frame ----------
c:0016 p:---- s:0049 b:0049 l:000048 d:000048 CFUNC :reopen
c:0015 p:0014 s:0044 b:0044 l:000b94 d:001e24 EVAL (eval):1
c:0014 p:---- s:0042 b:0042 l:000041 d:000041 FINISH
c:0013 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC :eval
c:0012 p:0019 s:0035 b:0035 l:000026 d:000034 BLOCK
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:220
c:0011 p:---- s:0032 b:0032 l:000031 d:000031 FINISH
c:0010 p:---- s:0030 b:0030 l:000029 d:000029 CFUNC :each
c:0009 p:0073 s:0027 b:0027 l:000026 d:000026 METHOD
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:220
c:0008 p:0031 s:0023 b:0023 l:001b3c d:000022 BLOCK
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:194
c:0007 p:0143 s:0021 b:0021 l:000020 d:000020 METHOD
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:96
c:0006 p:0012 s:0017 b:0017 l:001b3c d:000016 BLOCK
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:192
c:0005 p:---- s:0015 b:0015 l:000014 d:000014 FINISH
c:0004 p:---- s:0013 b:0013 l:000012 d:000012 CFUNC :fork
c:0003 p:0075 s:0010 b:0010 l:001b3c d:000009 BLOCK
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:191
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP

/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:191:in block (2 levels) in start_server' /pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:191:infork’
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:192:in block (3 levels) in start_server' /pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:96:indaemonize’
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:194:in block (4 levels) in start_server' /pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:220:insetup_environment’
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:220:in each' /pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:220:inblock
in setup_environment’
/pkgs/ruby19/lib/ruby19/site_ruby/1.9.1/rcodetools/fork.rb:220:in eval' (eval):1:in
(eval):1:in `reopen’

– C level backtrace information

0x814d404 ruby19 (rb_vm_bugreport+0xb2) [0x814d404]
0x8186063 ruby19 [0x8186063]
0x81860de ruby19 (rb_bug+0x24) [0x81860de]
0x80eac71 ruby19 [0x80eac71]
0xffffe440 [0xffffe440]
0x8139582 ruby19 [0x8139582]
0x814b557 ruby19 [0x814b557]
0x813dfdf ruby19 [0x813dfdf]
0x8144c32 ruby19 [0x8144c32]
0x8145a47 ruby19 [0x8145a47]
0x8145f19 ruby19 (rb_f_eval+0xdd) [0x8145f19]
0x8139582 ruby19 [0x8139582]
0x814b557 ruby19 [0x814b557]
0x813dfdf ruby19 [0x813dfdf]
0x8144c32 ruby19 [0x8144c32]
0x8145625 ruby19 (rb_yield+0x49) [0x8145625]
0x815ab48 ruby19 (rb_ary_each+0x3a) [0x815ab48]
0x814b557 ruby19 [0x814b557]
0x813dfdf ruby19 [0x813dfdf]
0x8144c32 ruby19 [0x8144c32]
0x8145668 ruby19 (rb_yield+0x8c) [0x8145668]
0x805c84e ruby19 (rb_protect+0xb7) [0x805c84e]
0x80b877b ruby19 [0x80b877b]
0x814b557 ruby19 [0x814b557]
0x813dfdf ruby19 [0x813dfdf]
0x8144c32 ruby19 [0x8144c32]
0x81474f7 ruby19 (rb_vm_invoke_proc+0x332) [0x81474f7]
0x81526b5 ruby19 [0x81526b5]
0x8152869 ruby19 [0x8152869]
0xb7f274e5 /lib/i686/cmov/libpthread.so.0 [0xb7f274e5]
0xb7e3d10e /lib/i686/cmov/libc.so.6 (clone+0x5e) [0xb7e3d10e]

[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

RUBY_VERSION # =>
$".grep (/cgi/) # =>


#2

e$B$J$+$@$G$9!#e(B

At Wed, 4 Mar 2009 17:47:04 +0900,
removed_email_address@domain.invalid wrote in [ruby-dev:38131]:

trunk e$B$N>l9g$OMn$A$^$9!#e(B

$ ruby19 -S rct-fork -rcgi # e$B%5!<%Pe(B
e$B!J%5!<%P$O@5$7$/F0:n$9$k!Ke(B

$ (echo “RUBY_VERSION # =>”; echo ‘$".grep (/cgi/) # =>’) | xmpfilter --fork
(eval):1: [BUG] Segmentation fault
ruby 1.9.2dev (2009-03-03 trunk 22725) [i686-linux]

e$B:G6a$N4D6-$G$9$,3NG’$G$-$^$;$s$G$7$?!#$H$$$&$+!"e(Brct-forke$B$H$$$&%U%!e(B
e$B%$%k$,8+$D$+$i$J$+$C$?$N$G$9$,!#e(B


#3

From: Nobuyoshi N. removed_email_address@domain.invalid
Subject: [ruby-dev:38318] Re: Bug when daemonizing
Date: Fri, 24 Apr 2009 09:26:50 +0900

e$B$k$S$-$A$G$9!#e(B

e$B%$%k$,8+$D$+$i$J$+$C$?$N$G$9$,!#e(B
e$B$9$$^$;$s!#%Q%C%1!<%8%%9$G$9!#e(B
e$B=$@5$7$F$5$-$[$Ie(B rcodetools 0.8.5 e$B$r%"%C%W%m!<%I$7$^$7$?!#e(B

http://rubyforge.org/projects/rcodetools


#4

e$B$J$+$@$G$9!#e(B

At Fri, 24 Apr 2009 12:57:17 +0900,
removed_email_address@domain.invalid wrote in [ruby-dev:38320]:

e$B$9$$^$;$s!#%Q%C%1!<%8%%9$G$9!#e(B
e$B=$@5$7$F$5$-$[$Ie(B rcodetools 0.8.5 e$B$r%"%C%W%m!<%I$7$^$7$?!#e(B

http://rubyforge.org/projects/rcodetools

e$B$3$s$J46$8$J$s$G$9$,!"2?$+<j=g$,H4$1$F$^$9$+e(B?

$ cd ~/.gem/ruby/1.9.1/gems/rcodetools-0.8.5.0

$ ruby -Ilib -Ibin bin/rct-fork -rcgi
[1] 4925
bin/rct-fork Running as PID 4925 on 9085

$ { echo “RUBY_VERSION # =>”; echo ‘$".grep (/cgi/) # =>’; } |
PATH="./bin:$PATH" ruby -Ilib -Ibin bin/xmpfilter --fork
./bin/rct-fork-client:3:in require': no such file to load -- rcodetools/fork (LoadError) from ./bin/rct-fork-client:3:in
RUBY_VERSION # =>
$".grep (/cgi/) # =>


#5

From: Nobuyoshi N. removed_email_address@domain.invalid
Subject: [ruby-dev:38321] Re: Bug when daemonizing
Date: Fri, 24 Apr 2009 14:41:54 +0900

$ { echo “RUBY_VERSION # =>”; echo ‘$".grep (/cgi/) # =>’; } | PATH="./bin:$PATH" ruby -Ilib -Ibin bin/xmpfilter --fork

RUBYLIB=lib e$B$rF~$l$F$/$@$5$$!#e(B

$ { echo “RUBY_VERSION # =>”; echo ‘$".grep (/cgi/) # =>’; } |
RUBYLIB=lib PATH="./bin:/usr/bin" /usr/local/bin/ruby191 -Ilib -Ibin
bin/xmpfilter --fork
(eval):1: [BUG] Segmentation fault
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]

– control frame ----------
c:0016 p:---- s:0049 b:0049 l:000048 d:000048 CFUNC :reopen
c:0015 p:0014 s:0044 b:0044 l:0024ac d:000104 EVAL (eval):1
c:0014 p:---- s:0042 b:0042 l:000041 d:000041 FINISH
c:0013 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC :eval
c:0012 p:0019 s:0035 b:0035 l:000026 d:000034 BLOCK
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:220
c:0011 p:---- s:0032 b:0032 l:000031 d:000031 FINISH
c:0010 p:---- s:0030 b:0030 l:000029 d:000029 CFUNC :each
c:0009 p:0073 s:0027 b:0027 l:000026 d:000026 METHOD
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:220
c:0008 p:0031 s:0023 b:0023 l:0026a4 d:000022 BLOCK
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:194
c:0007 p:0143 s:0021 b:0021 l:000020 d:000020 METHOD
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:96
c:0006 p:0012 s:0017 b:0017 l:0026a4 d:000016 BLOCK
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:192
c:0005 p:---- s:0015 b:0015 l:000014 d:000014 FINISH
c:0004 p:---- s:0013 b:0013 l:000012 d:000012 CFUNC :fork
c:0003 p:0075 s:0010 b:0010 l:0026a4 d:000009 BLOCK
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:191
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP

– Ruby level backtrace
information-----------------------------------------
(eval):1:in reopen' (eval):1:in
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:220:in eval' /m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:220:inblock in
setup_environment’
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:220:in each' /m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:220:insetup_environment’
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:194:in block (4 levels) in start_server' /m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:96:indaemonize’
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:192:in block (3 levels) in start_server' /m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:191:infork’
/m/home/rubikitch/src/rcodetools/lib/rcodetools/fork.rb:191:in `block (2
levels) in start_server’

– C level backtrace information

0x8112cbe ruby191(rb_vm_bugreport+0x48) [0x8112cbe]
0x813c0dc ruby191 [0x813c0dc]
0x813c150 ruby191(rb_bug+0x27) [0x813c150]
0x80c9735 ruby191 [0x80c9735]
0xffffe440 [0xffffe440]
0x810451b ruby191 [0x810451b]
0x8106594 ruby191 [0x8106594]
0x8108dcd ruby191 [0x8108dcd]
0x810ceed ruby191 [0x810ceed]
0x810e0db ruby191 [0x810e0db]
0x810e711 ruby191 [0x810e711]
0x810ea56 ruby191(rb_f_eval+0xc5) [0x810ea56]
0x810451b ruby191 [0x810451b]
0x8106594 ruby191 [0x8106594]
0x8108dcd ruby191 [0x8108dcd]
0x810ceed ruby191 [0x810ceed]
0x810d4f5 ruby191 [0x810d4f5]
0x810dc14 ruby191(rb_yield+0x47) [0x810dc14]
0x811beaf ruby191(rb_ary_each+0x3a) [0x811beaf]
0x8106594 ruby191 [0x8106594]
0x8108dcd ruby191 [0x8108dcd]
0x810ceed ruby191 [0x810ceed]
0x810d4f5 ruby191 [0x810d4f5]
0x810dc55 ruby191(rb_yield+0x88) [0x810dc55]
0x8059df3 ruby191(rb_protect+0xc1) [0x8059df3]
0x809eefb ruby191 [0x809eefb]
0x8106594 ruby191 [0x8106594]
0x8108dcd ruby191 [0x8108dcd]
0x810ceed ruby191 [0x810ceed]
0x810d4f5 ruby191 [0x810d4f5]
0x810d89b ruby191(rb_vm_invoke_proc+0x81) [0x810d89b]
0x8116d7e ruby191 [0x8116d7e]
0x8116ea5 ruby191 [0x8116ea5]
0xb7f9e4e5 /lib/i686/cmov/libpthread.so.0 [0xb7f9e4e5]
0xb7eb50de /lib/i686/cmov/libc.so.6(clone+0x5e) [0xb7eb50de]

[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

RUBY_VERSION # =>
$".grep (/cgi/) # =>


#6

e$B$J$+$@$G$9!#e(B

At Sun, 26 Apr 2009 01:07:21 +0900,
removed_email_address@domain.invalid wrote in [ruby-dev:38329]:

$ { echo “RUBY_VERSION # =>”; echo ‘$".grep (/cgi/) # =>’; } | PATH="./bin:$PATH" ruby -Ilib -Ibin bin/xmpfilter --fork

RUBYLIB=lib e$B$rF~$l$F$/$@$5$$!#e(B

$ { echo “RUBY_VERSION # =>”; echo ‘$".grep (/cgi/) # =>’; } | RUBYLIB=lib PATH="./bin:/usr/bin" /usr/local/bin/ruby191 -Ilib -Ibin bin/xmpfilter --fork
(eval):1: [BUG] Segmentation fault
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]

– control frame ----------
c:0016 p:---- s:0049 b:0049 l:000048 d:000048 CFUNC :reopen

e$B:G>.%1!<%9$O$3$s$J46$8$G$7$?!#e(B

r, w = IO.pipe
STDOUT.reopen(w)
STDOUT.reopen("/dev/null", “r”)

e$B%b!<%I$rJQ99$G$-$J$$$?$a$KNc30$,H/@8$9$k$N$G$9$,!"%Q%$%W$d%=%1%Ce(B
e$B%H$Ge(Breopene$B$5$l$F$$$?$H$-$K%Q%9$,e(Bnile$B$K$J$C$F$$$Fe(BSEGVe$B$7$F$$$^$7$?!#e(B
SEGVe$B$K4X$7$F$O=$@5$7$^$7$?$,!“Nc30<+BN$Oe(Brcodetoolse$B$N$[$&$r=$@5$9e(B
e$B$kI,MW$,$”$k$H;W$$$^$9!#e(B