Skip to content

Commit

Permalink
+./examples/sigsegv.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Oct 5, 2012
1 parent 198ed1a commit 03d232f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/sigsegv.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env ruby
#
# You'll need to 'apt-get install libsigsegv-dev' or 'brew install libsigsegv',
# then 'gem install neversaydie' (https://github.com/tenderlove/neversaydie)
#
# Then just run this program:
#
# ./examples/sigsegv.rb
#
# And watch as NeverSayDie tries to read a NULL pointer.
#
require 'neversaydie'
require 'pry-rescue'

class A #< BasicObject
def oops
foo = 1
NeverSayDie.segv
end
end

Pry::rescue do
A.new.oops
end

0 comments on commit 03d232f

Please sign in to comment.