diff --git a/ChangeLog b/ChangeLog index a670ec9aca..57554fb209 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Nov 30 16:19:14 2012 Nobuyoshi Nakada + + * 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 * NEWS: Added RubyGems 2.0.0 diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 16656f0b24..9e8978fd05 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -508,6 +508,13 @@ class TestRubyOptions < Test::Unit::TestCase )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, $$'], + "", //, /# max_name_length) ? max_name_length : (int)len) name = vm->progname; - fprintf(stderr, "* Loaded script: %s\n", StringValueCStr(name)); + fprintf(stderr, "* Loaded script: %.*s\n", + LIMITED_NAME_LENGTH(name), RSTRING_PTR(name)); fprintf(stderr, "\n"); fprintf(stderr, "* Loaded features:\n\n"); for (i=0; iloaded_features); i++) { name = RARRAY_PTR(vm->loaded_features)[i]; - fprintf(stderr, " %4d %s\n", i, StringValueCStr(name)); + 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, "\n"); }