[Ruby 1.9-Bug#3925][Open] setting Tempfile/StringIO to $std* before startup causes [BUG] Segmentatio

Bug #3925: setting Tempfile/StringIO to $std* before startup causes
[BUG] Segmentation fault

e$B5/I<<Te(B: Akio T.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$B%+%F%4%je(B: core, Target version: 1.9.x
ruby -v: ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-mswin32_100]

$stdout, in,
require ‘stringio’
$stdout = StringIO.new

$ruby -r./d -e ‘puts “hello”’
-e: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-mswin32_100]

– control frame ----------
c:0001 p:0000 s:0002 b:0002 l:00122c d:00122c TOP


io.c.org Sat Jul 24 19:38:33 2010
+++ io.c Mon Oct 11 03:47:30 2010
@@ -8652,9 +8652,9 @@ rb_stdio_set_default_encoding(void)
extern VALUE rb_stdin, rb_stdout, rb_stderr;
VALUE val = Qnil;

  • rb_io_set_encoding(1, &val, rb_stdin);
  • rb_io_set_encoding(1, &val, rb_stdout);
  • rb_io_set_encoding(1, &val, rb_stderr);
  • rb_funcall3(rb_stdin, rb_intern(“set_encoding”), 1, &val);
  • rb_funcall3(rb_stdout, rb_intern(“set_encoding”), 1, &val);
  • rb_funcall3(rb_stderr, rb_intern(“set_encoding”), 1, &val);



e$B%A%1%C%He(B #3925 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE)

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 r29435.
Akio, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs