ruby-changes:26247
From: naruse <ko1@a...>
Date: Tue, 11 Dec 2012 11:59:05 +0900 (JST)
Subject: [ruby-changes:26247] naruse:r38304 (trunk): Experimentally revert r38041
naruse 2012-12-11 11:58:54 +0900 (Tue, 11 Dec 2012) New Revision: 38304 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38304 Log: Experimentally revert r38041 "vm_dump.c: no methods in segv handler" It may cause segv: http://fb.rubyci.org/~chkbuild/ruby-trunk/log/20121130T090301Z.diff.html.gz Modified files: trunk/ChangeLog trunk/test/ruby/test_rubyoptions.rb trunk/vm_dump.c Index: ChangeLog =================================================================== --- ChangeLog (revision 38303) +++ ChangeLog (revision 38304) @@ -1150,12 +1150,6 @@ * string.c (rb_str_cmp_m): return fixed value, one of -1,0,+1 always. -Fri Nov 30 16:19:14 2012 Nobuyoshi Nakada <nobu@r...> - - * vm_dump.c (rb_vm_bugreport): get rid of calling methods in sigsegv - handler. based on a patch by charliesome (Charlie Somerville) - [ruby-core:49573] [Bug #7402] - Fri Nov 30 16:05:44 2012 Eric Hodel <drbrain@s...> * NEWS: Added RubyGems 2.0.0 Index: vm_dump.c =================================================================== --- vm_dump.c (revision 38303) +++ vm_dump.c (revision 38304) @@ -675,26 +675,14 @@ if (vm) { int i; VALUE name; - long len; - const int max_name_length = 1024; -# define LIMITED_NAME_LENGTH(s) \ - (((len = RSTRING_LEN(s)) > max_name_length) ? max_name_length : (int)len) name = vm->progname; - fprintf(stderr, "* Loaded script: %.*s\n", - LIMITED_NAME_LENGTH(name), RSTRING_PTR(name)); + fprintf(stderr, "* Loaded script: %s\n", StringValueCStr(name)); fprintf(stderr, "\n"); fprintf(stderr, "* Loaded features:\n\n"); for (i=0; i<RARRAY_LEN(vm->loaded_features); i++) { name = RARRAY_PTR(vm->loaded_features)[i]; - if (RB_TYPE_P(name, T_STRING)) { - fprintf(stderr, " %4d %.*s\n", i, - LIMITED_NAME_LENGTH(name), RSTRING_PTR(name)); - } - else { - fprintf(stderr, " %4d #<%s:%p>\n", i, - rb_class2name(CLASS_OF(name)), (void *)name); - } + fprintf(stderr, " %4d %s\n", i, StringValueCStr(name)); } fprintf(stderr, "\n"); } Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 38303) +++ test/ruby/test_rubyoptions.rb (revision 38304) @@ -508,13 +508,6 @@ )x, nil, opts) - - bug7402 = '[ruby-core:49573]' - status = assert_in_out_err(['-e', 'class Bogus; def to_str; exit true; end; end', - '-e', '$".unshift Bogus.new', - '-e', 'Process.kill :SEGV, $$'], - "", //, /#<Bogus:/) - assert_not_predicate(status, :success?, "segv but success #{bug7402}") end def test_DATA -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/