Bug #6215

print "#{RUBY_PATCHLEVEL.slice(2,3)}\n" results in crash

Added by Jordan Dea-Mattson over 3 years ago. Updated over 2 years ago.

[ruby-core:43787]
Status:Assigned
Priority:Normal
Assignee:Shota Fukumori
ruby -v:ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0] Backport:

Description

While using Ruby 1.9.3 and Textmate, I attempted to run the following code fragment:
print "#{RUBY_VERSION}\n"
print "#{RUBY_PLATFORM}\n"
print "#{RUBY_RELEASE_DATE}\n"
print "#{RUBY_PATCHLEVEL.slice(2,3)}\n"}

When executing the line print #{RUBY_PATCHLEVEL.slice(2,3), the Ruby interpreter crashed as outlined in the attached files.

ruby_crash_report_slice.txt Magnifier - Output of Ruby Interpreter Crash (2.89 KB) Jordan Dea-Mattson, 03/28/2012 12:51 PM

ruby_2012-03-27-202304_jordan-macbookpro.crash - Crashreporter Output (10.9 KB) Jordan Dea-Mattson, 03/28/2012 12:51 PM

History

#1 Updated by Nobuyoshi Nakada over 3 years ago

  • Status changed from Open to Feedback
  • Priority changed from Normal to 3

=begin
Seems very strange.
(({RUBY_PATCHLEVEL})) is a (({Fixnum})) and has no (({slice})) method, so (({NoMethodError})) occurs on my machine.
What happens with just:
p RUBY_PATCHLEVEL
?
=end

#2 Updated by Eric Hodel over 3 years ago

According to the crash report, the crash occurs while textmate is handling the NoMethodError, perhaps while reformatting the backtrace.

#3 Updated by Yusuke Endoh almost 3 years ago

  • Status changed from Feedback to Assigned
  • Assignee set to Shota Fukumori

Anyone can reproduce? Sorah-don, could you give it a try?
I think that textmate looks irrelevant in the following trace.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8f0f1ce2 _pthread_kill + 10
1 libsystem_c.dylib 0x00007fff8f29c7d2 pthread_kill + 95
2 libsystem_c.dylib 0x00007fff8f28da7a abort + 143
3 libruby.1.9.1.dylib 0x000000010bd7e7d4 rb_bug + 212
4 libruby.1.9.1.dylib 0x000000010be476bf sigsegv + 127
5 libsystem_c.dylib 0x00007fff8f2eecfa sigtramp + 26
6 libruby.1.9.1.dylib 0x000000010beac7a8 rb_backref_get + 72 (vm_insnhelper.c:978)
7 libruby.1.9.1.dylib 0x000000010be1f36f rb_reg_search + 207 (re.c:1358)
8 libruby.1.9.1.dylib 0x000000010be640af rb
str_sub_bang + 271 (string.c:3613)
9 libruby.1.9.1.dylib 0x000000010be64a44 rb_str_sub + 180 (string.c:3733)
10 libruby.1.9.1.dylib 0x000000010bec5257 vm_call_method + 999 (vm
insnhelper.c:404)
11 libruby.1.9.1.dylib 0x000000010beb334f vm_exec_core + 18767 (insns.def:1015)
12 libruby.1.9.1.dylib 0x000000010beb7fb3 vm_exec + 1459 (vm.c:1220)
13 libruby.1.9.1.dylib 0x000000010beb931d rb_vm_invoke_proc + 877 (vm.c:624)
14 libruby.1.9.1.dylib 0x000000010bd8594c rb_exec_end_proc + 316 (eval_jump.c:128)
15 libruby.1.9.1.dylib 0x000000010bd85a65 ruby_finalize_0 + 101 (eval.c:93)
16 libruby.1.9.1.dylib 0x000000010bd85ba0 ruby_cleanup + 304 (eval.c:135)
17 libruby.1.9.1.dylib 0x000000010bd85ef3 ruby_run_node + 67 (eval.c:244)
18 ruby 0x000000010bd2eedf main + 79 (main.c:40)
19 ruby 0x000000010bd2ee84 start + 52

Yusuke Endoh mame@tsg.ne.jp

#4 Updated by Yui NARUSE over 2 years ago

  • Target version changed from 1.9.3 to next minor

Also available in: Atom PDF