The following condensed script throws an EOFError
if $DEBUG is true. With $DEBUG = false it runs fine.
What's the reason for this different behaviour?

$DEBUG = true
px = IO.pipe
px[1].close
begin
   Thread.new {Marshal.load(px[0])}.join
rescue EOFError
end


I'm using 
ruby 1.6.6 (2001-12-26) [i386-linux-gnu] and
ruby 1.7.2 (2002-02-19) [i686-linux]


Klaus Spreckelsen