f77, STOP, and /dev/null

utzoo!decvax!pur-ee!purdue!cak utzoo!decvax!pur-ee!purdue!cak
Thu Dec 3 00:23:14 AEST 1981


Ok all you f77 fans, I've got one for you. The system engineer's dream;
a 5 line program that blows up. We were running a larger program that
normally produces a listing, and wanted to throw the listing away, so
we re-opened the unit number to /dev/null. The program did not work;
it got to a point and then started soaking the CPU. Changing the
argument to a regular disk file made it work just fine. The following
test program exhibits the bug:

        open(unit=8,file='/dev/null')
        write(8,1)
1       format('Missle Command') 
        stop
        end

Here's an sdb dialog:

*r
(hit DEL)
interrupt at
read: address 0x3ea8
*t
read(0,27656,1024)
_filbuf(18756)
fread(2147479876,1,15,18756)
t_runc(19956)
f_clos(2147480064)
f_exit()
s_stop(17444,0)
MAIN_()   [null.f:4]
main(1,2147480304,2147480312)
*

Now, can you explain why the STOP routine is trying to read anything?
It appears to be looping, waiting to get something other than EOF
on the file.

This is on 4.0BSD.

Chris Kent



More information about the Comp.bugs.4bsd.ucb-fixes mailing list