Re: Unclosed files in NCPFS?

Tore Olsen (toreo@tihlde.hist.no)
04 Nov 1997 14:06:44 +0100


Bill Hawes <whawes@star.net> writes:

> Troels Arvin wrote:
> > OK. But I don't know what program would be suitable, then. - 'Cause I
> > only know of Midnight Commander and Apache as programs which seem to
> > cause onclosed files; and these two programs are probably too complex
> > for a strace hunt.
> >
> > I'll try to find a simple program which can elict the same situation.
>
> If anyone else here has experienced a problem with ncpfs leaving files
> open on a Novell server, please let us know. We're trying to find a
> simple example (e.g. a command script) that shows ncpfs failing to close
> files.

Ok, I just got a new Novell server to test on. Simplest case that will
leave an open file:

int main(int argc, char** argv)
{
int fd;
char buf;
if(argc != 2) exit(1);

fork();
fd = open(argv[1], O_RDONLY);
if(fd == -1){
printf("can't open\n");
exit(1);
}
sleep(1); /* probably just needed to "sync" the two processes (?)*/
read(fd, &buf, 1);
sleep(1);
close(fd);
}

This will not always leave an open file, but often enough that I'm
very suspicous that there is some race condition.

This doesn't crash the novell server though, but repeat this 200
times, and it will happen.

Doing `(while /bin/true; do cat foo.txt > /dev/null; done) &' three
times will leave approximately one file open per second.

Any ideas?

-Toreo

-- 
Surprise, fear, and a ruthless dedication to the Gnu!