Skip to content

Instantly share code, notes, and snippets.

@mbj
Last active December 5, 2018 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbj/e6795ee5e0583c5541ee250e9942279a to your computer and use it in GitHub Desktop.
Save mbj/e6795ee5e0583c5541ee250e9942279a to your computer and use it in GitHub Desktop.
Crash Ruby 2.5.3
system('uname -a')
# not relevant just to make sure we terminate early
# core dumping is expensive.
Thread.abort_on_exception = true
MUTEX = Mutex.new
# You may have to up this on your platform
50.times do
Thread.new do
pid = Process.fork { MUTEX.synchronize {} }
MUTEX.synchronize {}
Process.waitpid(pid)
end
end
@mbj
Copy link
Author

mbj commented Dec 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment