H From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 18-MAR-1993 01:08:30.21 To:	INFO-VAX@SRI.COM CC:	0 Subj:	Re: Directory not empty. How to delete it?  B First, in preface, I want to reassure Richard Gilbert (and others)B that this is not a "serious" problem.  It doesn't indicate a major% problem with the XQP, so don't panic.    Harry Flowers wrote: 	...E >which is the way we get rid of these, too.  For some reason SAS work F >directories seem to corrupt easily; maybe they're doing direct writesG >to the DIR files or something?  I don't know, but we occasionally have F >to delete them for users, and it only happens with the SAS work dirs.F >I wish that whatever SAS was doing to cause it, they'd stop!  Anyway,G >for now, you're stuck with the above solution.  Now, if DEC could just F >fix the problems with ANA/DISK/REPAIR crashing our VAXes, we might beC >able to clean up the drives after this happens (still with 5.5-2).   G I chose to reply to Harry's posting, not because I mean to pick on him, D but because it was his comments about SAS that forced my hand, so to
 speak.  :)  G I thought that I had posted a note about this last year, but apparently D I didn't.  I, too, have had to get rid of these SAS work directoriesC numerous times.  A couple of years ago, I called SAS and asked them D what the problem was.  In my case, I *only* saw this happen with SAS@ work directories.  Furthermore, it seemed that when I DUMPed theA blocks allocated to the directory, they were always filled with C H source code.  So, I contacted our SAS technical support to find out whatB the heck they were doing!  Anyway, it got back to (one of) the VMSD developers -- I think it was Tom Cole that I spoke with.  He assured@ me that they were using standard VMS services to create the work@ directories.  (See, I wondered if they were doing it "by hand".)  B (Oh, yeah.  SAS provides some utility (ZCLEANUP?) to get rid of anA old work directory.  The problem is that it doesn't work in these @ cases.  SAS said that they had had an occasional report of this,A but never saw it themselves.    *THIS MAKES SENSE, given a little  more information.)  A So, I called back to DEC, and was initially told that SAS must be  doing something wrong.  D Is this enough of a preface?  OK.  Let's skip the rest of the finger
 pointing.  :)   B I managed to get a hold of one of the users (who managed to createF several of these directories), and learned something about her "style"D of computing.  Apparently, the user would issue the SAS command, andC then realize that she had forgotten to do something else first, and D so she would abort SAS via a ^Y.   Once she told me that, I was able) to produce corrupt directories with ease.   G (See, the folks at SAS.COM probably never abort out of SAS right away.)   % [Come on, Derek, get to the *POINT*!]    (OK)  E The upshot is that there is a window of vulnerability in the directry C creation process.  (It isn't atomic.)  The file header is allocated F and initialized *BEFORE* the data blocks are written.  I guess becauseB directories are maintained by the XQP and not by RMS, the EOF dataH for a directory is "not accurate".  (DUMP/HEADER one of your directoriesK some time.  My small directory (1/3) has an EOF block of 2, and a FFB of 0. A The actual data ends at (1,0B6), as determined by the FFFF word.)   F So, if you manage to abort the dirtectory creation process between theD time that the directory header is written and the time that the dataD blocks are initialized (to NULLs, by the way), you will produce this@ condition.  (Try it!  Just do a few CRE/DIRs in a row, and abort6 it, you can make these without having to buy SAS!  :))  D FIX?  What fix?!  I suggested to the DEC CSC person that he submit aC SPR on my behalf suggesting that the header be initialized SANS the @ "is a directory bit" set, initialize the data blocks, and *then*E the the "is a directory" bit.   He said he would, but he doubted that D any work would be done.  This, too, makes sense.  Except in the caseA of SAS (or something like it), folks usually INTENTIONALLY create D directories.  Normally, one wouldn't abort the creation, so normally$ this window doesn't cause a problem.  A What could SAS do?  Put in code to ignore ^Y during the directory D creation.  Will they do this?  I don't know.  They apparently didn't? after I suggested it before.  Maybe if enough of us complain...    -Derek S. Haining   University Computing Services  University of Washington   Seattle, Washington  98195   (206) 543-5579     DEREK@MAX.BITNET   DEREK@MAX.U.WASHINGTON.EDU   