Make install may make other ruby processs SEGV


#1

e$B$?$^$K!“F0$$$F$$$ke(B ruby e$B%W%m%;%9$,$”$k$H$-$Ke(B make install
e$B$7e(B
e$B$F$7$^$&$3$H$,$"$k$N$G$9$,!"$=$N$H$-$K$=$Ne(B ruby e$B%W%m%;%9$,e(B
segv e$B$K$J$k$3$H$,$"$j$^$9!#e(B

e$BNc$($P!"0J2<$N$h$&$J%W%m%0%i%`$rF0$+$7$F$$$kESCf$KB>$Ne(B
window e$B$+$ie(B make install-nodoc e$B$9$k$He(B segv
e$B$K$J$j$^$9!#e(B

% ./ruby -rzlib -e ’
loop {
p Zlib::Deflate.deflate(“a”)
sleep 1
}’
“x\234K\004\000\000b\000b”
“x\234K\004\000\000b\000b”
“x\234K\004\000\000b\000b”
“x\234K\004\000\000b\000b”
“x\234K\004\000\000b\000b”
zsh: segmentation fault ./ruby -rzlib -e ’ loop { p
Zlib::Deflate.deflate(“a”) sleep 1 }’
% ./ruby -v
ruby 1.9.0 (2006-03-02) [i686-linux]

e$B$3$NLdBj$Oe(B shared library e$B$r=q$-49$($F$7$^$&$H%W%m%;%9$,;H$Ce(B
e$B$F$$$k%3!<%I$,JQ$o$C$F$7$^$&$H$$$&$H$3$m$K$"$j$^$9!#$?$V$s!#e(B

e$B$H$3$m$G!“e(BGNU cp e$B$K$Oe(B --remove-destination
e$B$H$$$&!”%U%!%$%ke(B
e$B$r%3%T!<$9$kA0$K%3%T!<@h$r:o=|$9$k$H$$$&%*%W%7%g%s$,$"$j$^$9!#e(B

e$B$H$$$&$o$1$G!"e(BFileUtils.cp_rf e$B$Ke(B :remove_destination
e$B$H$$$&e(B
e$B%%W%7%g%s$rDI2C$7!“e(Bext/extmk.rb e$B$G$=$l$r;H$&!”$H$$$&$U$&$Ke(B
e$B$9$k$H$$$$$s$8$c$J$$$+$H$
$b$&$s$G$9$,$I$&$G$7$g$&e(B?

Index: ext/extmk.rb

RCS file: /src/ruby/ext/extmk.rb,v
retrieving revision 1.86
diff -u -p -r1.86 extmk.rb
— ext/extmk.rb 20 Feb 2006 08:34:49 -0000 1.86
+++ ext/extmk.rb 2 Mar 2006 17:09:32 -0000
@@ -381,7 +381,7 @@ if $extout
RbConfig.expand(extout = “#$extout”,
RbConfig::CONFIG.merge(“topdir”=>$topdir))
if $install
RbConfig.expand(dest = “#{$destdir}#{$rubylibdir}”)

  • FileUtils.cp_r(extout+"/.", dest, :verbose => true, :noop =>
    $dryrun)
  • FileUtils.cp_r(extout+"/.", dest, :remove_destination => true,
    :verbose => true, :noop => $dryrun)
    exit
    end
    unless $ignore
    Index: lib/fileutils.rb
    ===================================================================
    RCS file: /src/ruby/lib/fileutils.rb,v
    retrieving revision 1.69
    diff -u -p -r1.69 fileutils.rb
    — lib/fileutils.rb 19 Jan 2006 13:20:23 -0000 1.69
    +++ lib/fileutils.rb 2 Mar 2006 17:09:33 -0000
    @@ -392,7 +392,7 @@ module FileUtils
    OPT_TABLE[‘copy’] = %w( noop verbose preserve )

  • Options: preserve noop verbose dereference_root

  • Options: preserve noop verbose dereference_root remove_destination

    Copies +src+ to +dest+. If +src+ is a directory, this method copies

    all its contents recursively. If +dest+ is a directory, copies

@@ -415,11 +415,11 @@ module FileUtils

# but this doesn’t.

def cp_r(src, dest, options = {})

  • fu_check_options options, :preserve, :noop, :verbose,
    :dereference_root
  • fu_output_message “cp -r#{options[:preserve] ? ‘p’ : ‘’}
    #{[src,dest].flatten.join ’ '}” if options[:verbose]
  • fu_check_options options, :preserve, :noop, :verbose,
    :dereference_root, :remove_destination
  • fu_output_message “cp -r#{options[:preserve] ? ‘p’ :
    ‘’}#{options[:remove_destination] ? ’ --remove-destination’ : ‘’}
    #{[src,dest].flatten.join ’ '}” if options[:verbose]
    return if options[:noop]
    fu_each_src_dest(src, dest) do |s, d|
  •  copy_entry s, d, options[:preserve], options[:dereference_root]
    
  •  copy_entry s, d, options[:preserve], options[:dereference_root], 
    

options[:remove_destination]
end
end
module_function :cp_r
@@ -440,9 +440,12 @@ module FileUtils

If +dereference_root+ is true, this method dereference tree root.

  • def copy_entry(src, dest, preserve = false, dereference_root = false)
  • If +remove_destination+ is true, this method removes each

destination file before copy.

  • def copy_entry(src, dest, preserve = false, dereference_root = false,
    remove_destination = false)
    Entry_.new(src, nil, dereference_root).traverse do |ent|
    destent = Entry_.new(dest, ent.rel, false)
  •  File.unlink destent.path if remove_destination && 
    

File.file?(destent.path)
ent.copy destent.path
ent.copy_metadata destent.path if preserve
end


#2

e$B@DLZ$G$9!#e(B

In mail “[ruby-dev:28418] Re: make install may make other ruby
processs SEGV.”
Yukihiro M. removed_email_address@domain.invalid wrote:

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

|e$B$H$$$&$o$1$G!"e(BFileUtils.cp_rf e$B$Ke(B :remove_destination e$B$H$$$&e(B
|e$B%%W%7%g%s$rDI2C$7!“e(Bext/extmk.rb e$B$G$=$l$r;H$&!”$H$$$&$U$&$Ke(B
|e$B$9$k$H$$$$$s$8$c$J$$$+$H$
$b$&$s$G$9$,$I$&$G$7$g$&e(B?

e$B$"$$-$5$s$,!"!V$&$s!W$H$$C$7$c$C$?$i%3%_%C%H$7$F2<$5$$!#e(B

e$B$8$c!"%3%_%C%H$*$M$,$$$7$^$9!#e(B


#3

e$B@DLZ$G$9!#e(B

In mail “[ruby-dev:28419] Re: make install may make other ruby
processs SEGV.”
Minero A. removed_email_address@domain.invalid wrote:

|e$B$H$$$&$o$1$G!"e(BFileUtils.cp_rf e$B$Ke(B :remove_destination e$B$H$$$&e(B
|e$B%%W%7%g%s$rDI2C$7!“e(Bext/extmk.rb e$B$G$=$l$r;H$&!”$H$$$&$U$&$Ke(B
|e$B$9$k$H$$$$$s$8$c$J$$$+$H$
$b$&$s$G$9$,$I$&$G$7$g$&e(B?

e$B$"$$-$5$s$,!"!V$&$s!W$H$$C$7$c$C$?$i%3%_%C%H$7$F2<$5$$!#e(B

e$B$8$c!"%3%_%C%H$*$M$,$$$7$^$9!#e(B

e$B$$$d!"$A$g$C$HBT$C$F$/$@$5$$!#$J$<e(B install
e$B$8$c$J$$$s$G$7$g$&!)e(B


#4

e$B@DLZ$G$9!#e(B

In mail “[ruby-dev:28420] Re: make install may make other ruby
processs SEGV.”
Minero A. removed_email_address@domain.invalid wrote:

e$B$$$d!"$A$g$C$HBT$C$F$/$@$5$$!#$J$<e(B install e$B$8$c$J$$$s$G$7$g$&!)e(B

e$B$=$&$+!“e(Bcp_r e$B$J$s$G$9$M!#$I$&$7$?$b$s$+$J!#e(B
e$B$^$”$$$$$+!#$H$j$"$($:%3%_%C%H$7$A$c$C$F$/$@$5$$!#e(B


#5

In article removed_email_address@domain.invalid,
Minero A. removed_email_address@domain.invalid writes:

e$B$=$&$+!“e(Bcp_r e$B$J$s$G$9$M!#$I$&$7$?$b$s$+$J!#e(B
e$B$^$”$$$$$+!#$H$j$"$($:%3%_%C%H$7$A$c$C$F$/$@$5$$!#e(B

e$B$7$^$7$?!#e(B


#6

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:28417] make install may make other ruby
processs SEGV.”
on Fri, 3 Mar 2006 02:20:12 +0900, Tanaka A. removed_email_address@domain.invalid
writes:

|e$B$H$3$m$G!“e(BGNU cp e$B$K$Oe(B --remove-destination e$B$H$$$&!”%U%!%$%ke(B
|e$B$r%3%T!<$9$kA0$K%3%T!<@h$r:o=|$9$k$H$$$&%%W%7%g%s$,$"$j$^$9!#e(B
|
|e$B$H$$$&$o$1$G!"e(BFileUtils.cp_rf e$B$Ke(B :remove_destination e$B$H$$$&e(B
|e$B%
%W%7%g%s$rDI2C$7!“e(Bext/extmk.rb e$B$G$=$l$r;H$&!”$H$$$&$U$&$Ke(B
|e$B$9$k$H$$$$$s$8$c$J$$$+$H$*$b$&$s$G$9$,$I$&$G$7$g$&e(B?

e$B$"$$-$5$s$,!"!V$&$s!W$H$$C$7$c$C$?$i%3%_%C%H$7$F2<$5$$!#e(B
e$B$$$+$,$G$7$g$&!)e(B e$B!de(B e$B$"$*$-$5$se(B