# Make install may make other ruby processs SEGV

**URL:** <https://www.ruby-forum.com/t/make-install-may-make-other-ruby-processs-segv/75806>\
**Category:** Development\
**Created:** [March 2, 2006, 6:20pm UTC](https://www.ruby-forum.com/t/make-install-may-make-other-ruby-processs-segv/75806 "2006-03-02T18:20:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [March 2, 2006, 6:20pm UTC](https://www.ruby-forum.com/t/make-install-may-make-other-ruby-processs-segv/75806/1 "2006-03-02T18:20:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [March 3, 2006, 6:07am UTC](https://www.ruby-forum.com/t/make-install-may-make-other-ruby-processs-segv/75806/2 "2006-03-03T06:07:59Z")

</div>

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](mailto: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

---

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [March 3, 2006, 6:17am UTC](https://www.ruby-forum.com/t/make-install-may-make-other-ruby-processs-segv/75806/3 "2006-03-03T06:17:02Z")

</div>

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](mailto: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

---

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [March 3, 2006, 6:35am UTC](https://www.ruby-forum.com/t/make-install-may-make-other-ruby-processs-segv/75806/4 "2006-03-03T06:35:08Z")

</div>

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](mailto: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

---

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [March 3, 2006, 1:28pm UTC](https://www.ruby-forum.com/t/make-install-may-make-other-ruby-processs-segv/75806/5 "2006-03-03T13:28:45Z")

</div>

In article [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
Minero A. [removed\_email\_address@domain.invalid](mailto: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

---

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [March 2, 2006, 6:32pm UTC](https://www.ruby-forum.com/t/make-install-may-make-other-ruby-processs-segv/75806/6 "2006-03-02T18:32:11Z")

</div>

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](mailto: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
