# \[Bug #3127\] Encoding#replicate(non\_string)

**URL:** <https://www.ruby-forum.com/t/bug-3127-encoding-replicate-non-string/186677>\
**Category:** Development\
**Created:** [April 11, 2010, 4:54am UTC](https://www.ruby-forum.com/t/bug-3127-encoding-replicate-non-string/186677 "2010-04-11T04:54:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/77aa72/32.png) [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Post date:** [April 11, 2010, 4:54am UTC](https://www.ruby-forum.com/t/bug-3127-encoding-replicate-non-string/186677/1 "2010-04-11T04:54:23Z")

</div>

Bug #3127: Encoding#replicate(non\_string)  
[http://redmine.ruby-lang.org/issues/show/3127](http://redmine.ruby-lang.org/issues/show/3127)

e$B5/I\<\<Te(B: Kazuhiro NISHIYAMA  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal  
e$B%+%F%4%je(B: core, Target version: 1.9.2  
ruby -v: ruby 1.9.2dev (2010-04-11 trunk 27297) [i686-linux]

Encoding#replicate(name) e$B$Ke(B String  
e$B0J30$N%\*%V%8%'%/%H$rEO$9$HMn$A$^$9!#e(B

% ruby-trunk -e ‘Encoding::UTF\_8.replicate(0)’  
-e:1: [BUG] Segmentation fault  
ruby 1.9.2dev (2010-04-11 trunk 27297) [i686-linux]

## – control frame ---------- c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :replicate c:0003 p:0019 s:0006 b:0006 l:000344 d:0008ac EVAL -e:1 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:000344 d:000344 TOP

## – Ruby level backtrace information

-e:1:in `<main>' -e:1:in `replicate’

## – C level backtrace information

/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9(rb\_vm\_bugreport+0x72)  
[0xb7820102]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9 [0xb771e45f]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9(rb\_bug+0x3a) [0xb771e4fa]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9 [0xb77bbfe4]  
[0xb7893410]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9 [0xb780af83]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9 [0xb7818f02]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9 [0xb781085c]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9 [0xb7816994]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9(rb\_iseq\_eval\_main+0xab)  
[0xb7816c6b]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9 [0xb772123a]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9(ruby\_exec\_node+0x25)  
[0xb7721275]  
/home/kazu/opt/ruby-trunk/lib/libruby.so.1.9(ruby\_run\_node+0x35)  
[0xb7722875]  
ruby-trunk(main+0x7e) [0x804886e]  
/lib/tls/i686/cmov/libc.so.6(\_\_libc\_start\_main+0xe6) [0xb750bb56]  
ruby-trunk [0x8048751]

[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](http://www.ruby-lang.org/bugreport.html)

---

<div class="post-metadata">

**Author:** ![Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/77aa72/32.png) [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Post date:** [April 11, 2010, 5:17am UTC](https://www.ruby-forum.com/t/bug-3127-encoding-replicate-non-string/186677/2 "2010-04-11T05:17:49Z")

</div>

e$B%A%1%C%He(B #3127 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

This issue was solved with changeset r27301.  
Kazuhiro, thank you for reporting this issue.  
Your contribution to Ruby is greatly appreciated.  
May Ruby be with you.

* * *

[http://redmine.ruby-lang.org/issues/show/3127](http://redmine.ruby-lang.org/issues/show/3127)
