るびきちです。

$stdoutに別のオブジェクトを指定した場合、putsでSEGVります。
Ruby 1.9.0では大丈夫です。

class Logger
  def write(obj)
    STDOUT.print Time.now.strftime("%Y/%m/%d %H:%M:%S:"), obj
  end
end
$stdout = Logger.new

print 1,2
puts 1,2


(gdb) bt
#0  0x080d5208 in st_lookup (table=0x4, key=1000, value=0xbf4090c4) at st.c:282
#1  0x08059820 in search_method (klass=3083118216, id=1000, klassp=0x0)
    at eval_method.c:219
#2  0x0805985d in rb_get_method_body (klass=3083118216, id=1000, idp=0xbf409144)
    at eval_method.c:246
#3  0x0805d119 in rb_call0 (klass=3083118216, recv=3083006680, mid=1000, argc=1,
    argv=0xbf4091c0, scope=3, self=3082638840) at eval.c:1383
#4  0x0805d364 in rb_call (klass=3083118216, recv=3083006680, mid=1000, argc=1,
    argv=0xbf4091c0, scope=3) at eval.c:1449
#5  0x0805d5af in rb_funcall (recv=3083006680, mid=1000, n=1) at eval.c:1541
#6  0x0812d889 in rb_exc_new (etype=3083006680,
    ptr=0xbf409264 "method `<f÷' called on terminated object (0xb7c2f47c)", len=54)
    at error.c:340
#7  0x0812d8c0 in rb_exc_new2 (etype=3083006680,
    s=0xbf409264 "method `<f÷' called on terminated object (0xb7c2f47c)")
    at error.c:346
#8  0x0812f13e in rb_raise (exc=3083006680,
    fmt=0x814a54c "method `%s' called on terminated object (%p)") at error.c:1078
#9  0x0805d03f in rb_call0 (klass=0, recv=3083007100, mid=1000, argc=1,
    argv=0xbf40b320, scope=3, self=3082638840) at eval.c:1367
#10 0x0805d364 in rb_call (klass=0, recv=3083007100, mid=1000, argc=1,
    argv=0xbf40b320, scope=3) at eval.c:1449
#11 0x0805d5af in rb_funcall (recv=3083007100, mid=1000, n=1) at eval.c:1541
#12 0x0812d889 in rb_exc_new (etype=3083007100,
    ptr=0xbf40b3c4 "wrong number of arguments(2 for 0)", len=34) at error.c:340
#13 0x0812d8c0 in rb_exc_new2 (etype=3083007100,
    s=0xbf40b3c4 "wrong number of arguments(2 for 0)") at error.c:346
#14 0x0812f13e in rb_raise (exc=3083007100,
    fmt=0x81662d0 "wrong number of arguments(%d for %d)") at error.c:1078
#15 0x08101593 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=0,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:273
#16 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#17 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#18 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#19 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#20 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#21 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#22 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
---Type <return> to continue, or q <return> to quit---
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#23 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#24 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#25 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#26 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#27 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#28 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#29 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#30 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#31 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#32 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#33 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#34 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#35 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#36 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#37 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#38 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#39 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#40 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#41 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#42 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#43 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#44 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#45 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
---Type <return> to continue, or q <return> to quit---
#46 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#47 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#48 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#49 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#50 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#51 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#52 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#53 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#54 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#55 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#56 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#57 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#58 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#59 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#60 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#61 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#62 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#63 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#64 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#65 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#66 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#67 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#68 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#69 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
---Type <return> to continue, or q <return> to quit---
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#70 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#71 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#72 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#73 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#74 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#75 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#76 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#77 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#78 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#79 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#80 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#81 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#82 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#83 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#84 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#85 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#86 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#87 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#88 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#89 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#90 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#91 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#92 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
---Type <return> to continue, or q <return> to quit---
#93 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#94 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#95 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#96 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#97 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#98 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#99 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#100 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#101 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#102 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#103 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#104 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#105 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#106 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#107 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#108 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#109 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548
#110 0x08071970 in rb_f_puts (argc=2, argv=0xb7c37024) at io.c:4567
#111 0x08101600 in call_cfunc (func=0x807192a <rb_f_puts>, recv=3082638840, len=-1,
    argc=2, argv=0xb7c37024) at vm_insnhelper.c:282
#112 0x08101112 in vm_call0 (th=0x819c990, klass=3083036220, recv=3082638840,
    id=6712, oid=0, argc=2, argv=0xb7c37024, body=0xb7c24090, nosuper=0) at vm.c:457
#113 0x0805d315 in rb_call0 (klass=3083036220, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3, self=3082638840) at eval.c:1435
#114 0x0805d364 in rb_call (klass=3082638980, recv=3082638840, mid=6712, argc=2,
    argv=0xb7c37024, scope=3) at eval.c:1449
#115 0x0805d5f0 in rb_funcall2 (recv=3082638840, mid=6712, argc=2, argv=0xb7c37024)
    at eval.c:1548

--
rubikitch
Blog: http://d.hatena.ne.jp/rubikitch/
Site: http://www.rubyist.net/~rubikitch/