diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-01 01:13:53 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-01 01:13:53 +0000 |
commit | 114ff9b3167b5db3227241cb8393510713d8b58c (patch) | |
tree | 761894b66b190a26b00c6d1ffab040908aee34ce /test/ruby | |
parent | ada1f6b2e72370e1e3dfcd2c30a2ea9dc99c78cd (diff) | |
download | ruby-114ff9b3167b5db3227241cb8393510713d8b58c.tar.gz |
Fix C level backtrace on Darwin
SEGV caused by invalid instruction call.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_vm_dump.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_vm_dump.rb b/test/ruby/test_vm_dump.rb new file mode 100644 index 0000000000..9ea725f233 --- /dev/null +++ b/test/ruby/test_vm_dump.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true +require 'test/unit' + +class TestVMDump < Test::Unit::TestCase + def assert_vm_dump_works(args) + assert_in_out_err(args, "", [], [:*, /^.* main \+ \d+$/, :*, /^\[IMPORTANT\]/, :*]) + end + + def test_darwin_invalid_call + assert_vm_dump_works(['-rfiddle', '-eFiddle::Function.new(Fiddle::Pointer.new(1), [], Fiddle::TYPE_VOID).call']) + end + + def test_darwin_segv_in_syscall + assert_vm_dump_works('-e1.times{Process.kill :SEGV,$$}') + end + + def test_darwin_invalid_access + assert_vm_dump_works(['-rfiddle', '-eFiddle.dlunwrap(100).class']) + end +end |