[comp.unix.aux] panic: do_bio: write count < 0

km@mathcs.emory.edu (Ken Mandelberg) (09/26/89)

There is an NFS bug in A/UX 1.1 that causes a panic if
a "creat" is done on a file that still has data caught
in the buffer cache. The following program should crash
your machine if executed in an NFS imported directory:

char buff[1025]="start\n";
main () {
    int fd;
    fd=creat("x",0777);
    write(fd,buff,1025);
    fd=creat("x",0777);
}


Unfortunately this is exactly what the Unisoft A/UX Pascal 
compiler does to the .s file it writes in case it finds
a Pascal syntax error. If the .s file is over 1K and not a
multiple of 1K at the time--BOOM!

Apple: Is there a kernel fix for this? 
       What about publishing a bug list so we don't have to 
           spend so much time isolating known problems?

Unisoft Pascal Users: The work around is to use a symbolic 
       link to prelink the .s file onto /tmp and avoid the
       problem. We have a front end shell script to do this
       if anyone needs it.


-- 
Ken Mandelberg      | km@mathcs.emory.edu          PREFERRED
Emory University    | {decvax,gatech}!emory!km     UUCP 
Dept of Math and CS | km@emory.bitnet              NON-DOMAIN BITNET  
Atlanta, GA 30322   | Phone: (404) 727-7963

drew@anucsd.oz (Drew Corrigan) (09/29/89)

in article <4374@emory.mathcs.emory.edu>, km@mathcs.emory.edu (Ken Mandelberg) 
says:
> 
> There is an NFS bug in A/UX 1.1 that causes a panic
> [...]
> Unisoft Pascal Users: The work around is to use a symbolic 
>        link to prelink the .s file onto /tmp and avoid the
>        problem. We have a front end shell script to do this
>        if anyone needs it.
 
Thanks for posting this.  This bug has caused us real headaches here while
trying to port the functional language `ml' (which is partially written in
Pascal) to A/UX.  Knowing the cause and a suitable work-around will help us
greatly. 
 
If you could mail/post the shell script it would be further appreciated.
 
I agree that Apple ought to publish a known bug list for A/UX.  It is a most
frustrating exercise to track down Pascal syntax errors through machine
crashes! It would be nice to be alerted to other potential problem areas. 
 
Drew Corrigan.
-- 
Drew Corrigan
Department of Computer Science, Australian National University.
 

edgar@mathcs.emory.edu (Edgar Leon) (09/30/89)

In article <1471@anucsd.oz>, drew@anucsd.oz (Drew Corrigan) writes:
> in article <4374@emory.mathcs.emory.edu>, km@mathcs.emory.edu (Ken Mandelberg) 
> says:
> > 
> > There is an NFS bug in A/UX 1.1 that causes a panic
> > [...]
> > Unisoft Pascal Users: The work around is to use a symbolic 
> >        link to prelink the .s file onto /tmp and avoid the
> >        problem. We have a front end shell script to do this
> >        if anyone needs it.
>  
>  
> If you could mail/post the shell script it would be further appreciated.

The script follows, please note that gpc was moved to gpc.orig
and that we use ksh.

*************************************************************


#! /bin/ksh

# script to avoid panics caused by gpc
# Edgar Leon  9/25/89

tmplink () {
  if [ ! -f $PFILE ]; then
    echo $PFILE does not exist
    rm -f $RMPFILE $RMTMP
    exit 1
  fi

  PFILE=`basename $PFILE '.p' `\.s
  RMPFILE=$RMPFILE" "$PFILE
  TMPFILE=/tmp/`whoami`$RANDOM
  RMTMP=$RMTMP" "$TMPFILE
  rm -f $PFILE
  ln -s $TMPFILE  ./$PFILE 
}

for i in $*
do
  case $i in
    *.p)  PFILE=$i; tmplink ;;
    esac
done

/usr/local/bin/gpc.orig $*
rm -f $RMPFILE $RMTMP