A bug in dounit.c can cause one to run out of file descriptors which can eventually reward you with a "Core dumped". There is a goto which goes up to retry which reopens scrin but scrin should be closed before this is done; insert an fclose just before the goto.