Bug #6215

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

Added by Jordan Dea-Mattson about 2 years ago. Updated about 1 year ago.

[ruby-core:43787]
Status:Assigned
Priority:Low
Assignee:Shota Fukumori
Category:core
Target version:next minor
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 "#{RUBYVERSION}\n"
print "#{RUBY
PLATFORM}\n"
print "#{RUBYRELEASEDATE}\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 about 2 years ago

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

=begin
Seems very strange.
(({RUBYPATCHLEVEL})) 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 about 2 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 over 1 year 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 libsystemkernel.dylib 0x00007fff8f0f1ce2 _pthreadkill + 10
1 libsystem
c.dylib 0x00007fff8f29c7d2 pthreadkill + 95
2 libsystem
c.dylib 0x00007fff8f28da7a abort + 143
3 libruby.1.9.1.dylib 0x000000010bd7e7d4 rbbug + 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
backrefget + 72 (vminsnhelper.c:978)
7 libruby.1.9.1.dylib 0x000000010be1f36f rbregsearch + 207 (re.c:1358)
8 libruby.1.9.1.dylib 0x000000010be640af rbstrsubbang + 271 (string.c:3613)
9 libruby.1.9.1.dylib 0x000000010be64a44 rb
strsub + 180 (string.c:3733)
10 libruby.1.9.1.dylib 0x000000010bec5257 vm
callmethod + 999 (vminsnhelper.c:404)
11 libruby.1.9.1.dylib 0x000000010beb334f vmexeccore + 18767 (insns.def:1015)
12 libruby.1.9.1.dylib 0x000000010beb7fb3 vmexec + 1459 (vm.c:1220)
13 libruby.1.9.1.dylib 0x000000010beb931d rb
vminvokeproc + 877 (vm.c:624)
14 libruby.1.9.1.dylib 0x000000010bd8594c rbexecendproc + 316 (evaljump.c:128)
15 libruby.1.9.1.dylib 0x000000010bd85a65 rubyfinalize0 + 101 (eval.c:93)
16 libruby.1.9.1.dylib 0x000000010bd85ba0 rubycleanup + 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 about 1 year ago

  • Target version changed from 1.9.3 to next minor

Also available in: Atom PDF