Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 1995 11:31:54 -0700 (PDT)
From:      John Dyson <dyson@Root.COM>
To:        adhir@romulus.worldbank.org (Alok K. Dhir)
Cc:        hackers@FreeBSD.org, erandall@reo.dec.com
Subject:   Re: (fwd) mmap() problem [940412-SNAP, pdksh]
Message-ID:  <199505101831.LAA05484@Root.COM>
In-Reply-To: <9505101712.AA29887@romulus.worldbank.org> from "Alok K. Dhir" at May 10, 95 01:12:25 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 
> Not sure - but this looks like a possible bug?  Has this been addressed 
> already?
> 
> Thanks...
This problem has been fixed in -current for about 3-4wks now.  It has
to do with recursive locking of vnodes necessary to afford read/write
of files that have been mmaped into the mmaped region:

fd = open("badfile", O_RDWR);
addr = mmap(...,fd,...);
write(fd,addr,size_of_write);

> 
> Problem #2 - During the "configure" script, it hangs when scanning for
> "mmap()".  A "kill -9" of the parent shell of the "configure" process
> will bring back a prompt ... but the "configure" process is still there.
> Any attempt to "ls" the directory it was in, or "cat" any files in that
> directory, result in another hang.  Oh dear !
> 
> I investigated this in more depth (adding printf's to the .c file used 
> by "configure" for testing "mmap()") and it seems that the hang occurs
> in the read() performed just after the call to "mmap()".
> 
> "Oh well, it's obviously broken" I thought, and hacked "configure" so 
> that "HAVE_MMAP" doesn't get defined, and the problematical test is skipped.
> I now have a working "ksh", all seems well.
> 
> But what of the miscreant "mmap()" ?  Is this a known bug, or should it
> work ?  Has anybody else had similar problems when running the "configure"
> scripts provided with most ports ?

It works now in -current and of course in release.

I did extensive testing on mmap for coherency, etc because of all of the
new code for the merged, fully coherent buffer cache scheme -- but
did not check this specific case.  It does work now.

John
dyson@root.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505101831.LAA05484>