[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Various] libc/1235: DB2 leaks mmaps (fwd)




Could I con someone into compiling libc on a fast alpha with this patch
applied?

Thanks,
Jason

---------- Forwarded message ----------
Date: Mon, 30 Aug 1999 11:25:55 -0700 (PDT)
From: "H.J. Lu" <hjl@varesearch.com>
To: jgg@faure.debian.org
Cc: jgg@ualberta.ca, GNU C Library <libc-hacker@sourceware.cygnus.com>
Subject: Re: [Various] libc/1235: DB2 leaks mmaps

Could you please try this patch to see if it fixes your problem?

Thanks.


-- 
H.J. Lu (hjl@gnu.org)
---
Mon Aug 30 11:19:56 1999  H.J. Lu  <hjl@gnu.org>

	* db2/common/db_region.c (__db_rdetach): Unmap the region
	if necessary.

Index: db2/common/db_region.c
===================================================================
RCS file: /work/cvs/gnu/glibc-2.1/db2/common/db_region.c,v
retrieving revision 1.1.1.6
diff -u -p -r1.1.1.6 db_region.c
--- db2/common/db_region.c	1998/09/11 13:48:08	1.1.1.6
+++ db2/common/db_region.c	1999/08/30 18:21:17
@@ -507,8 +507,18 @@ __db_rdetach(infop)
 	 * If the region was removed when it was created, no further action
 	 * is required.
 	 */
-	if (F_ISSET(infop, REGION_REMOVED))
+	if (F_ISSET(infop, REGION_REMOVED)) {
+		if (F_ISSET(infop, REGION_PRIVATE)
+		    && !F_ISSET(infop, REGION_MALLOC))
+	 		/*
+			 * If it is private and not malloced, the
+			 * region is still mapped in. We need to
+			 * discard our mapping of the region.
+			 */
+			ret = __db_unmapregion(infop);
 		goto done;
+	}
+
 	/*
 	 * If the region was created in memory returned by malloc, the only
 	 * action required is freeing the memory.


Reply to: