Many thanks for the patch. it looks good. it applied with some minor related cleanups.
-gustaf neumann

On 17.08.11 19:06, Jin Choi wrote:
Hello. I've tracked down and fixed a crashing bug in AOLserver on x64. I 
believe it is correct.

AOLserver was crashing with
Fatal: munmap(0xffffffffffffffff, 0) failed: Invalid argument

I tracked down the only call to munmap in NsUnMap in nsd/fastpath.c. It takes 
the return value of NsMap and tests it against NULL. NsMap is just returning 
the return value from mmap(). The man page says:

RETURN VALUE
       On success, mmap() returns a pointer to the mapped area.  On error, the
       value MAP_FAILED (that is, (void *) -1) is returned, and errno  is  set
       appropriately.



Index: nsd/fastpath.c
===================================================================
RCS file: /cvsroot/aolserver/aolserver/nsd/fastpath.c,v
retrieving revision 1.26
diff -u -r1.26 fastpath.c
--- nsd/fastpath.c      19 Apr 2006 17:48:47 -0000      1.26
+++ nsd/fastpath.c      16 Aug 2011 17:40:51 -0000
@@ -521,7 +521,7 @@
        }
        if (servPtr->fastpath.mmap) {
            map = NsMap(fd, 0, stPtr->st_size, 0,&arg);
-           if (map != NULL) {
+           if (map != MAP_FAILED) {
                close(fd);
                fd = -1;
                result = Ns_ConnReturnData(conn, status, map,





--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<[email protected]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to