# Just set up a fifo to work with.
require 'tempfile'
fifo_path = File.join(Dir.tmpdir, 'spawn_fifo')
`mkfifo '#{fifo_path}'`

puts "BEFORE SPAWN"
spawned_pid = Process.spawn("echo hello world", STDOUT => fifo_path, :close_others => true)
########################### STALLS HERE ###########################
puts "AFTER SPAWN"


# If spawn worked in this case, then we could read the data from the fifo and display it.
data = File.read(fifo_path)
puts data
Process.waitpid(spawned_pid)

