Project

General

Profile

Actions

Bug #3312

closed

crash in mspec+patch

Added by coatl (caleb clausen) over 14 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-05-17 trunk 27864) [i686-linux]
Backport:
[ruby-core:30293]

Description

=begin
After applying a simple (but hacky) patch to mspec, make test-rubyspec crashes with a segmentation fault.

Here's the patch:

diff --git a/lib/mspec/runner/context.rb b/lib/mspec/runner/context.rb
index 6bd9d1c..f45b8ba 100644
--- a/lib/mspec/runner/context.rb
+++ b/lib/mspec/runner/context.rb
@@ -127,7 +127,13 @@ class ContextState
# Creates an ExampleState instance for the block and stores it
# in a list of examples to evaluate unless the example is filtered.
def it(desc, &block)

  • example = ExampleState.new(self, desc, block)
  • block2=Proc.new{
  •  $timewaster||=Thread.new{ 1 while 1 }
    
  •  $timewaster.priority=-3
    
  •  block.call
    
  • }
  • example = ExampleState.new(self, desc, block2)
    MSpec.actions :add, example
    return if MSpec.guarded?
    @examples << example

And here's the stack dump:
caleb@baytree:~/hold/ruby-trunk$ make test-rubyspec
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./tool/runruby.rb --extout=.ext -- ./spec/mspec/bin/mspec run -B ./spec/default.mspec
ruby 1.9.3dev (2010-05-17 trunk 27864) [i686-linux]
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:131: warning: literal in condition
............/home/caleb/hold/ruby-trunk/spec/rubyspec/language/defined_spec.rb:138: [BUG] Segmentation fault
ruby 1.9.3dev (2010-05-17 trunk 27864) [i686-linux]

-- control frame ----------
c:0040 p:0071 s:0125 b:0125 l:0003b4 d:000124 BLOCK /home/caleb/hold/ruby-trunk/spec/rubyspec/language/defined_spec.rb:138
c:0039 p:---- s:0123 b:0123 l:000122 d:000122 FINISH
c:0038 p:---- s:0121 b:0121 l:000120 d:000120 CFUNC :call
c:0037 p:0056 s:0118 b:0118 l:000bec d:000117 BLOCK /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:133
c:0036 p:---- s:0116 b:0116 l:000115 d:000115 FINISH
c:0035 p:---- s:0114 b:0114 l:000113 d:000113 CFUNC :instance_eval
c:0034 p:0017 s:0111 b:0111 l:000110 d:000110 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:68
c:0033 p:0021 s:0105 b:0105 l:000092 d:000104 BLOCK /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:185
c:0032 p:---- s:0102 b:0102 l:000101 d:000101 FINISH
c:0031 p:---- s:0100 b:0100 l:000095 d:000099 IFUNC
c:0030 p:---- s:0098 b:0098 l:000097 d:000097 CFUNC :each
c:0029 p:---- s:0096 b:0096 l:000095 d:000095 CFUNC :all?
c:0028 p:0053 s:0093 b:0093 l:000092 d:000092 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:185
c:0027 p:0101 s:0087 b:0087 l:000076 d:000086 BLOCK /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:213
c:0026 p:---- s:0082 b:0082 l:000081 d:000081 FINISH
c:0025 p:---- s:0080 b:0080 l:000079 d:000079 CFUNC :each
c:0024 p:0127 s:0077 b:0077 l:000076 d:000076 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:205
c:0023 p:0011 s:0074 b:0074 l:000065 d:000073 BLOCK /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:234
c:0022 p:---- s:0071 b:0071 l:000070 d:000070 FINISH
c:0021 p:---- s:0069 b:0069 l:000068 d:000068 CFUNC :each
c:0020 p:0216 s:0066 b:0066 l:000065 d:000065 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:234
c:0019 p:0109 s:0063 b:0063 l:000062 d:000062 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:37
c:0018 p:0029 s:0056 b:0056 l:000055 d:000055 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/object.rb:11
c:0017 p:0077 s:0049 b:0049 l:0003b4 d:0003b4 TOP /home/caleb/hold/ruby-trunk/spec/rubyspec/language/defined_spec.rb:26
c:0016 p:---- s:0047 b:0047 l:000046 d:000046 FINISH
c:0015 p:---- s:0045 b:0045 l:000044 d:000044 CFUNC :load
c:0014 p:0018 s:0041 b:0041 l:000008 d:000040 BLOCK /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:56
c:0013 p:---- s:0039 b:0039 l:000038 d:000038 FINISH
c:0012 p:---- s:0037 b:0037 l:000036 d:000036 CFUNC :instance_eval
c:0011 p:0017 s:0034 b:0034 l:000033 d:000033 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:68
c:0010 p:0081 s:0028 b:0028 l:000008 d:000bd0 BLOCK /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:56
c:0009 p:---- s:0025 b:0025 l:000024 d:000024 FINISH
c:0008 p:---- s:0023 b:0023 l:000022 d:000022 CFUNC :each
c:0007 p:0055 s:0020 b:0020 l:000008 d:000008 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:50
c:0006 p:0023 s:0016 b:0016 l:000015 d:000015 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:42
c:0005 p:0063 s:0013 b:0013 l:000012 d:000012 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/commands/mspec-run.rb:87
c:0004 p:0098 s:0010 b:0010 l:000009 d:000009 METHOD /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/utils/script.rb:217
c:0003 p:0067 s:0006 b:0006 l:002244 d:002054 EVAL /home/caleb/hold/ruby-trunk/spec/mspec/bin/mspec-run:8
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:002244 d:002244 TOP

-- Ruby level backtrace information ----------------------------------------
/home/caleb/hold/ruby-trunk/spec/mspec/bin/mspec-run:8:in <main>' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/utils/script.rb:217:in main'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/commands/mspec-run.rb:87:in run' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:42:in process'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:50:in files' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:50:in each'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:56:in block in files' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:68:in protect'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:68:in instance_eval' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:56:in block (2 levels) in files'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:56:in load' /home/caleb/hold/ruby-trunk/spec/rubyspec/language/defined_spec.rb:26:in <top (required)>'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/object.rb:11:in describe' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:37:in describe'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:234:in process' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:234:in each'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:234:in block in process' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:205:in process'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:205:in each' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:213:in block in process'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:185:in protect' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:185:in all?'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:185:in each' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:185:in block in protect'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:68:in protect' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/mspec.rb:68:in instance_eval'
/home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:133:in block in it' /home/caleb/hold/ruby-trunk/spec/mspec/lib/mspec/runner/context.rb:133:in call'
/home/caleb/hold/ruby-trunk/spec/rubyspec/language/defined_spec.rb:138:in `block (3 levels) in <top (required)>'

-- C level backtrace information -------------------------------------------
./ruby(rb_vm_bugreport+0xbd) [0x816f24d]
./ruby [0x81af711]
./ruby(rb_bug+0x28) [0x81af7a8]
./ruby [0x80fda55]
[0x4001e410]
./ruby [0x81629ef]
./ruby [0x8168e24]
./ruby(rb_vm_invoke_proc+0x76) [0x8169616]
./ruby [0x8064795]
./ruby [0x8159e3d]
./ruby [0x81620a2]
./ruby [0x81637ac]
./ruby [0x8168e24]
./ruby [0x816b18c]
./ruby [0x816b32f]
./ruby [0x8159e3d]
./ruby [0x81620a2]
./ruby [0x81637ac]
./ruby [0x8168e24]
./ruby(rb_yield_values2+0x42) [0x8169722]
./ruby [0x81a9278]
./ruby [0x815e498]
./ruby(rb_yield+0x4f) [0x816a59f]
./ruby(rb_ary_each+0x41) [0x817edc1]
./ruby [0x815f492]
./ruby [0x8161970]
./ruby(rb_iterate+0xa8) [0x8159f68]
./ruby(rb_block_call+0x3f) [0x815a0ff]
./ruby [0x81a80af]
./ruby [0x81620a2]
./ruby [0x81637ac]
./ruby [0x8168e24]
./ruby(rb_yield+0x4f) [0x816a59f]
./ruby(rb_ary_each+0x41) [0x817edc1]
./ruby [0x81620a2]
./ruby [0x81637ac]
./ruby [0x8168e24]
./ruby(rb_yield+0x4f) [0x816a59f]
./ruby(rb_ary_each+0x41) [0x817edc1]
./ruby [0x81620a2]
./ruby [0x81637ac]
./ruby [0x8168e24]
./ruby(rb_iseq_eval+0x12b) [0x81692cb]
./ruby [0x81b337a]
./ruby [0x81b34c8]
./ruby [0x8159e3d]
./ruby [0x81620a2]
./ruby [0x81637ac]
./ruby [0x8168e24]
./ruby [0x816b18c]
./ruby [0x816b32f]
./ruby [0x8159e3d]
./ruby [0x81620a2]
./ruby [0x81637ac]
./ruby [0x8168e24]
./ruby(rb_yield+0x4f) [0x816a59f]
./ruby(rb_ary_each+0x41) [0x817edc1]
./ruby [0x81620a2]
./ruby [0x81637ac]
./ruby [0x8168e24]
./ruby(rb_iseq_eval_main+0x1d3) [0x8169173]
./ruby [0x805e232]
./ruby(ruby_run_node+0x32) [0x805fc02]
./ruby(main+0x60) [0x805d610]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0x400c8775]
./ruby [0x805d511]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

make: *** [test-rubyspec] Aborted
=end

Actions

Also available in: Atom PDF

Like0
Like0